[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: How to add a user/group and verify that the UID/GID is free?



And lo, upon Sun, Jul 07, 2002 at 10:03:38PM +0200, Johannes Puschmann spaketh thusly:
> Hi!
> I poking around hours with a specfile.
> I must add a new User/group and will verify  that the UID/GID is unique 
> and if not print  a  error message whats going on.
> 
> 
> Is there a better way as grep the /etc/passwd such as getent?
> I have tried getent, but when the uid is free, rpm fails with bad exit code.
> 

Don't forget to consider that not everyone uses /etc/passwd. There are
a lot of people who use systems like NIS instead, so simply searching
through the file /etc/passwd may not be enough (and using useradd/groupadd
may not be desired by the user).

-- 

Aaron Gaudio                           prothontar @ tarnation.dyndns.org
                   http://tarnation.dyndns.org/~aaron
                            ----------------
  "From fullness, aspect. From aspect, being. From being, emptiness."

Attachment: pgp00002.pgp
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []