summaryrefslogtreecommitdiffstats
path: root/chpass/edit.c
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>1995-08-13 16:12:28 +0000
committerBill Paul <wpaul@FreeBSD.org>1995-08-13 16:12:28 +0000
commitf811b41cc996c70cfc5a1f29938e18cfacec1814 (patch)
treef1e4ce5b338fe0cb45c2e3f72efd88c0f8075a21 /chpass/edit.c
parent0ad8070243d57c40e41817770e963eb7b713c958 (diff)
downloadpw-darwin-f811b41cc996c70cfc5a1f29938e18cfacec1814.tar.gz
pw-darwin-f811b41cc996c70cfc5a1f29938e18cfacec1814.tar.zst
pw-darwin-f811b41cc996c70cfc5a1f29938e18cfacec1814.zip
Take the ypchfn/ypchsh stuff that was removed from passwd
and graft it into chpass. Chpass can now tell when it's being asked to operate on an NIS user and it displayes the appropriate message in the editor template ("Changing NIS information for foo"). After the changes have been made, chpass will promte the user for his NIS password. If the password is correct, the changes are committed to yppasswdd. Hopefully, this should make NIS more transparent to the end user. Note that even the superuser needs to know a user's password before he can change any NIS information (such is the nature of yppasswdd). Also, changes to the password field are not permitted -- that's what yppasswd is for. (The superuser may specify a new password, but again, he needs to know the user's original password before he can change it.)
Diffstat (limited to 'chpass/edit.c')
-rw-r--r--chpass/edit.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/chpass/edit.c b/chpass/edit.c
index 612cb4a..c0f61e0 100644
--- a/chpass/edit.c
+++ b/chpass/edit.c
@@ -52,6 +52,9 @@ static char sccsid[] = "@(#)edit.c 8.3 (Berkeley) 4/2/94";
#include <pw_util.h>
#include "chpass.h"
+#ifdef YP
+#include "pw_yp.h"
+#endif /* YP */
extern char *tempname;
@@ -94,8 +97,13 @@ display(fd, pw)
pw_error(tempname, 1, 1);
(void)fprintf(fp,
- "#Changing user database information for %s.\n", pw->pw_name);
+#ifdef YP
+ "#Changing %s information for %s.\n", _use_yp ? "NIS" : "user database", pw->pw_name);
+ if (!uid && !_use_yp) {
+#else
+ "#Changing user database information for %s.\n", pw->pw_name)
if (!uid) {
+#endif /* YP */
(void)fprintf(fp, "Login: %s\n", pw->pw_name);
(void)fprintf(fp, "Password: %s\n", pw->pw_passwd);
(void)fprintf(fp, "Uid [#]: %d\n", pw->pw_uid);