Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Apr 1996 18:16:04 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-hackers@FreeBSD.org, j@uriah.heep.sax.de
Subject:   Re: comments please
Message-ID:  <199604060816.SAA17173@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> The patch allows 'install' to use a numeric GID or UID in the same way that
>> chgrp (et al)  do.

>> + #ifdef ALLOW_NUMERIC_IDS

>I don't even think this should be #ifdef'ed.  Btw., i missed the patch
>for the Makefile to add it by default.

It shouldn't be ifdefed if you are confident about it.  Perhaps the old
handling should be a runtime option.

Some comments.  The casts in resolve_*id() aren't necessary.  You already
depend on the compiler not warning about the conversions for the broken
pw_uid and pw_gid types in <pwd.h>, and there is no bounds checking in
numeric_id(), so the casts may hide overflow bugs.

The XXX comment is wrong.  uid_t's and gid_t's are no longer unsigned
longs.  (I just fixed this problem in find(1).  It uses strtol(), which
can't handle large inums, sizes, uids or gids.  It failed to find the
large inums generated by devfs.  I used strtoq().  This works, except
for the lack of overflow checking when the result is assigned to a
smaller type, because find doesn't search for any unsigned long long
quantities.)

Bruce



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