diff options
author | jkim <jkim@FreeBSD.org> | 2010-10-05 18:47:51 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2010-10-05 18:47:51 +0000 |
commit | 0e16801b8410645202fbe33d5331ed37438f9e81 (patch) | |
tree | 984e31e9f889d0aa887290f17f25011479d2adc0 /usr.sbin | |
parent | e9d0730bf8cda999f33c4fbfd19e3e07dd74fbe3 (diff) | |
download | FreeBSD-src-0e16801b8410645202fbe33d5331ed37438f9e81.zip FreeBSD-src-0e16801b8410645202fbe33d5331ed37438f9e81.tar.gz |
Revert the unrelated patch crept in the previous commit.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pw/pw_user.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index dd92c43..c8364ca 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -151,14 +151,14 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args) cnf->home = arg->val; } - dmode = S_IRWXU | S_IRWXG | S_IRWXO; if ((arg = getarg(args, 'M')) != NULL) { dmode_c = arg->val; if ((set = setmode(dmode_c)) == NULL) errx(EX_DATAERR, "invalid directory creation mode '%s'", dmode_c); - cnf->homemode = getmode(set, dmode); + dmode = getmode(set, S_IRWXU | S_IRWXG | S_IRWXO); free(set); + cnf->homemode = dmode; } /* @@ -186,7 +186,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args) if (strchr(cnf->home+1, '/') == NULL) { strcpy(dbuf, "/usr"); strncat(dbuf, cnf->home, MAXPATHLEN-5); - if (mkdir(dbuf, dmode) != -1 || errno == EEXIST) { + if (mkdir(dbuf, cnf->homemode) != -1 || errno == EEXIST) { chown(dbuf, 0, 0); /* * Skip first "/" and create symlink: @@ -202,7 +202,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args) while ((p = strchr(++p, '/')) != NULL) { *p = '\0'; if (stat(dbuf, &st) == -1) { - if (mkdir(dbuf, dmode) == -1) + if (mkdir(dbuf, cnf->homemode) == -1) goto direrr; chown(dbuf, 0, 0); } else if (!S_ISDIR(st.st_mode)) @@ -211,7 +211,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args) } } if (stat(dbuf, &st) == -1) { - if (mkdir(dbuf, dmode) == -1) { + if (mkdir(dbuf, cnf->homemode) == -1) { direrr: err(EX_OSFILE, "mkdir '%s'", dbuf); } chown(dbuf, 0, 0); |