diff options
Diffstat (limited to 'chpass/edit.c')
-rw-r--r-- | chpass/edit.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/chpass/edit.c b/chpass/edit.c index c0f61e0..2968c84 100644 --- a/chpass/edit.c +++ b/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 |