version 1.3, 1998/05/29 22:26:46 |
version 1.4, 2002/06/27 19:02:40 |
|
|
#ifndef lint |
#ifndef lint |
#if 0 |
#if 0 |
static char sccsid[] = "@(#)field.c 8.4 (Berkeley) 4/2/94"; |
static char sccsid[] = "@(#)field.c 8.4 (Berkeley) 4/2/94"; |
#else |
#else |
static char rcsid[] = "$OpenBSD$"; |
static char rcsid[] = "$OpenBSD$"; |
#endif |
#endif |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
int |
int |
p_login(p, pw, ep) |
p_login(char *p, struct passwd *pw, ENTRY *ep) |
char *p; |
|
struct passwd *pw; |
|
ENTRY *ep; |
|
{ |
{ |
if (!*p) { |
if (!*p) { |
warnx("empty login field"); |
warnx("empty login field"); |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
int |
int |
p_passwd(p, pw, ep) |
p_passwd(char *p, struct passwd *pw, ENTRY *ep) |
char *p; |
|
struct passwd *pw; |
|
ENTRY *ep; |
|
{ |
{ |
if (!*p) |
if (!*p) |
pw->pw_passwd = ""; /* "NOLOGIN"; */ |
pw->pw_passwd = ""; /* "NOLOGIN"; */ |
|
|
warnx("can't save password entry"); |
warnx("can't save password entry"); |
return (1); |
return (1); |
} |
} |
|
|
return (0); |
return (0); |
} |
} |
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
int |
int |
p_uid(p, pw, ep) |
p_uid(char *p, struct passwd *pw, ENTRY *ep) |
char *p; |
|
struct passwd *pw; |
|
ENTRY *ep; |
|
{ |
{ |
uid_t id; |
uid_t id; |
char *np; |
char *np; |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
int |
int |
p_gid(p, pw, ep) |
p_gid(char *p, struct passwd *pw, ENTRY *ep) |
char *p; |
|
struct passwd *pw; |
|
ENTRY *ep; |
|
{ |
{ |
struct group *gr; |
struct group *gr; |
gid_t id; |
gid_t id; |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
int |
int |
p_class(p, pw, ep) |
p_class(char *p, struct passwd *pw, ENTRY *ep) |
char *p; |
|
struct passwd *pw; |
|
ENTRY *ep; |
|
{ |
{ |
if (!*p) |
if (!*p) |
pw->pw_class = ""; |
pw->pw_class = ""; |
|
|
warnx("can't save entry"); |
warnx("can't save entry"); |
return (1); |
return (1); |
} |
} |
|
|
return (0); |
return (0); |
} |
} |
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
int |
int |
p_change(p, pw, ep) |
p_change(char *p, struct passwd *pw, ENTRY *ep) |
char *p; |
|
struct passwd *pw; |
|
ENTRY *ep; |
|
{ |
{ |
if (!atot(p, &pw->pw_change)) |
if (!atot(p, &pw->pw_change)) |
return (0); |
return (0); |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
int |
int |
p_expire(p, pw, ep) |
p_expire(char *p, struct passwd *pw, ENTRY *ep) |
char *p; |
|
struct passwd *pw; |
|
ENTRY *ep; |
|
{ |
{ |
if (!atot(p, &pw->pw_expire)) |
if (!atot(p, &pw->pw_expire)) |
return (0); |
return (0); |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
int |
int |
p_gecos(p, pw, ep) |
p_gecos(char *p, struct passwd *pw, ENTRY *ep) |
char *p; |
|
struct passwd *pw; |
|
ENTRY *ep; |
|
{ |
{ |
if (!*p) |
if (!*p) |
ep->save = ""; |
ep->save = ""; |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
int |
int |
p_hdir(p, pw, ep) |
p_hdir(char *p, struct passwd *pw, ENTRY *ep) |
char *p; |
|
struct passwd *pw; |
|
ENTRY *ep; |
|
{ |
{ |
if (!*p) { |
if (!*p) { |
warnx("empty home directory field"); |
warnx("empty home directory field"); |
|
|
|
|
/* ARGSUSED */ |
/* ARGSUSED */ |
int |
int |
p_shell(p, pw, ep) |
p_shell(char *p, struct passwd *pw, ENTRY *ep) |
char *p; |
|
struct passwd *pw; |
|
ENTRY *ep; |
|
{ |
{ |
char *t; |
char *t; |
|
|
|
|
warnx("%s: non-standard shell", p); |
warnx("%s: non-standard shell", p); |
return (1); |
return (1); |
} |
} |
} |
} else |
else |
|
p = t; |
p = t; |
if (!(pw->pw_shell = strdup(p))) { |
if (!(pw->pw_shell = strdup(p))) { |
warnx("can't save entry"); |
warnx("can't save entry"); |