Author: jkim
Date: Tue Oct  5 18:47:51 2010
New Revision: 213459
URL: http://svn.freebsd.org/changeset/base/213459

Log:
  Revert the unrelated patch crept in the previous commit.

Modified:
  head/usr.sbin/pw/pw_user.c

Modified: head/usr.sbin/pw/pw_user.c
==============================================================================
--- head/usr.sbin/pw/pw_user.c  Tue Oct  5 18:38:23 2010        (r213458)
+++ head/usr.sbin/pw/pw_user.c  Tue Oct  5 18:47:51 2010        (r213459)
@@ -151,14 +151,14 @@ pw_user(struct userconf * cnf, int mode,
                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,
                        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,
                                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,
                                }
                        }
                        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);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to