about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2001-09-06 20:17:12 +0000
committerClint Adams <clint@users.sourceforge.net>2001-09-06 20:17:12 +0000
commit913d8bd5b40fbb07826b532bc90b403be924973d (patch)
tree9a39314cfe36fc8776bdb15167788a1e4e98c09f
parentb73d71105eaca6ae001a3e836ab08406ef188789 (diff)
downloadzsh-913d8bd5b40fbb07826b532bc90b403be924973d.tar.gz
zsh-913d8bd5b40fbb07826b532bc90b403be924973d.tar.xz
zsh-913d8bd5b40fbb07826b532bc90b403be924973d.zip
15739: use getent instead of /etc/group if possible
-rw-r--r--ChangeLog5
-rw-r--r--Completion/compaudit4
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5ba72df31..6fd74b22f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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,
diff --git a/Completion/compaudit b/Completion/compaudit
index f03949822..7fbb90e09 100644
--- a/Completion/compaudit
+++ b/Completion/compaudit
@@ -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