Merge pull request #557 from uqam-fob/type-user-explorers

__user: explore with /etc files
This commit is contained in:
Darko Poljak 2017-08-25 11:30:32 +02:00 committed by GitHub
commit 11a974aeff
3 changed files with 18 additions and 5 deletions

View file

@ -23,6 +23,11 @@
if [ -f "$__object/parameter/gid" ]; then
gid=$(cat "$__object/parameter/gid")
getent group "$gid" || true
getent=$(command -v getent)
if [ X != X"${getent}" ]; then
"${getent}" group "$gid" || true
elif [ -f /etc/group ]; then
grep -E "^(${gid}|([^:]+:){2}${gid}):" /etc/group || true
fi
fi

View file

@ -23,5 +23,9 @@
name=$__object_id
getent passwd "$name" || true
getent=$(command -v getent)
if [ X != X"${getent}" ]; then
"${getent}" passwd "$name" || true
elif [ -f /etc/passwd ]; then
grep "^${name}:" /etc/passwd || true
fi

View file

@ -31,5 +31,9 @@ case "$os" in
esac
getent "$database" "$name" || true
getent=$(command -v getent)
if [ X != X"${getent}" ]; then
"${getent}" "$database" "$name" || true
elif [ -f /etc/shadow ]; then
grep "^${name}:" /etc/shadow || true
fi