diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2003-11-04 10:54:47 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2003-11-04 10:54:47 +0000 |
commit | 02bd05e386e9bac85d8c06125c2c90e1ebffa7f4 (patch) | |
tree | 4eaf83821f86eeb0d62982307b9b3a3c967ae0e4 /winsup/utils | |
parent | 1f4e5e1571cbe6fb0e0259d2c860c09efdd14ad2 (diff) | |
download | newlib-02bd05e386e9bac85d8c06125c2c90e1ebffa7f4.zip newlib-02bd05e386e9bac85d8c06125c2c90e1ebffa7f4.tar.gz newlib-02bd05e386e9bac85d8c06125c2c90e1ebffa7f4.tar.bz2 |
* 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.
Diffstat (limited to 'winsup/utils')
-rw-r--r-- | winsup/utils/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/utils/passwd.c | 26 |
2 files changed, 22 insertions, 11 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 2df1dd6..eb46b1c 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,5 +1,12 @@ 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). (version): Bump version number to 1.5. (longopts): Add -c, -C, -e, -E, -p, -P options. diff --git a/winsup/utils/passwd.c b/winsup/utils/passwd.c index 3b9231b..a6fc778 100644 --- a/winsup/utils/passwd.c +++ b/winsup/utils/passwd.c @@ -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 |