1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-17 00:31:09 +02:00

15739: use getent instead of /etc/group if possible

This commit is contained in:
Clint Adams 2001-09-06 20:17:12 +00:00
parent b73d71105e
commit 913d8bd5b4
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2001-09-06 Clint Adams <clint@zsh.org>
* 15739: Completion/compaudit: use getent instead
of /etc/group if possible.
2001-09-03 Andrew Main (Zefram) <zefram@zsh.org>
* 15734: Doc/Zsh/zle.yo, Src/Zle/zle_hist.c, Src/Zle/zle_keymap.c,

View file

@ -15,6 +15,8 @@ compaudit() { # Define and then call
emulate -L zsh
setopt extendedglob
[[ -x /usr/bin/getent ]] || getent() { cat /etc/$1 }
# The positional parameters are the directories to check, else fpath.
if (( $# )); then
local _compdir=''
@ -87,7 +89,7 @@ while IFS=: read GROUP _i_pw _i_gid GROUPMEM; do
else
(( _i_gid == EGID )) && break # Somewhat arbitrary
fi
done < /etc/group
done <<(getent group)
# We search for:
# - world/group-writable directories in fpath not owned by root and the user