summaryrefslogtreecommitdiffstats
path: root/src/pwconv.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 16:18:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 16:18:39 +0000
commit5242eef8fc54636a41701fd9d7083ba6e4a4e0b3 (patch)
treee6a0980092957865a937cc0f34446df3d5194e99 /src/pwconv.c
parentReleasing progress-linux version 1:4.13+dfsg1-5~progress7.99u1. (diff)
downloadshadow-5242eef8fc54636a41701fd9d7083ba6e4a4e0b3.tar.xz
shadow-5242eef8fc54636a41701fd9d7083ba6e4a4e0b3.zip
Merging upstream version 1:4.15.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/pwconv.c')
-rw-r--r--src/pwconv.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/pwconv.c b/src/pwconv.c
index 21d36e7..7dd327a 100644
--- a/src/pwconv.c
+++ b/src/pwconv.c
@@ -40,9 +40,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <time.h>
#include <unistd.h>
#include <getopt.h>
+
#include "defines.h"
#include "getdef.h"
#include "prototypes.h"
@@ -66,7 +68,7 @@
/*
* Global variables
*/
-const char *Prog;
+static const char Prog[] = "pwconv";
static bool spw_locked = false;
static bool pw_locked = false;
@@ -153,7 +155,6 @@ int main (int argc, char **argv)
const struct spwd *sp;
struct spwd spent;
- Prog = Basename (argv[0]);
log_set_progname(Prog);
log_set_logfd(stderr);
@@ -163,7 +164,7 @@ int main (int argc, char **argv)
process_root_flag ("-R", argc, argv);
- OPENLOG ("pwconv");
+ OPENLOG (Prog);
process_flags (argc, argv);
@@ -237,7 +238,7 @@ int main (int argc, char **argv)
spent = *sp;
} else {
/* add new shadow entry */
- memset (&spent, 0, sizeof spent);
+ bzero(&spent, sizeof spent);
spent.sp_namp = pw->pw_name;
spent.sp_min = getdef_num ("PASS_MIN_DAYS", -1);
spent.sp_max = getdef_num ("PASS_MAX_DAYS", -1);
@@ -247,7 +248,7 @@ int main (int argc, char **argv)
spent.sp_flag = SHADOW_SP_FLAG_UNSET;
}
spent.sp_pwdp = pw->pw_passwd;
- spent.sp_lstchg = (long) gettime () / SCALE;
+ spent.sp_lstchg = gettime () / DAY;
if (0 == spent.sp_lstchg) {
/* Better disable aging than requiring a password
* change */