summaryrefslogtreecommitdiffstats
path: root/pw
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2013-09-05 20:18:59 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2013-09-05 20:18:59 +0000
commit07d293577197fa03ca31c922a41e0fa9cdc9c8a4 (patch)
tree4261210ceaecbb0a10a4ca8a032fcbde0217541b /pw
parent6909145920be081aacfde7e6a0d985837239abce (diff)
parent3e261d9b7cd823f63f23c7de4aaa0860b969f999 (diff)
downloadpw-darwin-07d293577197fa03ca31c922a41e0fa9cdc9c8a4.tar.gz
pw-darwin-07d293577197fa03ca31c922a41e0fa9cdc9c8a4.tar.zst
pw-darwin-07d293577197fa03ca31c922a41e0fa9cdc9c8a4.zip
Merge from head
Diffstat (limited to 'pw')
-rw-r--r--pw/pw.conf.52
-rw-r--r--pw/pw_user.c8
2 files changed, 3 insertions, 7 deletions
diff --git a/pw/pw.conf.5 b/pw/pw.conf.5
index 3f023aa..61c40e8 100644
--- a/pw/pw.conf.5
+++ b/pw/pw.conf.5
@@ -32,7 +32,7 @@
.Nd format of the pw.conf configuration file
.Sh DESCRIPTION
The file
-.In /etc/pw.conf
+.Pa /etc/pw.conf
contains configuration data for the
.Xr pw 8
utility.
diff --git a/pw/pw_user.c b/pw/pw_user.c
index 5f4d7a9..def238c 100644
--- a/pw/pw_user.c
+++ b/pw/pw_user.c
@@ -200,7 +200,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
strlcpy(dbuf, cnf->home, sizeof(dbuf));
p = dbuf;
if (stat(dbuf, &st) == -1) {
- while ((p = strchr(++p, '/')) != NULL) {
+ while ((p = strchr(p + 1, '/')) != NULL) {
*p = '\0';
if (stat(dbuf, &st) == -1) {
if (mkdir(dbuf, _DEF_DIRMODE) == -1)
@@ -513,8 +513,6 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
time_t now = time(NULL);
time_t expire = parse_date(now, arg->val);
- if (now == expire)
- errx(EX_DATAERR, "invalid password change date `%s'", arg->val);
if (pwd->pw_change != expire) {
pwd->pw_change = expire;
edited = 1;
@@ -533,8 +531,6 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
time_t now = time(NULL);
time_t expire = parse_date(now, arg->val);
- if (now == expire)
- errx(EX_DATAERR, "invalid account expiry date `%s'", arg->val);
if (pwd->pw_expire != expire) {
pwd->pw_expire = expire;
edited = 1;
@@ -577,7 +573,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
lc = login_getpwclass(pwd);
if (lc == NULL ||
- login_setcryptfmt(lc, "md5", NULL) == NULL)
+ login_setcryptfmt(lc, "sha512", NULL) == NULL)
warn("setting crypt(3) format");
login_close(lc);
pwd->pw_passwd = pw_password(cnf, args, pwd->pw_name);