From ef6308ed8bafbe7e21c5367aae7f8d2844b34c14 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sat, 29 Jun 2013 15:54:17 +0000 Subject: Fix -Wunsequenced warning Submitted by: dt71@gmx.com --- pw/pw_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pw/pw_user.c') diff --git a/pw/pw_user.c b/pw/pw_user.c index 5f4d7a9..b49cfce 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) -- cgit v1.2.3 From 6864202685c1b4296896ae4f1aa0cf1e30a4d9f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Wed, 3 Jul 2013 09:48:24 +0000 Subject: There is no reason to disallow setting the password or account expiry date to the current date. MFC after: 3 days --- pw/pw_user.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'pw/pw_user.c') diff --git a/pw/pw_user.c b/pw/pw_user.c index b49cfce..4d7e7ce 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -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; -- cgit v1.2.3 From 78ed20543de7f07e92480d9d65202a25b4abcbcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Thu, 4 Jul 2013 07:59:11 +0000 Subject: Fall back to sha512 if passwd_format is not set. MFC after: 3 days --- pw/pw_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pw/pw_user.c') diff --git a/pw/pw_user.c b/pw/pw_user.c index 4d7e7ce..def238c 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -573,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); -- cgit v1.2.3