[BACK]Return to field.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / chpass

Diff for /src/usr.bin/chpass/field.c between version 1.3 and 1.4

version 1.3, 1998/05/29 22:26:46 version 1.4, 2002/06/27 19:02:40
Line 37 
Line 37 
 #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 */
Line 59 
Line 59 
   
 /* 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");
Line 88 
Line 85 
   
 /* 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"; */
Line 99 
Line 93 
                 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;
Line 133 
Line 124 
   
 /* 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;
Line 166 
Line 154 
   
 /* 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 = "";
Line 177 
Line 162 
                 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);
Line 196 
Line 178 
   
 /* 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);
Line 209 
Line 188 
   
 /* 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 = "";
Line 225 
Line 201 
   
 /* 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");
Line 243 
Line 216 
   
 /* 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;
   
Line 264 
Line 234 
                         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");

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4