Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Insecure directories warning - add clue
- X-seq: zsh-workers 19768
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxxxxx>
- Subject: PATCH: Insecure directories warning - add clue
- Date: Tue, 13 Apr 2004 18:06:48 +0200
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
This is a patch to compinit so that it suggests running compaudit to see
the list of files deemed insecure when running compinit. This is
suggested in a report on the sourceforge tracker.
I've also made compinit print error messages on stderr instead of
stdout.
Oliver
Index: Completion/compinit
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/compinit,v
retrieving revision 1.9
diff -u -r1.9 compinit
--- Completion/compinit	25 Apr 2002 15:35:37 -0000	1.9
+++ Completion/compinit	13 Apr 2004 15:48:10 -0000
@@ -223,7 +223,7 @@
   # Get the options.
 
   if (( ! $# )); then
-    echo "$0: I need arguments"
+    echo "$0: I need arguments" >&2
     return 1
   fi
 
@@ -234,7 +234,7 @@
     [pPkK]) if [[ -n "$type" ]]; then
             # Error if both `-p' and `-k' are given (or one of them
 	    # twice).
-            echo "$0: type already set to $type"
+            echo "$0: type already set to $type" >&2
 	    return 1
 	  fi
 	  if [[ "$opt" = p ]]; then
@@ -253,7 +253,7 @@
   shift OPTIND-1
 
   if (( ! $# )); then
-    echo "$0: I need arguments"
+    echo "$0: I need arguments" >&2
     return 1
   fi
 
@@ -275,11 +275,11 @@
 	    _comps[$cmd]="$func"
 	    _services[$cmd]="$svc"
 	  else
-	    echo "$0: unknown command or service: $svc"
+	    echo "$0: unknown command or service: $svc" >&2
 	    ret=1
 	  fi
 	else
-	  echo "$0: invalid argument: $1"
+	  echo "$0: invalid argument: $1" >&2
 	  ret=1
 	fi
         shift
@@ -299,7 +299,7 @@
     widgetkey)
       while [[ -n $1 ]]; do
 	if [[ $# -lt 3 ]]; then
-	  echo "$0: compdef -K requires <widget> <comp-widget> <key>"
+	  echo "$0: compdef -K requires <widget> <comp-widget> <key>" >&2
 	  return 1
 	fi
 	[[ $1 = _* ]] || 1="_$1"
@@ -317,7 +317,7 @@
       ;;
     key)
       if [[ $# -lt 2 ]]; then
-        echo "$0: missing keys"
+        echo "$0: missing keys" >&2
 	return 1
       fi
 
@@ -390,7 +390,7 @@
     key)
       # Oops, cannot do that yet.
 
-      echo "$0: cannot restore key bindings"
+      echo "$0: cannot restore key bindings" >&2
       return 1
       ;;
     *)
@@ -413,7 +413,8 @@
     if [[ -n "$_i_q" ]]; then
       if [[ "$_i_fail" = ask ]]; then
         if ! read -q "?Ignore insecure $_i_q and continue [ny]? "; then
-	  echo "$0: initialization aborted"
+	  echo "run compaudit to see list of insecure $_i_q" >&2
+	  echo "$0: initialization aborted" >&2
           unfunction compinit compdef
           unset _comp_dumpfile _comp_secure compprefuncs comppostfuncs \
                 _comps _patcomps _postpatcomps _compautos _lastcomp
Messages sorted by:
Reverse Date,
Date,
Thread,
Author