Bug noticed on IRC

Anderson Lizardo lizardo at linuxfromscratch.org
Fri Jan 7 14:53:15 PST 2005

On Friday 07 January 2005 15:03, Matthew Burgess wrote:
> Even easier would be to not specify the '-m' option to useradd (i.e.
> don't have it create the /home/lfs directory), and then do a 'mkdir
> /home/lfs' ourselves.  So it would become:
> useradd -s /bin/bash -g lfs lfs
> mkdir /home/lfs

Or even better:
useradd -d /home/lfs -s /bin/bash -g lfs lfs
install -o lfs -g lfs -d /home/lfs

So we ensure proper permissions to the directory. Note that I've also added 
the "-d /home/lfs" parameter, so we garantee useradd adds the correct (the 
one we create right after) directory to /etc/passwd.

> It still baffles me that the original command failed though.  Maybe SuSE
> is on a really old version of shadow that doesn't support '-k' properly.

Or it's a non-default useradd (e.g. a shell script) that does a test like:

if [ -d $DIR ]; then

So, in this case, /dev/null fails on the test.

PS: Soon we will be asking the user to add the lfs account manually 
to /etc{passwd,group}, just like the old days ;-)
Anderson Lizardo
lizardo at linuxfromscratch.org

More information about the lfs-dev mailing list