summaryrefslogtreecommitdiffstats
path: root/pw/pw_user.c
diff options
context:
space:
mode:
authorDavid Nugent <davidn@FreeBSD.org>2000-01-15 00:20:22 +0000
committerDavid Nugent <davidn@FreeBSD.org>2000-01-15 00:20:22 +0000
commitda87ee1ae0616b15fe67ba63856af79803005d9d (patch)
tree8eb325bf87e8b3547c41712d05ed71ac0def85c8 /pw/pw_user.c
parent689e59177079bab25bc22ccf4c0e9a3954e8306b (diff)
downloadpw-darwin-da87ee1ae0616b15fe67ba63856af79803005d9d.tar.gz
pw-darwin-da87ee1ae0616b15fe67ba63856af79803005d9d.tar.zst
pw-darwin-da87ee1ae0616b15fe67ba63856af79803005d9d.zip
Portability fixes for other bsd4.4 derivatives.
Diffstat (limited to 'pw/pw_user.c')
-rw-r--r--pw/pw_user.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c
index cf9a267..395b69a 100644
--- a/pw/pw_user.c
+++ b/pw/pw_user.c
@@ -123,10 +123,12 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
0,
"",
"User &",
+ "/nonexistent",
"/bin/sh",
- 0,
- 0,
0
+#if defined(__FreeBSD__)
+ ,0
+#endif
};
@@ -396,7 +398,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
if (rc == -1)
err(EX_IOERR, "user '%s' does not exist", pwd->pw_name);
else if (rc != 0) {
- warnc(rc, "passwd update");
+ warn("passwd update");
return EX_IOERR;
}
@@ -405,7 +407,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
if (rc == -1)
warnx("WARNING: user '%s' does not exist in NIS passwd", pwd->pw_name);
else if (rc != 0)
- warnc(rc, "WARNING: NIS passwd update");
+ warn("WARNING: NIS passwd update");
/* non-fatal */
}
@@ -640,7 +642,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
warnx("user '%s' already exists", pwd->pw_name);
return EX_IOERR;
} else if (rc != 0) {
- warnc(rc, "passwd file update");
+ warn("passwd file update");
return EX_IOERR;
}
if (cnf->nispasswd && *cnf->nispasswd=='/') {
@@ -648,7 +650,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
if (rc == -1)
warnx("User '%s' already exists in NIS passwd", pwd->pw_name);
else
- warnc(rc, "NIS passwd update");
+ warn("NIS passwd update");
/* NOTE: we treat NIS-only update errors as non-fatal */
}
} else if (mode == M_UPDATE || mode == M_LOCK || mode == M_UNLOCK) {
@@ -658,7 +660,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
warnx("user '%s' does not exist (NIS?)", pwd->pw_name);
return EX_IOERR;
} else if (rc != 0) {
- warnc(rc, "passwd file update");
+ warn("passwd file update");
return EX_IOERR;
}
if ( cnf->nispasswd && *cnf->nispasswd=='/') {
@@ -666,7 +668,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
if (rc == -1)
warn("User '%s' not found in NIS passwd", pwd->pw_name);
else
- warnc(rc, "NIS passwd update");
+ warn("NIS passwd update");
/* NOTE: NIS-only update errors are not fatal */
}
}
@@ -1136,9 +1138,9 @@ print_user(struct passwd * pwd, int pretty, int v7)
*p = (char) toupper(*p);
}
if (pwd->pw_expire > (time_t)0 && (tptr = localtime(&pwd->pw_expire)) != NULL)
- strftime(acexpire, sizeof acexpire, "%c", tptr);
+ strftime(acexpire, sizeof acexpire, "%e-%b-%Y %T", tptr);
if (pwd->pw_change > (time_t)9 && (tptr = localtime(&pwd->pw_change)) != NULL)
- strftime(pwexpire, sizeof pwexpire, "%c", tptr);
+ strftime(pwexpire, sizeof pwexpire, "%e-%b-%Y %T", tptr);
printf("Login Name: %-15s #%-12ld Group: %-15s #%ld\n"
" Full Name: %s\n"
" Home: %-26.26s Class: %s\n"