]> git.cameronkatri.com Git - pw-darwin.git/commitdiff
Bug fixed: even root was unable to edit restricted fields
authorAndrey A. Chernov <ache@FreeBSD.org>
Tue, 21 Mar 1995 15:30:59 +0000 (15:30 +0000)
committerAndrey A. Chernov <ache@FreeBSD.org>
Tue, 21 Mar 1995 15:30:59 +0000 (15:30 +0000)
chpass/edit.c

index b62b40f4211235899cfdd4dbc0fe95cb013fa1c2..b0ef308a318871c380250a4075ff3ded53c3b552 100644 (file)
@@ -124,25 +124,25 @@ display(fd, pw)
        p = strsep(&bp, ",");
        if (p)
          list[E_NAME].save = strdup(p);
-       if (!list[E_NAME].restricted)
+       if (!list[E_NAME].restricted || !uid)
          (void)fprintf(fp, "Full Name: %s\n", p ? p : "");
        
         p = strsep(&bp, ",");
        if (p)
          list[E_LOCATE].save = strdup(p);
-       if (!list[E_LOCATE].restricted)
+       if (!list[E_LOCATE].restricted || !uid)
          (void)fprintf(fp, "Location: %s\n", p ? p : "");
        
         p = strsep(&bp, ",");
        if (p)
          list[E_BPHONE].save = strdup(p);
-       if (!list[E_BPHONE].restricted)
+       if (!list[E_BPHONE].restricted || !uid)
          (void)fprintf(fp, "Office Phone: %s\n", p ? p : "");
        
         p = strsep(&bp, ",");
        if (p)
          list[E_HPHONE].save = strdup(p);
-       if (!list[E_HPHONE].restricted)
+       if (!list[E_HPHONE].restricted || !uid)
          (void)fprintf(fp, "Home Phone: %s\n", p ? p : "");
 
        (void)fchown(fd, getuid(), getgid());