summaryrefslogtreecommitdiffstats
path: root/pw/pw.h
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2016-07-13 17:09:20 +0000
committerAlan Somers <asomers@FreeBSD.org>2016-07-13 17:09:20 +0000
commit80285e3e194993731e573e5ffa1eba819e283ddd (patch)
treea6022c60d1351f1b86c630d2144fa0d1ef11de95 /pw/pw.h
parent2a6f15e0cafa2da2bd94b00b1a7285cb9715b5aa (diff)
downloadpw-darwin-80285e3e194993731e573e5ffa1eba819e283ddd.tar.gz
pw-darwin-80285e3e194993731e573e5ffa1eba819e283ddd.tar.zst
pw-darwin-80285e3e194993731e573e5ffa1eba819e283ddd.zip
pw should sanitize the argument of -w.
Otherwise, it will silently disable the login for the selected account if the argument is unrecognizable. usr.sbin/pw/pw.h usr.sbin/pw/pw_conf.c usr.sbin/pw/pw_user.c Use separate rules to validate boolean parameters and passwd parameters. Error out if a password parameter cannot be parsed. usr.sbin/pw/tests/Makefile usr.sbin/pw/tests/crypt.c usr.sbin/pw/tests/pw_useradd.sh usr.sbin/pw/tests/pw_usermod.sh Add tests for the validation. Also, enhance existing password-related tests to actually validate that the correct hash is written to master.passwd. Reviewed by: bapt MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6840
Diffstat (limited to 'pw/pw.h')
-rw-r--r--pw/pw.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/pw/pw.h b/pw/pw.h
index b389f12..05a51c2 100644
--- a/pw/pw.h
+++ b/pw/pw.h
@@ -93,6 +93,7 @@ int groupadd(struct userconf *, char *name, gid_t id, char *members, int fd,
int nis_update(void);
int boolean_val(char const * str, int dflt);
+int passwd_val(char const * str, int dflt);
char const *boolean_str(int val);
char *newstr(char const * p);