From 49630c23359ea52a0e9e46ccf655b048371a653d Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Sun, 31 Jul 2005 08:25:53 +0000 Subject: Change /home symbolic link, so it will point to usr/home instead of /usr/home. Previous symlink was confusing: # cd /jails/virtual_system_1/home # realpath . /usr/home ...and slower. OK'ed by: rwatson, phk --- usr.sbin/pw/pw_user.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'usr.sbin/pw/pw_user.c') diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index 5fd36712821f..6db509a07bee 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -183,7 +183,11 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args) strncat(dbuf, cnf->home, MAXPATHLEN-5); if (mkdir(dbuf, 0755) != -1 || errno == EEXIST) { chown(dbuf, 0, 0); - symlink(dbuf, cnf->home); + /* + * Skip first "/" and create symlink: + * /home -> usr/home + */ + symlink(dbuf+1, cnf->home); } /* If this falls, fall back to old method */ } -- cgit v1.2.3