Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Sep 2011 15:01:44 -0700
From:      Jeremy Chadwick <freebsd@jdc.parodius.com>
To:        Ted Faber <faber@isi.edu>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: linux-f10-flashplugin
Message-ID:  <20110929220144.GA3204@icarus.home.lan>
In-Reply-To: <20110929214009.GH2677@vim.isi.edu>
References:  <20110928104226.2e53343f@cox.net> <587271317225583@web125.yandex.ru> <20110928115008.3d121d38@cox.net> <20110928121035.568ff6e6@cox.net> <753371317233305@web145.yandex.ru> <20110929175755.GA1694@callisto.augenstein.ten> <4E84BBE3.1090701@protected-networks.net> <20110929195001.GF2677@vim.isi.edu> <20110929200539.GA24098@icarus.home.lan> <20110929214009.GH2677@vim.isi.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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 |




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110929220144.GA3204>