bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9987: [PATCH] groups,id: add -0, --null option


From: Bernhard Voelker
Subject: bug#9987: [PATCH] groups,id: add -0, --null option
Date: Sat, 21 Sep 2013 12:15:11 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

On 09/19/2013 11:53 AM, Pádraig Brady wrote:
> So I'd avoid getent entirely and do:

Good idea.

> # Add $USER to ensure we have at least one explicit entry
> users="$u"
> # Add 'root' to test multiple groups (as is usually the case)
> id root >/dev/null 2>/dev/null && users="$USERS root"
> # Add 'nobody' to test single group (as is usually the case)
> id nobody >/dev/null 2>/dev/null && users="$USERS nobody"
> # Add $users and '' (implicit $USER) to list to process
> printf '%s\n' $users '' >> users || framework_failure_

Interestingly, the situation is different here (openSUSE):
root is only in group root, and nobody is in the groups
nobody and nogroup.
However, I've added some users which seem to be typical
for being member of one or more groups.

  for u in root man postfix sshd nobody ; do
    id $u >/dev/null 2>&1 && users="$users $u"
  done

New patch attached.  Thanks!

Have a nice day,
Berny

Attachment: id-zero-option-v2.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]