From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: Permissions directories
Date: Fri, 23 Jun 2000 09:09:37 +0200 (MET DST) [thread overview]
Message-ID: <200006230709.JAA05621@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Thu, 22 Jun 2000 16:23:33 +0000
Bart Schaefer wrote:
> On Jun 22, 1:07pm, Sven Wischnowsky wrote:
> } Subject: Re: Permissions directories
> }
> } Bart Schaefer wrote:
> }
> } > I think it's got the test wrong for
> } > the .zwc files, though -- e.g. if the parent of a directory in $fpath
> } > is writable, I believe under the current tests I could still create a
> } > trojan .zwc file there
> }
> } Digest files are not used automatically, they have to be named in
> } $fpath.
>
> Oh, so the documentation under "Autoloaded Functions" is wrong?
Oh, no... I was wrong (obviously this was changed some time...).
> ...
>
> } Or should we give that as a choice at the prompt (don't use/use/ignore)?
>
> It wouldn't hurt, but it's not as important. However, I think you have
> the prompt wrong ... isn't the default answer usually the first one? You
> have "... continue [yn]?" but if I just hit return that's taken as n, not
> y, so it should be "... continue [ny]?". I was about to append a patch,
> but then I became indecisive as to the default *should* be, particularly
> if we allow three choices.
The patch only changes the prompt. compinit just uses `read -q' and
the default behaviour comes from there.
Bye
Sven
Index: Completion/Core/compinit
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/compinit,v
retrieving revision 1.6
diff -u -r1.6 compinit
--- Completion/Core/compinit 2000/06/22 11:09:18 1.6
+++ Completion/Core/compinit 2000/06/23 07:09:14
@@ -347,9 +347,21 @@
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= ;;
0:*) _i_q=files ;;
@@ -359,7 +371,7 @@
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 @@
_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
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~2000-06-23 7:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-06-23 7:09 Sven Wischnowsky [this message]
2000-06-23 7:52 ` Bart Schaefer
2000-06-23 8:04 Sven Wischnowsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200006230709.JAA05621@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).