bugGNU Core Utilities - Bugs: bug #22505, id command fails to retrieve group...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #22505: id command fails to retrieve group info when nss_ldap is used

Submitter:  None
Submitted:  Thu 06 Mar 2008 06:39:43 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Confirmed
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Mon 10 Mar 2008 10:07:27 AM UTC, comment #2: 

Regarding nss_ldap, I guess that this was a bug in nss_ldap it was setting errno explicitly to ENOENT. That problem should be fixed with the latest nss_ldap release (260).

Probably the NSS module handling nisplus has the same problem.

Ralf Haferkamp <rha>
Sat 08 Mar 2008 09:39:12 AM UTC, comment #1: 

Thank you for the report and the patch.
I reproduced the failure using coreutils-6.10 by appending "nisplus" (in place of your suggested nss_ldap) on fedora rawhide.

However this is fixed (or at least made less likely) in the latest snapshot (http://meyering.net/cu/coreutils-ss.tar.lzma) by virtue of the code now using getgrouplist when that function is available.

Since getgrent is supposed to leave errno unchanged upon EOF, I believe this exposes a bug in glibc (also note that ENOENT is not listed as a possible errno value in the POSIX spec for getgrent).   It would seem that few getgrent-using applications care enough about robustness to check this particular condition.

So, regarding your patch, it'd be nice if you would investigate the possibility this is a glibc bug and get it fixed upstream.  Considering the failure is no longer triggered with the latest coreutils snapshot, and the behavior it accommodates is not even standard-conforming, I'm inclined not to use the patch.

Jim Meyering <meyering>
Group administrator
Thu 06 Mar 2008 06:39:43 PM UTC, original submission:  

coreutils-6.10

By just installing nss_ldap and adding it to passwd, group and shadow in /etc/nsswitch.conf, the below happens:

[root@pandora ~]# id miura
uid=501(miura) gid=502(miura)id: failed to get groups for user `miura': No such
file or directory

but:
[root@pandora ~]# getent passwd miura
miura:x:501:502::/home/miura:/bin/bash
[root@pandora ~]# getent group miura
miura:x:502:

Notice that it is not even required to have an ldap server around, nor to configure /etc/ldap.conf.

Downgrading to coreutils-6.9 makes the problem go away.

I tracked it to a change in getugroups() and came up with the attached patch.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #15198:  coreutils-6.10-groupfix.patch added by None (463B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rha (Posted a comment)
  • -email is unavailable- added by meyering (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-03-08 meyering StatusNeed Info Confirmed
    2008-03-08 meyering StatusNone Need Info
    2008-03-06 None Attached File- Added coreutils-6.10-groupfix.patch, #15198

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code