On Thu, 2008-05-01 at 23:26 +0200, Petter Reinholdtsen wrote:
> As a further optimization, I replace the groups call to use 'id -gN'
> instead.  This is the call used by /usr/bin/groups internally to get
> the groups, and it remove the need to reformat of the output using
> sed.

Note that id -Gn without parameters can return different results than id
-Gn with a user parameter. On my system I use pam_group to assign extra
groups to users who login through gdm:

% id -Gn arthur
users src
% id -Gn
users voice cdrom floppy audio src video plugdev scanner

The same is true for the groups command. I haven't looked at the script
itself but it does change functionality.

Also note that the id and groups commands from sid do the more efficient
call to initgroups() instead of going over all groups (when the username
is supplied). This helps a lot in terms of lookup speed with nss-ldapd.

-- 
-- arthur - [EMAIL PROTECTED] - http://people.debian.org/~adejong --

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to