diff options
author | 2010-10-05 18:38:23 +0000 | |
---|---|---|
committer | 2010-10-05 18:38:23 +0000 | |
commit | 717c2073724a6d1eef8bcf8dc4c3ec481d36703d (patch) | |
tree | 24f4a5cbe5154e64a246bccbf7c36e29cbe2280d /pw/pw_user.c | |
parent | 0bd62940e7448723174826add8a3541601d442d8 (diff) | |
download | pw-darwin-717c2073724a6d1eef8bcf8dc4c3ec481d36703d.tar.gz pw-darwin-717c2073724a6d1eef8bcf8dc4c3ec481d36703d.tar.zst pw-darwin-717c2073724a6d1eef8bcf8dc4c3ec481d36703d.zip |
Prefer pmap_unmapbios() over pmap_unmapdev(). The binary does not change
after this because pmap_unmapbios() is a macro for pmap_unmapdev() on amd64.
Diffstat (limited to 'pw/pw_user.c')
-rw-r--r-- | pw/pw_user.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c index c8364ca..dd92c43 100644 --- a/pw/pw_user.c +++ b/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); - dmode = getmode(set, S_IRWXU | S_IRWXG | S_IRWXO); + cnf->homemode = getmode(set, dmode); 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, cnf->homemode) != -1 || errno == EEXIST) { + if (mkdir(dbuf, dmode) != -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, cnf->homemode) == -1) + if (mkdir(dbuf, dmode) == -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, cnf->homemode) == -1) { + if (mkdir(dbuf, dmode) == -1) { direrr: err(EX_OSFILE, "mkdir '%s'", dbuf); } chown(dbuf, 0, 0); |