get the temporary file and fd handling right.
[unix-history] / usr / src / usr.bin / chpass / field.c
index 14d618d..919a72d 100644 (file)
@@ -2,27 +2,17 @@
  * Copyright (c) 1988 The Regents of the University of California.
  * All rights reserved.
  *
  * Copyright (c) 1988 The Regents of the University of California.
  * All rights reserved.
  *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley.  The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * %sccs.include.redist.c%
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)field.c    5.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)field.c    5.13 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #include <pwd.h>
 #include <grp.h>
 #endif /* not lint */
 
 #include <sys/param.h>
 #include <pwd.h>
 #include <grp.h>
-#include <strings.h>
+#include <string.h>
 #include <stdio.h>
 #include <ctype.h>
 #include "chpass.h"
 #include <stdio.h>
 #include <ctype.h>
 #include "chpass.h"
@@ -32,7 +22,7 @@ static char sccsid[] = "@(#)field.c   5.10 (Berkeley) %G%";
 p_login(p, pw, ep)
        char *p;
        struct passwd *pw;
 p_login(p, pw, ep)
        char *p;
        struct passwd *pw;
-       struct entry *ep;
+       ENTRY *ep;
 {
        if (!*p) {
                (void)fprintf(stderr, "chpass: empty login field.\n");
 {
        if (!*p) {
                (void)fprintf(stderr, "chpass: empty login field.\n");
@@ -63,7 +53,7 @@ p_login(p, pw, ep)
 p_passwd(p, pw, ep)
        char *p;
        struct passwd *pw;
 p_passwd(p, pw, ep)
        char *p;
        struct passwd *pw;
-       struct entry *ep;
+       ENTRY *ep;
 {
        if (!*p)
                pw->pw_passwd = "";     /* "NOLOGIN"; */
 {
        if (!*p)
                pw->pw_passwd = "";     /* "NOLOGIN"; */
@@ -79,7 +69,7 @@ p_passwd(p, pw, ep)
 p_uid(p, pw, ep)
        register char *p;
        struct passwd *pw;
 p_uid(p, pw, ep)
        register char *p;
        struct passwd *pw;
-       struct entry *ep;
+       ENTRY *ep;
 {
        int id;
 
 {
        int id;
 
@@ -105,7 +95,7 @@ p_uid(p, pw, ep)
 p_gid(p, pw, ep)
        register char *p;
        struct passwd *pw;
 p_gid(p, pw, ep)
        register char *p;
        struct passwd *pw;
-       struct entry *ep;
+       ENTRY *ep;
 {
        struct group *gr;
        int id;
 {
        struct group *gr;
        int id;
@@ -137,7 +127,7 @@ p_gid(p, pw, ep)
 p_class(p, pw, ep)
        char *p;
        struct passwd *pw;
 p_class(p, pw, ep)
        char *p;
        struct passwd *pw;
-       struct entry *ep;
+       ENTRY *ep;
 {
        if (!*p)
                pw->pw_class = "";
 {
        if (!*p)
                pw->pw_class = "";
@@ -153,7 +143,7 @@ p_class(p, pw, ep)
 p_change(p, pw, ep)
        char *p;
        struct passwd *pw;
 p_change(p, pw, ep)
        char *p;
        struct passwd *pw;
-       struct entry *ep;
+       ENTRY *ep;
 {
        if (!atot(p, &pw->pw_change))
                return(0);
 {
        if (!atot(p, &pw->pw_change))
                return(0);
@@ -165,7 +155,7 @@ p_change(p, pw, ep)
 p_expire(p, pw, ep)
        char *p;
        struct passwd *pw;
 p_expire(p, pw, ep)
        char *p;
        struct passwd *pw;
-       struct entry *ep;
+       ENTRY *ep;
 {
        if (!atot(p, &pw->pw_expire))
                return(0);
 {
        if (!atot(p, &pw->pw_expire))
                return(0);
@@ -177,7 +167,7 @@ p_expire(p, pw, ep)
 p_gecos(p, pw, ep)
        char *p;
        struct passwd *pw;
 p_gecos(p, pw, ep)
        char *p;
        struct passwd *pw;
-       struct entry *ep;
+       ENTRY *ep;
 {
        if (!*p)
                ep->save = "";
 {
        if (!*p)
                ep->save = "";
@@ -192,7 +182,7 @@ p_gecos(p, pw, ep)
 p_hdir(p, pw, ep)
        char *p;
        struct passwd *pw;
 p_hdir(p, pw, ep)
        char *p;
        struct passwd *pw;
-       struct entry *ep;
+       ENTRY *ep;
 {
        if (!*p) {
                (void)fprintf(stderr, "chpass: empty home directory field.\n");
 {
        if (!*p) {
                (void)fprintf(stderr, "chpass: empty home directory field.\n");
@@ -209,7 +199,7 @@ p_hdir(p, pw, ep)
 p_shell(p, pw, ep)
        register char *p;
        struct passwd *pw;
 p_shell(p, pw, ep)
        register char *p;
        struct passwd *pw;
-       struct entry *ep;
+       ENTRY *ep;
 {
        char *t, *ok_shell();
 
 {
        char *t, *ok_shell();