From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 12 Apr 2010 07:13:02 -0600 To: <9fans@9fans.net> From: "EBo" Message-ID: In-Reply-To: References: <46914d2c-437d-406e-a928-123f4d09f9f7@u15g2000prd.googlegroups.com> <93c7f0c907631447ddb00c5d9280f5eb@brasstown.quanstro.net> <2a514b8f79dfb3434a836f743f936bb2@brasstown.quanstro.net> , Subject: Re: [9fans] /sys/lib/newuser patch Topicbox-Message-UUID: ff86744a-ead5-11e9-9d60-3106f5b1d025 erik quanstrom 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 --