* 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.
This commit is contained in:
		| @@ -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> | 2003-11-04  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
| 	* passwd.c (UF_LOCKOUT): Remove (defined in lmaccess.h). | 	* passwd.c (UF_LOCKOUT): Remove (defined in lmaccess.h). | ||||||
|   | |||||||
| @@ -175,8 +175,8 @@ PrintPW (PUSER_INFO_3 ui) | |||||||
|  |  | ||||||
|   printf ("Account disabled           : %s", |   printf ("Account disabled           : %s", | ||||||
|   	(ui->usri3_flags & UF_ACCOUNTDISABLE) ? "yes\n" : "no\n"); |   	(ui->usri3_flags & UF_ACCOUNTDISABLE) ? "yes\n" : "no\n"); | ||||||
|   printf ("Password required          : %s", |   printf ("Password not required      : %s", | ||||||
|   	(ui->usri3_flags & UF_PASSWD_NOTREQD) ? "no\n" : "yes\n"); |   	(ui->usri3_flags & UF_PASSWD_NOTREQD) ? "yes\n" : "no\n"); | ||||||
|   printf ("User can't change password : %s", |   printf ("User can't change password : %s", | ||||||
|   	(ui->usri3_flags & UF_PASSWD_CANT_CHANGE) ? "yes\n" : "no\n"); |   	(ui->usri3_flags & UF_PASSWD_CANT_CHANGE) ? "yes\n" : "no\n"); | ||||||
|   printf ("Password never expires     : %s", |   printf ("Password never expires     : %s", | ||||||
| @@ -464,32 +464,36 @@ main (int argc, char **argv) | |||||||
|  |  | ||||||
|   if (lopt || uopt || copt || Copt || eopt || Eopt || popt || Popt || Sopt) |   if (lopt || uopt || copt || Copt || eopt || Eopt || popt || Popt || Sopt) | ||||||
|     { |     { | ||||||
|  |       USER_INFO_1008 uif; | ||||||
|  |  | ||||||
|       if (li->usri3_priv != USER_PRIV_ADMIN) |       if (li->usri3_priv != USER_PRIV_ADMIN) | ||||||
|         return eprint (0, "You have no maintenance privileges."); |         return eprint (0, "You have no maintenance privileges."); | ||||||
|  |       uif.usri1008_flags = ui->usri3_flags; | ||||||
|       if (lopt) |       if (lopt) | ||||||
|         { |         { | ||||||
| 	  if (ui->usri3_priv == USER_PRIV_ADMIN) | 	  if (ui->usri3_priv == USER_PRIV_ADMIN) | ||||||
| 	    return eprint (0, "Locking an admin account is disallowed."); | 	    return eprint (0, "Locking an admin account is disallowed."); | ||||||
|           ui->usri3_flags |= UF_ACCOUNTDISABLE; |           uif.usri1008_flags |= UF_ACCOUNTDISABLE; | ||||||
|         } |         } | ||||||
|       if (uopt) |       if (uopt) | ||||||
|         ui->usri3_flags &= ~UF_ACCOUNTDISABLE; |         uif.usri1008_flags &= ~UF_ACCOUNTDISABLE; | ||||||
|       if (copt) |       if (copt) | ||||||
|         ui->usri3_flags |= UF_PASSWD_CANT_CHANGE; |         uif.usri1008_flags |= UF_PASSWD_CANT_CHANGE; | ||||||
|       if (Copt) |       if (Copt) | ||||||
|         ui->usri3_flags &= ~UF_PASSWD_CANT_CHANGE; |         uif.usri1008_flags &= ~UF_PASSWD_CANT_CHANGE; | ||||||
|       if (eopt) |       if (eopt) | ||||||
|         ui->usri3_flags |= UF_DONT_EXPIRE_PASSWD; |         uif.usri1008_flags |= UF_DONT_EXPIRE_PASSWD; | ||||||
|       if (Eopt) |       if (Eopt) | ||||||
|         ui->usri3_flags &= ~UF_DONT_EXPIRE_PASSWD; |         uif.usri1008_flags &= ~UF_DONT_EXPIRE_PASSWD; | ||||||
|       if (popt) |       if (popt) | ||||||
|         ui->usri3_flags |= UF_PASSWD_NOTREQD; |         uif.usri1008_flags |= UF_PASSWD_NOTREQD; | ||||||
|       if (Popt) |       if (Popt) | ||||||
|         ui->usri3_flags &= ~UF_PASSWD_NOTREQD; |         uif.usri1008_flags &= ~UF_PASSWD_NOTREQD; | ||||||
|  |  | ||||||
|       if (lopt || uopt || copt || Copt || eopt || Eopt || popt || Popt) |       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); |           return EvalRet (ret, NULL); | ||||||
| 	} | 	} | ||||||
|       // Sopt |       // Sopt | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user