]> sourceware.org Git - newlib-cygwin.git/commitdiff
* passwd.c (PrintPW): Turn around meaning printed for "Password not
authorCorinna Vinschen <corinna@vinschen.de>
Tue, 4 Nov 2003 10:54:47 +0000 (10:54 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Tue, 4 Nov 2003 10:54:47 +0000 (10:54 +0000)
required" option to be in line with Windows meaning.
(main): Use more appropriate 1008 option when calling
NetUserSetInfo to change flag values.

winsup/utils/ChangeLog
winsup/utils/passwd.c

index 2df1dd60b4ee3d5caaf831cf5aa21b76362f2b0f..eb46b1c3868ff24365cfd7f2262800187c6b43b6 100644 (file)
@@ -1,3 +1,10 @@
+2003-11-04  Corinna Vinschen  <corinna@vinschen.de>
+
+       * passwd.c (PrintPW): Turn around meaning printed for "Password not
+       required" option to be in line with Windows meaning.
+       (main): Use more appropriate 1008 option when calling
+       NetUserSetInfo to change flag values.
+
 2003-11-04  Corinna Vinschen  <corinna@vinschen.de>
 
        * passwd.c (UF_LOCKOUT): Remove (defined in lmaccess.h).
index 3b9231bb08753a908a7de0d2132b2ad30775c7f3..a6fc778d436546ff9a19afad2c6f0128cb61ddb5 100644 (file)
@@ -175,8 +175,8 @@ PrintPW (PUSER_INFO_3 ui)
 
   printf ("Account disabled           : %s",
        (ui->usri3_flags & UF_ACCOUNTDISABLE) ? "yes\n" : "no\n");
-  printf ("Password required          : %s",
-       (ui->usri3_flags & UF_PASSWD_NOTREQD) ? "no\n" : "yes\n");
+  printf ("Password not required      : %s",
+       (ui->usri3_flags & UF_PASSWD_NOTREQD) ? "yes\n" : "no\n");
   printf ("User can't change password : %s",
        (ui->usri3_flags & UF_PASSWD_CANT_CHANGE) ? "yes\n" : "no\n");
   printf ("Password never expires     : %s",
@@ -464,32 +464,36 @@ main (int argc, char **argv)
 
   if (lopt || uopt || copt || Copt || eopt || Eopt || popt || Popt || Sopt)
     {
+      USER_INFO_1008 uif;
+
       if (li->usri3_priv != USER_PRIV_ADMIN)
         return eprint (0, "You have no maintenance privileges.");
+      uif.usri1008_flags = ui->usri3_flags;
       if (lopt)
         {
          if (ui->usri3_priv == USER_PRIV_ADMIN)
            return eprint (0, "Locking an admin account is disallowed.");
-          ui->usri3_flags |= UF_ACCOUNTDISABLE;
+          uif.usri1008_flags |= UF_ACCOUNTDISABLE;
         }
       if (uopt)
-        ui->usri3_flags &= ~UF_ACCOUNTDISABLE;
+        uif.usri1008_flags &= ~UF_ACCOUNTDISABLE;
       if (copt)
-        ui->usri3_flags |= UF_PASSWD_CANT_CHANGE;
+        uif.usri1008_flags |= UF_PASSWD_CANT_CHANGE;
       if (Copt)
-        ui->usri3_flags &= ~UF_PASSWD_CANT_CHANGE;
+        uif.usri1008_flags &= ~UF_PASSWD_CANT_CHANGE;
       if (eopt)
-        ui->usri3_flags |= UF_DONT_EXPIRE_PASSWD;
+        uif.usri1008_flags |= UF_DONT_EXPIRE_PASSWD;
       if (Eopt)
-        ui->usri3_flags &= ~UF_DONT_EXPIRE_PASSWD;
+        uif.usri1008_flags &= ~UF_DONT_EXPIRE_PASSWD;
       if (popt)
-        ui->usri3_flags |= UF_PASSWD_NOTREQD;
+        uif.usri1008_flags |= UF_PASSWD_NOTREQD;
       if (Popt)
-        ui->usri3_flags &= ~UF_PASSWD_NOTREQD;
+        uif.usri1008_flags &= ~UF_PASSWD_NOTREQD;
 
       if (lopt || uopt || copt || Copt || eopt || Eopt || popt || Popt)
        {
-          ret = NetUserSetInfo (NULL, ui->usri3_name, 3, (LPBYTE) ui, NULL);
+          ret = NetUserSetInfo (NULL, ui->usri3_name, 1008, (LPBYTE) &uif,
+                               NULL);
           return EvalRet (ret, NULL);
        }
       // Sopt
This page took 0.034341 seconds and 5 git commands to generate.