[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Patch proposal for id.c and groups.c to fix afs bug
From: |
Didi |
Subject: |
Re: Patch proposal for id.c and groups.c to fix afs bug |
Date: |
Tue, 4 Mar 2008 14:35:22 +0100 |
Hey
Just so we don't talk past each other. The problem is that there could
be a case where the 'id' or 'group' commands are called but there is
no user name, neither on the command line nore in the system
(getlogin() == NULL).
The case when an invalid user is given on the commandline is cought by
202 if (pwd == NULL)
203 error (EXIT_FAILURE, 0, _("%s: No such user"), argv[optind]);
So I am assuming that getlogin in combination with getpwnam is the problem. ?!?
Knowing that there must always be a uid we can chage the line :
pwdg = getpwnam (getlogin());
to :
pwdg = getpwuid (geteuid());
I should have know this :) Sorry for the hassle.
Cheers
Didi
On Mon, Mar 3, 2008 at 9:35 PM, Jim Meyering <address@hidden> wrote:
> Didi <address@hidden> wrote:
> > Sorry for any violation of any mailing list rules, this is my first
> > patch to coreutils.
>
> Hello!
>
> No violation ;-)
> Thanks for the report and patch.
>
>
> > On some systems, with AFS, if you call 'id' or 'groups' without a user
> > name parameter it will return a huge group number:
> > $ id -G
> > 500 1103556127
> >
> > The same behavior applies to groups:
> > $ groups
> > ribalba id: cannot find name for group ID 1103556127
> > 1103556127
> >
> > Because of this I propose following patch :
>
> Unfortunately, we can't use that approach, since
> both id and groups have to work even when there isn't
> a user or group name (i.e., when getlogin returns NULL).
>
> Maybe you can find a way to distinguish (at run time)
> between the regular no-user-or-group-name case and your
> AFS nameless-huge-ID case.
>
> ...
>
>
> > The behavior is due to AFS creating a pseudo group in the kernel that
> > does not have a name.
> >
> >
> > Some information to the system I am using:
> > Linux mypc 2.6.9-67.0.4.EL.cernsmp #1 SMP Mon Feb 4 10:15:50 CET 2008
> > x86_64 x86_64 x86_64 GNU/Linux
>
----
www.cern.ch/ribalba / www.ribalba.de
Email / Jabber: address@hidden
Phone (Work) : +41 22 7679376
Skype : ribalba
Address : CERN / IT-FIO-FS / GENEVE 23/ SCHWEIZ