Anthony Sorace <[email protected]> said:
> On a "real" plan 9 system, you create the user at the file server
> console, then log in as that user and run newuser. That first step
> creates /usr/$user. The analogue in 9vx is at least 'mkdir /usr/
> $user', and (less likely) possibly creating the actual user in the
> unix world, depending on your intended setup.
>
> Rather than see newuser create the dir if it doesn't exist, I'd rather
> see it exit with an error in that case.
Following on several peoples advice and a suggested code snippet from Erik
I've added the following before the check for profile:
if(! test -d $home){
echo no home directory $home
exit homeless
}
if(! ls -ld $home >[2=] | grep -s '^d-rwx.* '$user){
echo bad permissions
exit homeless
}
I could add the 'mkdir /usr/ $user' to newuser, but then as Erik points out it
would be a special case for 9vx and not work for native plan9. This way it
works if the file server console was never run, so possibly a general solution.
EBo --