Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Apr 1997 22:57:28 -0700 (MST)
From:      Marc Slemko <marcs@znep.com>
To:        dmaddox@scsn.net
Cc:        hackers@FreeBSD.org
Subject:   Re: `find . -nogroup` doesn't work?
Message-ID:  <Pine.BSF.3.95.970401225125.8420G-100000@alive.znep.com>
In-Reply-To: <199704020459.XAA00487@cola134.scsn.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 1 Apr 1997, Donald J. Maddox wrote:

> 
>     I was attempting to use find(1) to locate files/dirs on
> my system that have bogus owners/groups, but it appears
> that the '-nogroup' and '-noowner' options don't work..
> 
>     Below is a partial listing of the files in my ghostscript
> fonts dir.  You will notice that there are a number of entries
> with unknown owners/groups: 

Looks to me like a bug in the group_from_gid and user_from_uid functions
in pwcache.c.  They set the user name to be equal to the uid if 
it can't be found, but when using a cached name they completely 
disregard the second (nouser) parameter and return it anyway.
This breaks find and looks like a bug in the library functions.

To fix this, I think it would either need a flag that is set when
the cp->name is generated from cp->uid (can't do a comparison later,
since nothing says "111" can't be a valid user name for user 111,
right?) or not put it the uid into cp->name if it isn't found and
do the snprintf each time it is needed if called with nouser == 0.

This problem annoyed me too, but haven't had time to do anything
about it.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.970401225125.8420G-100000>