summaryrefslogtreecommitdiff
path: root/lib/libutil/passwd.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-11-18 19:57:30 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-11-18 19:57:30 +0000
commitdd0ec6448fecf01513af400efb8df4fe691d5b20 (patch)
tree088eca3ded1e5d658d3d1737542f50b2eb905a5f /lib/libutil/passwd.c
parentaf7c346d7069da79178d3d96806aaadfa5389ba4 (diff)
-Wall
Diffstat (limited to 'lib/libutil/passwd.c')
-rw-r--r--lib/libutil/passwd.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/libutil/passwd.c b/lib/libutil/passwd.c
index d01a6245a23..a411e70d16c 100644
--- a/lib/libutil/passwd.c
+++ b/lib/libutil/passwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: passwd.c,v 1.15 1997/11/17 22:46:03 millert Exp $ */
+/* $OpenBSD: passwd.c,v 1.16 1997/11/18 19:57:28 millert Exp $ */
/*
* Copyright (c) 1987, 1993, 1994, 1995
@@ -34,7 +34,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: passwd.c,v 1.15 1997/11/17 22:46:03 millert Exp $";
+static char rcsid[] = "$OpenBSD: passwd.c,v 1.16 1997/11/18 19:57:28 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -48,7 +48,9 @@ static char rcsid[] = "$OpenBSD: passwd.c,v 1.15 1997/11/17 22:46:03 millert Exp
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <ctype.h>
#include <pwd.h>
+#include <err.h>
#include <errno.h>
#include <paths.h>
#include <signal.h>
@@ -96,7 +98,7 @@ read_line(fp, line, max)
char *line;
int max;
{
- char *p, *c;
+ char *p;
/* Read one line of config */
if (fgets(line, max, fp) == 0)
return 0;
@@ -266,7 +268,6 @@ pw_mkdb()
{
int pstat;
pid_t pid;
- char *lock;
struct stat sb;
/* A zero length passwd file is never ok */
@@ -350,6 +351,9 @@ pw_edit(notsetuid, filename)
char *p, *editor;
char *argp[] = {"sh", "-c", NULL, NULL};
+#ifdef __GNUC__
+ (void)&editor;
+#endif
if (!filename) {
filename = pw_lck;
if (!filename)
@@ -447,7 +451,7 @@ pw_copy(ffd, tfd, pw)
goto err;
continue;
}
- (void)fprintf(to, "%s:%s:%d:%d:%s:%ld:%ld:%s:%s:%s\n",
+ (void)fprintf(to, "%s:%s:%d:%d:%s:%d:%d:%s:%s:%s\n",
pw->pw_name, pw->pw_passwd, pw->pw_uid, pw->pw_gid,
pw->pw_class, pw->pw_change, pw->pw_expire, pw->pw_gecos,
pw->pw_dir, pw->pw_shell);
@@ -456,7 +460,7 @@ pw_copy(ffd, tfd, pw)
goto err;
}
if (!done)
- (void)fprintf(to, "%s:%s:%d:%d:%s:%ld:%ld:%s:%s:%s\n",
+ (void)fprintf(to, "%s:%s:%d:%d:%s:%d:%d:%s:%s:%s\n",
pw->pw_name, pw->pw_passwd, pw->pw_uid, pw->pw_gid,
pw->pw_class, pw->pw_change, pw->pw_expire, pw->pw_gecos,
pw->pw_dir, pw->pw_shell);
@@ -550,7 +554,7 @@ pw_scan(bp, pw, flags)
break;
}
- if (p = strsep(&bp, ":")) { /* too many */
+ if ((p = strsep(&bp, ":"))) { /* too many */
fmt: warnx("corrupted entry");
return (0);
}