summaryrefslogtreecommitdiffstats
path: root/pw/pw_conf.c
diff options
context:
space:
mode:
authorEugene Grosbein <eugen@FreeBSD.org>2017-12-09 23:34:00 +0000
committerEugene Grosbein <eugen@FreeBSD.org>2017-12-09 23:34:00 +0000
commit90ec288bde911fac62b4a16b52d3518518cce279 (patch)
tree34add1cd15e8dd8c3ca8a335627e7a8229f3bda2 /pw/pw_conf.c
parent7bc7048d845425d5ae63c7f9b51439368f5263be (diff)
downloadpw-darwin-90ec288bde911fac62b4a16b52d3518518cce279.tar.gz
pw-darwin-90ec288bde911fac62b4a16b52d3518518cce279.tar.zst
pw-darwin-90ec288bde911fac62b4a16b52d3518518cce279.zip
pw(8): correct expiration period handling and command line overrides
to preconfigured values for -e, -p and -w flags. Use non-negative symbols instead of magic values in passwd_val/pw_password functions. PR: 223431 Submitted by: Yuri Pankov (in part, patch for the manual) Reported by: mav (mentor) MFC after: 3 days Relnotes: yes
Diffstat (limited to 'pw/pw_conf.c')
-rw-r--r--pw/pw_conf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pw/pw_conf.c b/pw/pw_conf.c
index e1dc682..36bb8b6 100644
--- a/pw/pw_conf.c
+++ b/pw/pw_conf.c
@@ -200,18 +200,18 @@ passwd_val(char const * str, int dflt)
for (i = 0; booltrue[i]; i++)
if (strcmp(str, booltrue[i]) == 0)
- return 1;
+ return P_YES;
for (i = 0; boolfalse[i]; i++)
if (strcmp(str, boolfalse[i]) == 0)
- return 0;
+ return P_NO;
/*
* Special cases for defaultpassword
*/
if (strcmp(str, "random") == 0)
- return -1;
+ return P_RANDOM;
if (strcmp(str, "none") == 0)
- return -2;
+ return P_NONE;
errx(1, "Invalid value for default password");
}