On Sun, Mar 9, 2008 at 6:31 PM, Sarah Jelinek <Sarah.Jelinek at sun.com> wrote:
> At this point in time, the user does exist in the passwd file in the
> alternate root. Not sure why they would need to exist in the passwd file
> on the livecd for this? I certainly could do this calling chown(). I can
Because when chown(1M) processes its user argument, it calls
getpwnam(user). It then calls chown(file, pw->pw_uid, <gid>). For
getpwnam(3C) to succeed, it then uses the name services as defined in
/etc/nsswitch.conf. I would expect that the live cd would use only
the files name service for passwd and as such, an entry for "jack" in
the live cd's /etc/passwd would be required for getpwnam("jack") to
succeed. I think this is the case - but it seems to be working by
accident rather than by design.
> also user the defined uid and gid values. If this ever changes in that
> these are no longer defines but values input by the users during install
> this will have to be modified.
True enough. I suspect at some time there will be someone that says
"why does every machine have a user named jack?" and no matter what
approach is used a change will be needed. Or is this creating a user
that is specified by the person performing the installation?
--
Mike Gerdts
http://mgerdts.blogspot.com/