version 1.19, 2000/03/05 19:20:37 |
version 1.20, 2000/09/26 16:00:08 |
|
|
pw_error(tempname, 1, 1); |
pw_error(tempname, 1, 1); |
|
|
(void)fprintf(fp, |
(void)fprintf(fp, |
"#Changing user database information for %s.\n", pw->pw_name); |
"# Changing user database information for %s.\n", pw->pw_name); |
if (!uid) { |
if (!uid) { |
(void)fprintf(fp, "Login: %s\n", pw->pw_name); |
(void)fprintf(fp, "Login: %s\n", pw->pw_name); |
(void)fprintf(fp, "Encrypted password: %s\n", pw->pw_passwd); |
(void)fprintf(fp, "Encrypted password: %s\n", pw->pw_passwd); |
|
|
struct passwd *pw; |
struct passwd *pw; |
{ |
{ |
ENTRY *ep; |
ENTRY *ep; |
char *p; |
char *p, *q; |
struct stat sb; |
struct stat sb; |
FILE *fp; |
FILE *fp; |
int len, alen, line; |
unsigned int len, alen, line; |
static char buf[LINE_MAX]; |
static char buf[LINE_MAX]; |
|
|
if (!(fp = fopen(tempname, "r"))) |
if (!(fp = fopen(tempname, "r"))) |
|
|
goto bad; |
goto bad; |
} |
} |
while (isspace(*++p)); |
while (isspace(*++p)); |
if (ep->except && strpbrk(p, ep->except)) { |
for (q = p; *q && isprint(*q); q++) { |
|
if (ep->except && strchr(ep->except,*q)) |
|
break; |
|
} |
|
if (*q) { |
warnx( |
warnx( |
"illegal character in the \"%s\" field", |
"illegal character in the \"%s\" field", |
ep->prompt); |
ep->prompt); |