On Thu, Sep 29, 2011 at 02:40:09PM -0700, Ted Faber wrote:
> On Thu, Sep 29, 2011 at 01:05:40PM -0700, Jeremy Chadwick wrote:
> > On Thu, Sep 29, 2011 at 12:50:01PM -0700, Ted Faber wrote:
> > >   (npviewer.bin:5430): GLib-WARNING **: getpwuid_r(): failed due
> > >   to unknown user id (2139)
> > > ...
> > > I haven't explored the getpwuid_r thing.
> > 
> > Running "id 2139" should return something other than "no such user".  If
> > not, your environment is looking up something that has such ownership.
> 
> 2139 is my uid, and both linux and native FreeBSD seem to agree:
> 
> $ /usr/bin/id
> uid=2139(faber) gid=134(div7)
> groups=134(div7),0(wheel),5(operator),80(www),169(dartgrp),259(sys413),335(cs555fac),356(arpisi),387(crisis),402(ilense),546(xcp),584(webdiv7),605(rfcdev),7001(abac)
> $ /compat/linux/usr/bin/id
> uid=2139 gid=134(div7) 
> groups=0(wheel),5(operator),80(www),169,259,335,356,387,402,546,584,605,7001(abac)

I can only speculate what's going on here, but there's a lot of
inconsistencies in UID<->username and GID<->group name mappings shown in
the Linux "id" program there.

On a native CentOS box, /usr/bin/id *does* return a username alongside
the uid number.  Example:

$ /usr/bin/id
uid=1535(jdc) gid=1535(jdc) groups=101(cvsusers),110(netops),{snipped}

So what I'm getting at: I don't know if the error from glib complaining
about getpwuid_r() "unknown user id" is actually saying "the UID 2139
is unknown", or if it's saying the passwd struct details aren't filled
in completely.  Taken from getpwuid_r(3) RETURN VALUES section:

   The functions getpwent_r(), getpwnam_r(), and getpwuid_r() return 0
   if no error occurred, or an error number to indicate failure.
   It is not an error if a matching entry is not found.  (Thus, if
   result is NULL and the return value is 0, no matching entry exists.)

Likewise I would expect the group names to be expanded as well -- it's
expanding some of them, but not all.  Why doesn't it know about GIDs
169, 259, 335, 356, 387, 402, 546, 584, and 605?

Does Linux emulation on FreeBSD require a separate passwd(5) file
compared to /etc/passwd?  I am not familiar with Linux emulation on
FreeBSD, which is why I find the above output weird.

-- 
| Jeremy Chadwick                                jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                   Mountain View, CA, US |
| Making life hard for others since 1977.               PGP 4BD6C0CB |

_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Reply via email to