On Sat, May 3, 2008 at 4:22 PM, Mike Frysinger <[EMAIL PROTECTED]> wrote:
> On Saturday 03 May 2008, Garrett Cooper wrote:
> > On Fri, May 2, 2008 at 11:39 PM, Mike Frysinger <[EMAIL PROTECTED]>
> wrote:
> > > On Monday 28 April 2008, Garrett Cooper wrote:
> > > > On Mon, Apr 28, 2008 at 1:28 PM, Garrett Cooper <[EMAIL PROTECTED]>
> > >
> > > wrote:
> > > > > On Sun, Apr 27, 2008 at 6:54 PM, Garrett Cooper <
> [EMAIL PROTECTED]>
> > > > >
> > > > > wrote:
> > > > > > On Apr 27, 2008, at 6:37 PM, Mike Frysinger wrote:
> > > > > >
> > > > > > i'm guessing the #! change was an accident. otherwise i've
> > > > > > incorporated
> > > > > >
> > > > > > > the
> > > > > > > re-order and committed.
> > > > > > > -mike
> > > > > >
> > > > > > Ah, the shebang change was intentional but I forgot to remove
> it.
> > > > > > /bin/sh != /bin/bash on FreeBSD..
> > > > > > Thanks,
> > > > > > -Garrett
> > > > >
> > > > > [EMAIL PROTECTED] ~]# id nobody; echo $?
> > > > > uid=99(nobody) gid=99 groups=25(eng),15045(enged),99
> > > > > 1
> > > > >
> > > > > After looking at id.c for coreutils-5.21 I tied down the issue to
> > > > > getgrgid(3). The errno makes absolutely no sense though, and it
> seems
> > >
> > > to
> > >
> > > > > have been "fixed" between various kernel versions:
> > > > >
> > > > > [EMAIL PROTECTED] ~]# ./getgr_t_wrapper.sh
> > > > > 42 ($i) not found in /etc/group
> > > > > 99 ($i) not found in /etc/group
> > > > > Error encountered with getgrgid(99): No such file or directory
> > > > > [EMAIL PROTECTED] ~]# uname -a
> > > > > Linux nova-infra-test1 2.6.9-22.0.2.ELsmp #1 SMP Thu Jan 5
> 17:13:01
> > >
> > > EST
> > >
> > > > > 2006 i686 i686 i386 GNU/Linux
> > > > >
> > > > > headless-horseman src # ~gcooper/getgr_t_wrapper.sh
> > > > > 42 ($i) not found in /etc/group
> > > > > Error encountered with getgrgid(42): 0, Success
> > > > > 99 ($i) not found in /etc/group
> > > > > Error encountered with getgrgid(99): 0, Success
> > > > >
> > > > > So, the moral of the story I suppose is "don't trust buggy kernels
> > >
> > > which
> > >
> > > > > reporting the wrong errno info via get*[gu]id". I really don't
> like
> > >
> > > the
> > >
> > > > > fact that the manpage doesn't match the expected behavior though
> > > >:
> > > >:(...
> > > >:
> > > > > I attached the test source files and have started an upstream
> > >
> > > discussion
> > >
> > > > > with the folks at kernel.org: <
> > > > > http://bugzilla.kernel.org/show_bug.cgi?id=10573>.
> > > >
> > > > (sorry -- forgot the introduction):
> > > >
> > > > I was basically saying, "maybe we should avoid looking at exit codes
> > >
> > > from
> > >
> > > > id"?
> > >
> > > doesnt matter to me so long as the same result is achieved: a method
> for
> > > reliably querying the system for users. i'd point out that since
> we're
> > > so heavily reliant on /etc/passwd already, might as well convert ife
> to
> > > gfe on /etc/passwd.
> >
> > That's what I was sort of hinting at too, but the fact is that
> there
> > are a lot of UID's not present in the system passwd file on NIS/Kerberos
> > enabled systems, correct? Then again if they exist in /etc/passwd, then
> > maybe it's a moot point, apart from the fact that the UID won't be the
> > same...
>
> i realize that, but as soon as you start reading/writing /etc/passwd
> and /etc/group, you've broken this sort of flexibility. IDcheck.sh is
> already broken in this regard, so ...
> -mike
>
This script is trivial and the use case should probably be restricted to
local users only. Besides, NIS/Kerberos values for users override local
values, with exception of single-user mode setup, right? So, let's just take
id(1) out of the equation together..
-Garrett
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list