From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18190 invoked from network); 6 Sep 2001 20:49:19 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 Sep 2001 20:49:19 -0000 Received: (qmail 25495 invoked by alias); 6 Sep 2001 20:49:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15740 Received: (qmail 25479 invoked from network); 6 Sep 2001 20:49:11 -0000 Date: Thu, 6 Sep 2001 16:49:09 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Subject: PATCH: Debian-specific compaudit security Message-ID: <20010906164909.A25119@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Debian policy requires that /usr/local/share/zsh/site-functions (or equivalent) be root:staff mode 2775. compaudit will complain if this is the case and the aforementioned directory is in $fpath, so this patch special-cases /usr/local directories when /etc/debian_version is present. This will still cause problems when non-root-owned files are added, but I'm less comfortable ignoring those. I imagine this should be more generic in at least one way. Index: Completion/compaudit =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/compaudit,v retrieving revision 1.4 diff -u -r1.4 compaudit --- Completion/compaudit 2001/09/06 20:17:14 1.4 +++ Completion/compaudit 2001/09/06 20:42:03 @@ -82,7 +82,7 @@ # by NFS group sharing with an untrustworthy machine). So we must assume # that this has not happened, and pick the best group. -local GROUP GROUPMEM _i_pw _i_gid +local GROUP GROUPMEM _i_pw _i_gid _i_ulwdirs while IFS=: read GROUP _i_pw _i_gid GROUPMEM; do if (( UID == EUID )); then [[ $GROUP == $LOGNAME ]] && break @@ -108,6 +108,13 @@ _i_wdirs=( ${^fpath}(Nf:g+w:,f:o+w:,^u0u${EUID}) ${^fpath}/..(Nf:g+w:,f:o+w:,^u0u${EUID}) ) fi + +if [[ -f /etc/debian_version ]] +then +_i_ulwdirs=( ${(M)_i_wdirs:#/usr/local/*} ) +_i_wdirs=( ${_i_wdirs:#/usr/local/*} ${^_i_ulwdir}(Nf:g+ws:^g:staff:,f:o+w:,^u0) ) +fi + _i_wdirs=( $_i_wdirs ${^fpath}.zwc^([^_]*|*~)(N^u0u${EUID}) ) _i_wfiles=( ${^fpath}/^([^_]*|*~)(N^u0u${EUID}) )