summaryrefslogtreecommitdiff
path: root/usr.bin/chpass/edit.c
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>1996-02-23 16:08:59 +0000
committerBill Paul <wpaul@FreeBSD.org>1996-02-23 16:08:59 +0000
commitc2dfe9fe014dd449e198112e1896f20e38c36ead (patch)
tree63fdeb3efaed446e57edb0c129cc0139d5c75d71 /usr.bin/chpass/edit.c
parent41955e9114579cf6764a0d49599a4e30aa4f54f4 (diff)
Notes
Diffstat (limited to 'usr.bin/chpass/edit.c')
-rw-r--r--usr.bin/chpass/edit.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.bin/chpass/edit.c b/usr.bin/chpass/edit.c
index c0f61e06f8ee..2968c84fa3d4 100644
--- a/usr.bin/chpass/edit.c
+++ b/usr.bin/chpass/edit.c
@@ -99,7 +99,7 @@ display(fd, pw)
(void)fprintf(fp,
#ifdef YP
"#Changing %s information for %s.\n", _use_yp ? "NIS" : "user database", pw->pw_name);
- if (!uid && !_use_yp) {
+ if (!uid && (!_use_yp || suser_override)) {
#else
"#Changing user database information for %s.\n", pw->pw_name)
if (!uid) {
@@ -118,11 +118,19 @@ display(fd, pw)
*pw->pw_shell ? pw->pw_shell : _PATH_BSHELL);
}
/* Only admin can change "restricted" shells. */
+#ifdef 0
else if (ok_shell(pw->pw_shell))
/*
* Make shell a restricted field. Ugly with a
* necklace, but there's not much else to do.
*/
+#else
+ else if ((!list[E_SHELL].restricted && ok_shell(pw->pw_shell)) || !uid)
+ /*
+ * If change not restrict (table.c) and standard shell
+ * OR if root, then allow editing of shell.
+ */
+#endif
(void)fprintf(fp, "Shell: %s\n",
*pw->pw_shell ? pw->pw_shell : _PATH_BSHELL);
else