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 authentification level.

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

Submitted by:  None
Submitted on:  Thu 06 Mar 2008 06:39:43 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Confirmed
Privacy: PublicAssigned 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>
Project 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

 

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
  • -unavailable- added by rha (Posted a comment)
  • -unavailable- added by meyering (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 08 Mar 2008 09:40:52 AM UTCmeyeringStatusNeed Info=>Confirmed
    Sat 08 Mar 2008 09:39:12 AM UTCmeyeringStatusNone=>Need Info
    Thu 06 Mar 2008 06:39:43 PM UTCNoneAttached File-=>Added coreutils-6.10-groupfix.patch, #15198

    Back to the top


    Powered by Savane 3.1-cleanup