From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sun, 11 Apr 2010 23:34:33 -0600 To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net>, "Anthony Sorace" From: "EBo" Message-ID: In-Reply-To: <4AF242F1-479F-4819-97B1-69BBBF5EA9B0@9srv.net> 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: ff53269e-ead5-11e9-9d60-3106f5b1d025 Anthony Sorace 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 --