Whoops: getnewpasswd() always says "Changing local password for foo".
Change things slightly so this message says "local" or "YP" as needed so we can use it for both NIS and local password changes without confusing people.
This commit is contained in:
parent
a7aa6bd1ea
commit
1724847d45
@ -73,15 +73,17 @@ to64(s, v, n)
|
||||
}
|
||||
|
||||
char *
|
||||
getnewpasswd(pw)
|
||||
getnewpasswd(pw, nis)
|
||||
struct passwd *pw;
|
||||
int nis;
|
||||
{
|
||||
int tries;
|
||||
char *p, *t;
|
||||
char buf[_PASSWORD_LEN+1], salt[9];
|
||||
struct timeval tv;
|
||||
|
||||
(void)printf("Changing local password for %s.\n", pw->pw_name);
|
||||
(void)printf("Changing %s password for %s.\n", pw->pw_name,
|
||||
nis ? "YP" : "local");
|
||||
|
||||
if (uid && pw->pw_passwd[0] &&
|
||||
strcmp(crypt(getpass("Old password:"), pw->pw_passwd),
|
||||
@ -150,7 +152,7 @@ local_passwd(uname)
|
||||
* classes are implemented, go and get the "offset" value for this
|
||||
* class and reset the timer.
|
||||
*/
|
||||
pw->pw_passwd = getnewpasswd(pw);
|
||||
pw->pw_passwd = getnewpasswd(pw, 0);
|
||||
pw->pw_change = 0;
|
||||
pw_copy(pfd, tfd, pw);
|
||||
|
||||
|
@ -50,7 +50,7 @@ uid_t uid;
|
||||
static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */
|
||||
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
|
||||
extern char *getnewpasswd __P(( struct passwd * ));
|
||||
extern char *getnewpasswd __P(( struct passwd * , int ));
|
||||
|
||||
char *
|
||||
getfield(char *gecos, char *field, int size)
|
||||
@ -263,7 +263,7 @@ yp_passwd(char *user)
|
||||
}
|
||||
|
||||
if (use_yp_passwd) {
|
||||
if ((s = getnewpasswd(pw)) == NULL)
|
||||
if ((s = getnewpasswd(pw, 1)) == NULL)
|
||||
exit (1);
|
||||
yppasswd.newpw.pw_passwd = s;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user