1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-10-02 08:51:18 +02:00

even more compiinit stuff, change prompt, search for insecure parent dirs (12041)

This commit is contained in:
Sven Wischnowsky 2000-06-23 07:10:40 +00:00
parent 12fd5d0065
commit 806220d4ff
2 changed files with 22 additions and 5 deletions

@ -1,3 +1,8 @@
2000-06-23 Sven Wischnowsky <wischnow@zsh.org>
* 12041: Completion/Core/compinit: even more compiinit stuff,
change prompt, search for insecure parent dirs
2000-06-22 Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
* 12040: Src/builtin.c: typeset -r on existing parameter set

@ -347,8 +347,20 @@ if [[ -n "$_i_check" ]]; then
if [[ "$_i_fail" != use ]]; then
typeset _i_q
_i_wdirs=( ${^fpath}(Nf:g+w:,f:o+w:,^u0u${EUID}) )
_i_wfiles=( ${^~fpath:/.}/^([^_]*|*~)(N^u0u${EUID}) )
# We search for:
# - world/group-writable directories in fpath not owned by root or the user
# - parent-directories of directories in fpath that are world/group-writable
# and not owned by root or the user (that would allow someone to put a
# digest file for one of the directories into the parent directory)
# - digest files for one of the directories in fpath not owned by root or
# the user
# - and for files in directories from fpath not owned by root or the user
# (including zwc files)
_i_wdirs=( ${^fpath}(Nf:g+w:,f:o+w:,^u0u${EUID})
${^fpath}/..(Nf:g+w:,f:o+w:,^u0u${EUID})
${^fpath}.zwc^([^_]*|*~)(N^u0u${EUID}) )
_i_wfiles=( ${^fpath}/^([^_]*|*~)(N^u0u${EUID}) )
case "${#_i_wdirs}:${#_i_wfiles}" in
0:0) _i_q= ;;
@ -359,7 +371,7 @@ if [[ -n "$_i_check" ]]; then
if [[ -n "$_i_q" ]]; then
if [[ "$_i_fail" = ask ]]; then
if ! read -q "?There are insecure $_i_q, continue [yn]? "; then
if ! read -q "?There are insecure $_i_q, continue [ny]? "; then
unfunction compinit compdef
unset _comp_dumpfile _comp_secure compprefuncs comppostfuncs \
_comps _patcomps _postpatcomps _compautos _lastcomp
@ -369,8 +381,8 @@ if [[ -n "$_i_check" ]]; then
_i_wfiles=()
_i_wdirs=()
else
(( $#_i_wfiles )) && _i_files=( "${(@)_i_files:#(${(j:|:)_i_wfiles})}" )
(( $#_i_wdirs )) && _i_files=( "${(@)_i_files:#(${(j:|:)_i_wdirs})/*}" )
(( $#_i_wfiles )) && _i_files=( "${(@)_i_files:#(${(j:|:)_i_wfiles%.zwc})}" )
(( $#_i_wdirs )) && _i_files=( "${(@)_i_files:#(${(j:|:)_i_wdirs%.zwc})/*}" )
fi
fi
_comp_secure=yes