summaryrefslogtreecommitdiffstats
path: root/pw
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2005-07-31 08:25:53 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2005-07-31 08:25:53 +0000
commitae677b85dafb89bccdf97017d019f8eb67fa0e7a (patch)
tree3f049fb400c693a2ee354cc59b953739251a076f /pw
parente851c0da909e5d927fe1d66ee18b05132f1da214 (diff)
downloadpw-darwin-ae677b85dafb89bccdf97017d019f8eb67fa0e7a.tar.gz
pw-darwin-ae677b85dafb89bccdf97017d019f8eb67fa0e7a.tar.zst
pw-darwin-ae677b85dafb89bccdf97017d019f8eb67fa0e7a.zip
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
Diffstat (limited to 'pw')
-rw-r--r--pw/pw_user.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c
index 5fd3671..6db509a 100644
--- a/pw/pw_user.c
+++ b/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 */
}