Browse Source

-Wall

OPENBSD_2_3
millert 27 years ago
parent
commit
8e693f1039
3 changed files with 16 additions and 9 deletions
  1. +2
    -1
      src/lib/libutil/login_fbtab.c
  2. +11
    -7
      src/lib/libutil/passwd.c
  3. +3
    -1
      src/lib/libutil/readlabel.c

+ 2
- 1
src/lib/libutil/login_fbtab.c View File

@ -65,6 +65,7 @@
#include <string.h>
#include <errno.h>
#include <dirent.h>
#include <unistd.h>
#include "util.h"
@ -91,7 +92,7 @@ login_fbtab(tty, uid, gid)
return;
while (fgets(buf, sizeof(buf), fp)) {
if (cp = strchr(buf, '#'))
if ((cp = strchr(buf, '#')))
*cp = 0; /* strip comment */
if ((cp = devname = strtok(buf, WSPACE)) == 0)
continue; /* empty or comment */


+ 11
- 7
src/lib/libutil/passwd.c View File

@ -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);
}


+ 3
- 1
src/lib/libutil/readlabel.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: readlabel.c,v 1.3 1996/12/23 07:43:42 downsj Exp $ */
/* $OpenBSD: readlabel.c,v 1.4 1997/11/18 19:57:29 millert Exp $ */
/*
* Copyright (c) 1996, Jason Downs. All rights reserved.
@ -32,10 +32,12 @@
#include <fcntl.h>
#include <paths.h>
#include <string.h>
#include <unistd.h>
#include <util.h>
#include <sys/dkio.h>
#define DKTYPENAMES
#include <sys/disklabel.h>
#include <sys/ioctl.h>
#include <sys/param.h>
#include <sys/stat.h>


Loading…
Cancel
Save