erik quanstrom <quans...@quanstro.net> said:

> > 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
> > }
> 
> you must also exit if ~ $user none.  i'd also recommend
> aborting if ~ $home /.  you don't want none making
> files in /.  on a regular plan 9 system, that's no worry, but
> 9vx, ...

The reason I did not include ~ $home / is that the first two lines of code in
newuser are:

user=`{cat /dev/user}
home=/usr/$user

so home can never be just / (unless I am missing something here), but the ~
$user none is a very good point.  Thanks!

  EBo --


Reply via email to