diff options
88 files changed, 525 insertions, 320 deletions
diff --git a/bin/mv/mv.c b/bin/mv/mv.c index e21b019fc0e..749c528e081 100644 --- a/bin/mv/mv.c +++ b/bin/mv/mv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mv.c,v 1.17 2001/01/08 16:12:57 millert Exp $ */ +/* $OpenBSD: mv.c,v 1.18 2001/07/09 07:04:26 deraadt Exp $ */ /* $NetBSD: mv.c,v 1.9 1995/03/21 09:06:52 cgd Exp $ */ /* @@ -47,7 +47,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: mv.c,v 1.17 2001/01/08 16:12:57 millert Exp $"; +static char rcsid[] = "$OpenBSD: mv.c,v 1.18 2001/07/09 07:04:26 deraadt Exp $"; #endif #endif /* not lint */ @@ -366,7 +366,7 @@ copy(from, to) pid_t pid; if ((pid = vfork()) == 0) { - execl(_PATH_CP, "mv", "-PRp", from, to, NULL); + execl(_PATH_CP, "mv", "-PRp", from, to, (char *)NULL); warn("%s", _PATH_CP); _exit(1); } @@ -384,7 +384,7 @@ copy(from, to) return (1); } if (!(pid = vfork())) { - execl(_PATH_RM, "mv", "-rf", from, NULL); + execl(_PATH_RM, "mv", "-rf", from, (char *)NULL); warn("%s", _PATH_RM); _exit(1); } diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c index f27243f7020..6a305f92ea6 100644 --- a/bin/pax/ar_io.c +++ b/bin/pax/ar_io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar_io.c,v 1.22 2001/05/26 00:32:20 millert Exp $ */ +/* $OpenBSD: ar_io.c,v 1.23 2001/07/09 07:04:26 deraadt Exp $ */ /* $NetBSD: ar_io.c,v 1.5 1996/03/26 23:54:13 mrg Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: ar_io.c,v 1.22 2001/05/26 00:32:20 millert Exp $"; +static char rcsid[] = "$OpenBSD: ar_io.c,v 1.23 2001/07/09 07:04:26 deraadt Exp $"; #endif #endif /* not lint */ @@ -1350,7 +1350,7 @@ ar_start_gzip(int fd, const char *gzip_program, int wr) } close(fds[0]); close(fds[1]); - if (execlp(gzip_program, gzip_program, gzip_flags, NULL) < 0) + if (execlp(gzip_program, gzip_program, gzip_flags, (char *)NULL) < 0) err(1, "could not exec"); /* NOTREACHED */ } diff --git a/bin/rcp/util.c b/bin/rcp/util.c index e57cc00e97c..17c8ca12742 100644 --- a/bin/rcp/util.c +++ b/bin/rcp/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.8 2001/01/15 19:54:56 deraadt Exp $ */ +/* $OpenBSD: util.c,v 1.9 2001/07/09 07:04:27 deraadt Exp $ */ /* $NetBSD: util.c,v 1.2 1995/03/21 08:19:08 cgd Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)util.c 8.2 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: util.c,v 1.8 2001/01/15 19:54:56 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: util.c,v 1.9 2001/07/09 07:04:27 deraadt Exp $"; #endif #endif /* not lint */ @@ -124,7 +124,7 @@ susystem(s, userid) case 0: (void)seteuid(userid); (void)setuid(userid); - execl(_PATH_BSHELL, "sh", "-c", s, NULL); + execl(_PATH_BSHELL, "sh", "-c", s, (char *)NULL); _exit(127); } istat = signal(SIGINT, SIG_IGN); diff --git a/games/backgammon/backgammon/main.c b/games/backgammon/backgammon/main.c index a0ecfd86e9c..d785da93da0 100644 --- a/games/backgammon/backgammon/main.c +++ b/games/backgammon/backgammon/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.9 2001/06/23 23:49:54 pjanzen Exp $ */ +/* $OpenBSD: main.c,v 1.10 2001/07/09 07:04:27 deraadt Exp $ */ /* * Copyright (c) 1980, 1993 @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: main.c,v 1.9 2001/06/23 23:49:54 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.10 2001/07/09 07:04:27 deraadt Exp $"; #endif #endif /* not lint */ @@ -143,7 +143,7 @@ main (argc,argv) addstr(rules); if (yorn(0)) { endwin(); - execl(TEACH, "teachgammon", args, 0); + execl(TEACH, "teachgammon", args, (char *)NULL); err(1, "%s", noteach); } else {/* if not rules, then instructions */ diff --git a/games/backgammon/teachgammon/teach.c b/games/backgammon/teachgammon/teach.c index c0158d4c3ed..758e3921a8b 100644 --- a/games/backgammon/teachgammon/teach.c +++ b/games/backgammon/teachgammon/teach.c @@ -1,4 +1,4 @@ -/* $OpenBSD: teach.c,v 1.9 2001/06/23 23:50:05 pjanzen Exp $ */ +/* $OpenBSD: teach.c,v 1.10 2001/07/09 07:04:28 deraadt Exp $ */ /* * Copyright (c) 1980, 1993 @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)teach.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: teach.c,v 1.9 2001/06/23 23:50:05 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: teach.c,v 1.10 2001/07/09 07:04:28 deraadt Exp $"; #endif #endif /* not lint */ @@ -139,6 +139,6 @@ leave() { clear(); endwin(); - execl(EXEC, "backgammon", "-n", args, 0); + execl(EXEC, "backgammon", "-n", args, (char *)NULL); errx(1, "help! Backgammon program is missing!!"); } diff --git a/games/cribbage/instr.c b/games/cribbage/instr.c index 6fbbf640233..391f36ba716 100644 --- a/games/cribbage/instr.c +++ b/games/cribbage/instr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: instr.c,v 1.7 1999/06/10 22:58:19 pjanzen Exp $ */ +/* $OpenBSD: instr.c,v 1.8 2001/07/09 07:04:28 deraadt Exp $ */ /* $NetBSD: instr.c,v 1.5 1997/07/10 06:47:30 mikel Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)instr.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: instr.c,v 1.7 1999/06/10 22:58:19 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: instr.c,v 1.8 2001/07/09 07:04:28 deraadt Exp $"; #endif #endif /* not lint */ @@ -85,7 +85,7 @@ instructions() } if (dup2(fd, 0) == -1) err(1, "dup2"); - execl(_PATH_BSHELL, "sh", "-c", pager, NULL); + execl(_PATH_BSHELL, "sh", "-c", pager, (char *)NULL); err(1, "exec sh -c %s", pager); /* NOTREACHED */ default: diff --git a/games/fish/fish.c b/games/fish/fish.c index 4408530dc0c..408b9fc4dbc 100644 --- a/games/fish/fish.c +++ b/games/fish/fish.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fish.c,v 1.8 2000/04/08 12:22:39 pjanzen Exp $ */ +/* $OpenBSD: fish.c,v 1.9 2001/07/09 07:04:29 deraadt Exp $ */ /* $NetBSD: fish.c,v 1.3 1995/03/23 08:28:18 cgd Exp $ */ /*- @@ -47,7 +47,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)fish.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: fish.c,v 1.8 2000/04/08 12:22:39 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: fish.c,v 1.9 2001/07/09 07:04:29 deraadt Exp $"; #endif #endif /* not lint */ @@ -505,7 +505,7 @@ instructions() } if (dup2(fd, 0) == -1) err(1, "dup2"); - (void)execl(_PATH_BSHELL, "sh", "-c", pager, NULL); + (void)execl(_PATH_BSHELL, "sh", "-c", pager, (char *)NULL); err(1, "exec sh -c %s", pager); /* NOT REACHED */ case -1: diff --git a/games/larn/tok.c b/games/larn/tok.c index 1e1c1cfcc9e..75e61f95659 100644 --- a/games/larn/tok.c +++ b/games/larn/tok.c @@ -1,9 +1,9 @@ -/* $OpenBSD: tok.c,v 1.5 2000/06/29 07:55:42 pjanzen Exp $ */ +/* $OpenBSD: tok.c,v 1.6 2001/07/09 07:04:29 deraadt Exp $ */ /* $NetBSD: tok.c,v 1.5 1997/10/18 20:03:54 christos Exp $ */ /* tok.c Larn is copyrighted 1986 by Noah Morgan. */ #ifndef lint -static char rcsid[] = "$OpenBSD: tok.c,v 1.5 2000/06/29 07:55:42 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: tok.c,v 1.6 2001/07/09 07:04:29 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -102,7 +102,7 @@ yylex() if ((ic = fork()) == 0) { /* child */ /* revoke */ setgid(getgid()); - execl("/bin/csh", 0); + execl("/bin/csh", (char *)NULL); exit(1); } wait(0); diff --git a/games/phantasia/misc.c b/games/phantasia/misc.c index b943effdfb9..d293cd0b14c 100644 --- a/games/phantasia/misc.c +++ b/games/phantasia/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.7 2001/02/04 02:51:25 pjanzen Exp $ */ +/* $OpenBSD: misc.c,v 1.8 2001/07/09 07:04:29 deraadt Exp $ */ /* $NetBSD: misc.c,v 1.2 1995/03/24 03:59:03 cgd Exp $ */ /* @@ -932,7 +932,7 @@ death(how) if (ch == 'Y') { cleanup(FALSE); execl(_PATH_GAMEPROG, "phantasia", "-s", - (Wizard ? "-S" : (char *) NULL), 0); + (Wizard ? "-S" : (char *)NULL), (char *)NULL); exit(0); /* NOTREACHED */ } diff --git a/games/rogue/machdep.c b/games/rogue/machdep.c index 0923f7b8516..6d7a0939665 100644 --- a/games/rogue/machdep.c +++ b/games/rogue/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.5 1999/08/17 09:13:12 millert Exp $ */ +/* $OpenBSD: machdep.c,v 1.6 2001/07/09 07:04:30 deraadt Exp $ */ /* $NetBSD: machdep.c,v 1.5 1995/04/28 23:49:22 mycroft Exp $ */ /* @@ -506,7 +506,7 @@ md_shell(shell) * uid = getuid(); * setuid(uid); */ - execl(shell, shell, 0); + execl(shell, shell, (char *)NULL); } wait(&w); } diff --git a/games/wump/wump.c b/games/wump/wump.c index c9311907bb0..b9274f6e690 100644 --- a/games/wump/wump.c +++ b/games/wump/wump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wump.c,v 1.15 2001/05/02 23:28:31 pjanzen Exp $ */ +/* $OpenBSD: wump.c,v 1.16 2001/07/09 07:04:30 deraadt Exp $ */ /* * Copyright (c) 1989, 1993 @@ -47,7 +47,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)wump.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: wump.c,v 1.15 2001/05/02 23:28:31 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: wump.c,v 1.16 2001/07/09 07:04:30 deraadt Exp $"; #endif #endif /* not lint */ @@ -915,7 +915,7 @@ puff of greasy black smoke! (poof)\n"); case 0: /* child */ if (dup2(fd, 0) == -1) err(1, "dup2"); - (void)execl(_PATH_BSHELL, "sh", "-c", pager, NULL); + (void)execl(_PATH_BSHELL, "sh", "-c", pager, (char *)NULL); err(1, "exec sh -c %s", pager); /* NOT REACHED */ case -1: diff --git a/gnu/egcs/gcc/cccp.c b/gnu/egcs/gcc/cccp.c index e89d00c574b..65070224f45 100644 --- a/gnu/egcs/gcc/cccp.c +++ b/gnu/egcs/gcc/cccp.c @@ -1,5 +1,6 @@ /* C Compatible Compiler Preprocessor (CCCP) - Copyright (C) 1986, 87, 89, 92-98, 1999 Free Software Foundation, Inc. + Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000 Free Software Foundation, Inc. Written by Paul Rubin, June 1986 Adapted to ANSI C, Richard Stallman, Jan 1987 @@ -3299,7 +3300,9 @@ randomchar: #endif if (output_marks) { + op->bufp = obp; check_expand (op, limit - ibp + 2); + obp = op->bufp; *obp++ = '\n'; *obp++ = '-'; } @@ -3981,11 +3984,33 @@ handle_directive (ip, op) case '\'': case '\"': { + int backslash_newlines_p = 0; + register U_CHAR *bp1 = skip_quoted_string (xp - 1, bp, ip->lineno, - NULL_PTR, NULL_PTR, NULL_PTR); - while (xp != bp1) - *cp++ = *xp++; + NULL_PTR, &backslash_newlines_p, + NULL_PTR); + if (backslash_newlines_p) + while (xp != bp1) + { + /* With something like: + + #define X "a\ + b" + + we should still remove the backslash-newline + pair as part of phase two. */ + if (xp[0] == '\\' && xp[1] == '\n') + xp += 2; + else + *cp++ = *xp++; + } + else + /* This is the same as the loop above, but taking + advantage of the fact that we know there are no + backslash-newline pairs. */ + while (xp != bp1) + *cp++ = *xp++; } break; @@ -7104,10 +7129,10 @@ do_pragma () close (1); if (open ("/dev/tty", O_WRONLY, 0666) != 1) goto nope; - execl ("/usr/games/hack", "#pragma", 0); - execl ("/usr/games/rogue", "#pragma", 0); - execl ("/usr/new/emacs", "-f", "hanoi", "9", "-kill", 0); - execl ("/usr/local/emacs", "-f", "hanoi", "9", "-kill", 0); + execl ("/usr/games/hack", "#pragma", (char *)NULL); + execl ("/usr/games/rogue", "#pragma", (char *)NULL); + execl ("/usr/new/emacs", "-f", "hanoi", "9", "-kill", (char *)NULL); + execl ("/usr/local/emacs", "-f", "hanoi", "9", "-kill", (char *)NULL); nope: fatal ("You are in a maze of twisty compiler features, all different"); } diff --git a/gnu/usr.bin/binutils/gdb/29k-share/udi/udip2soc.c b/gnu/usr.bin/binutils/gdb/29k-share/udi/udip2soc.c index aa25e00731d..e92dead8e3b 100644 --- a/gnu/usr.bin/binutils/gdb/29k-share/udi/udip2soc.c +++ b/gnu/usr.bin/binutils/gdb/29k-share/udi/udip2soc.c @@ -326,7 +326,7 @@ UDIConnect(Config, Session) arg0, soc_con[cnt].domain_string, soc_con[cnt].tip_string, - NULL); + (char *)NULL); _exit(1); } diff --git a/gnu/usr.bin/binutils/gdb/command.c b/gnu/usr.bin/binutils/gdb/command.c index 9afbf82e59a..c3c2b98a974 100644 --- a/gnu/usr.bin/binutils/gdb/command.c +++ b/gnu/usr.bin/binutils/gdb/command.c @@ -1369,9 +1369,9 @@ shell_escape (arg, from_tty) if ((pid = fork()) == 0) { if (!arg) - execl (user_shell, p, 0); + execl (user_shell, p, (char *)NULL); else - execl (user_shell, p, "-c", arg, 0); + execl (user_shell, p, "-c", arg, (char *)NULL); fprintf_unfiltered (gdb_stderr, "Cannot execute %s: %s\n", user_shell, safe_strerror (errno)); diff --git a/gnu/usr.bin/cvs/diff/util.c b/gnu/usr.bin/cvs/diff/util.c index 89cc2741786..28f163c9c4c 100644 --- a/gnu/usr.bin/cvs/diff/util.c +++ b/gnu/usr.bin/cvs/diff/util.c @@ -1,5 +1,5 @@ /* Support routines for GNU DIFF. - Copyright (C) 1988, 1989, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. + Copyright (C) 1988, 1989, 1992, 1993, 1994, 1997, 1998 Free Software Foundation, Inc. This file is part of GNU DIFF. @@ -13,12 +13,20 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with GNU DIFF; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +*/ #include "diff.h" +#if __STDC__ +#include <stdarg.h> +#else +#include <varargs.h> +#endif + +#ifndef strerror +extern char *strerror (); +#endif + /* Queue up one-line messages to be printed at the end, when -l is specified. Each message is recorded with a `struct msg'. */ @@ -48,9 +56,15 @@ perror_with_name (text) char const *text; { int e = errno; - fprintf (stderr, "%s: ", diff_program_name); - errno = e; - perror (text); + + if (callbacks && callbacks->error) + (*callbacks->error) ("%s: %s", text, strerror (e)); + else + { + fprintf (stderr, "%s: ", diff_program_name); + errno = e; + perror (text); + } } /* Use when a system call returns non-zero status and that is fatal. */ @@ -61,9 +75,14 @@ pfatal_with_name (text) { int e = errno; print_message_queue (); - fprintf (stderr, "%s: ", diff_program_name); - errno = e; - perror (text); + if (callbacks && callbacks->error) + (*callbacks->error) ("%s: %s", text, strerror (e)); + else + { + fprintf (stderr, "%s: ", diff_program_name); + errno = e; + perror (text); + } DIFF_ABORT (2); } @@ -74,9 +93,14 @@ void diff_error (format, arg, arg1) char const *format, *arg, *arg1; { - fprintf (stderr, "%s: ", diff_program_name); - fprintf (stderr, format, arg, arg1); - fprintf (stderr, "\n"); + if (callbacks && callbacks->error) + (*callbacks->error) (format, arg, arg1); + else + { + fprintf (stderr, "%s: ", diff_program_name); + fprintf (stderr, format, arg, arg1); + fprintf (stderr, "\n"); + } } /* Print an error message containing the string TEXT, then exit. */ @@ -119,8 +143,8 @@ message5 (format, arg1, arg2, arg3, arg4) else { if (sdiff_help_sdiff) - putc (' ', outfile); - fprintf (outfile, format, arg1, arg2, arg3, arg4); + write_output (" ", 1); + printf_output (format, arg1, arg2, arg3, arg4); } } @@ -132,7 +156,7 @@ print_message_queue () struct msg *m; for (m = msg_chain; m; m = m->next) - fprintf (outfile, m->format, m->arg1, m->arg2, m->arg3, m->arg4); + printf_output (m->format, m->arg1, m->arg2, m->arg3, m->arg4); } /* Call before outputting the results of comparing files NAME0 and NAME1 @@ -180,6 +204,9 @@ begin_output () This requirement is silly and does not match historical practice. */ sprintf (name, "diff%s %s %s", switch_string, current_name0, current_name1); + if (paginate_flag && callbacks && callbacks->write_output) + fatal ("can't paginate when using library callbacks"); + if (paginate_flag) { /* Make OUTFILE a pipe to a subsidiary `pr'. */ @@ -208,7 +235,7 @@ begin_output () close (pipes[0]); } - execl (PR_PROGRAM, PR_PROGRAM, "-f", "-h", name, 0); + execl (PR_PROGRAM, PR_PROGRAM, "-f", "-h", name, (char *)NULL); pfatal_with_name (PR_PROGRAM); } else @@ -243,7 +270,7 @@ begin_output () /* If handling multiple files (because scanning a directory), print which files the following output is about. */ if (current_depth > 0) - fprintf (outfile, "%s\n", name); + printf_output ("%s\n", name); } free (name); @@ -293,6 +320,102 @@ finish_output () output_in_progress = 0; } + +/* Write something to the output file. */ + +void +write_output (text, len) + char const *text; + size_t len; +{ + if (callbacks && callbacks->write_output) + (*callbacks->write_output) (text, len); + else if (len == 1) + putc (*text, outfile); + else + fwrite (text, sizeof (char), len, outfile); +} + +/* Printf something to the output file. */ + +#if __STDC__ +#define VA_START(args, lastarg) va_start(args, lastarg) +#else /* ! __STDC__ */ +#define VA_START(args, lastarg) va_start(args) +#endif /* __STDC__ */ + +void +#if __STDC__ +printf_output (const char *format, ...) +#else +printf_output (format, va_alist) + char const *format; + va_dcl +#endif +{ + va_list args; + + VA_START (args, format); + if (callbacks && callbacks->write_output) + { + /* We implement our own limited printf-like functionality (%s, %d, + and %c only). Callers who want something fancier can use + sprintf. */ + const char *p = format; + char *q; + char *str; + int num; + int ch; + char buf[100]; + + while ((q = strchr (p, '%')) != NULL) + { + static const char msg[] = + "\ninternal error: bad % in printf_output\n"; + (*callbacks->write_output) (p, q - p); + + switch (q[1]) + { + case 's': + str = va_arg (args, char *); + (*callbacks->write_output) (str, strlen (str)); + break; + case 'd': + num = va_arg (args, int); + sprintf (buf, "%d", num); + (*callbacks->write_output) (buf, strlen (buf)); + break; + case 'c': + ch = va_arg (args, int); + buf[0] = ch; + (*callbacks->write_output) (buf, 1); + break; + default: + (*callbacks->write_output) (msg, sizeof (msg) - 1); + /* Don't just keep going, because q + 1 might point to the + terminating '\0'. */ + goto out; + } + p = q + 2; + } + (*callbacks->write_output) (p, strlen (p)); + } + else + vfprintf (outfile, format, args); + out: + va_end (args); +} + +/* Flush the output file. */ + +void +flush_output () +{ + if (callbacks && callbacks->flush_output) + (*callbacks->flush_output) (); + else + fflush (outfile); +} /* Compare two lines (typically one from each input file) according to the command line options. @@ -469,7 +592,6 @@ print_1_line (line_flag, line) char const * const *line; { char const *text = line[0], *limit = line[1]; /* Help the compiler. */ - FILE *out = outfile; /* Help the compiler some more. */ char const *flag_format = 0; /* If -T was specified, use a Tab between the line-flag and the text. @@ -479,13 +601,13 @@ print_1_line (line_flag, line) if (line_flag && *line_flag) { flag_format = tab_align_flag ? "%s\t" : "%s "; - fprintf (out, flag_format, line_flag); + printf_output (flag_format, line_flag); } output_1_line (text, limit, flag_format, line_flag); if ((!line_flag || line_flag[0]) && limit[-1] != '\n') - fprintf (out, "\n\\ No newline at end of file\n"); + printf_output ("\n\\ No newline at end of file\n"); } /* Output a line from TEXT up to LIMIT. Without -t, output verbatim. @@ -498,13 +620,15 @@ output_1_line (text, limit, flag_format, line_flag) char const *text, *limit, *flag_format, *line_flag; { if (!tab_expand_flag) - fwrite (text, sizeof (char), limit - text, outfile); + write_output (text, limit - text); else { - register FILE *out = outfile; register unsigned char c; register char const *t = text; register unsigned column = 0; + /* CC is used to avoid taking the address of the register + variable C. */ + char cc; while (t < limit) switch ((c = *t++)) @@ -514,15 +638,15 @@ output_1_line (text, limit, flag_format, line_flag) unsigned spaces = TAB_WIDTH - column % TAB_WIDTH; column += spaces; do - putc (' ', out); + write_output (" ", 1); while (--spaces); } break; case '\r': - putc (c, out); + write_output ("\r", 1); if (flag_format && t < limit && *t != '\n') - fprintf (out, flag_format, line_flag); + printf_output (flag_format, line_flag); column = 0; break; @@ -530,13 +654,14 @@ output_1_line (text, limit, flag_format, line_flag) if (column == 0) continue; column--; - putc (c, out); + write_output ("\b", 1); break; default: if (ISPRINT (c)) column++; - putc (c, out); + cc = c; + write_output (&cc, 1); break; } } @@ -598,9 +723,9 @@ print_number_range (sepchar, file, a, b) In this case, we should print the line number before the range, which is B. */ if (trans_b > trans_a) - fprintf (outfile, "%d%c%d", trans_a, sepchar, trans_b); + printf_output ("%d%c%d", trans_a, sepchar, trans_b); else - fprintf (outfile, "%d", trans_b); + printf_output ("%d", trans_b); } /* Look at a hunk of edit script and report the range of lines in each file diff --git a/gnu/usr.bin/diff/util.c b/gnu/usr.bin/diff/util.c index fd6cb1b5842..98de0d7d6b6 100644 --- a/gnu/usr.bin/diff/util.c +++ b/gnu/usr.bin/diff/util.c @@ -208,7 +208,7 @@ begin_output () close (pipes[0]); } - execl (PR_PROGRAM, PR_PROGRAM, "-F", "-h", name, 0); + execl (PR_PROGRAM, PR_PROGRAM, "-F", "-h", name, (char *)NULL); pfatal_with_name (PR_PROGRAM); } else diff --git a/gnu/usr.bin/gas/input-file.c b/gnu/usr.bin/gas/input-file.c index ab5302d6ba8..f5401180e92 100644 --- a/gnu/usr.bin/gas/input-file.c +++ b/gnu/usr.bin/gas/input-file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input-file.c,v 1.2 1998/02/15 18:48:51 niklas Exp $ */ +/* $OpenBSD: input-file.c,v 1.3 2001/07/09 07:04:35 deraadt Exp $ */ /* input_file.c - Deal with Input Files - Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc. @@ -27,7 +27,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: input-file.c,v 1.2 1998/02/15 18:48:51 niklas Exp $"; +static char rcsid[] = "$OpenBSD: input-file.c,v 1.3 2001/07/09 07:04:35 deraadt Exp $"; #endif #ifdef USG @@ -175,8 +175,8 @@ int debugging; /* TRUE if we are debugging assembler. */ (void)dup2 (fd, fileno(stdout)); /* JF for testing #define PREPROCESSOR "/lib/app" */ #define PREPROCESSOR "./app" - execl (PREPROCESSOR, PREPROCESSOR, 0); - execl ("app","app",0); + execl (PREPROCESSOR, PREPROCESSOR, (char *)NULL); + execl ("app","app",(char *)NULL); (void)write(2,"Exec of app failed. Get help.\n",31); (void)unlink(temporary_file_name); _exit (11); diff --git a/gnu/usr.bin/ld/ldd/ldd.c b/gnu/usr.bin/ld/ldd/ldd.c index cc03b36cefa..f578bc11a90 100644 --- a/gnu/usr.bin/ld/ldd/ldd.c +++ b/gnu/usr.bin/ld/ldd/ldd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldd.c,v 1.7 2001/04/17 21:44:38 espie Exp $ */ +/* $OpenBSD: ldd.c,v 1.8 2001/07/09 07:04:36 deraadt Exp $ */ /* $NetBSD: ldd.c,v 1.12 1995/10/09 00:14:41 pk Exp $ */ /* * Copyright (c) 1993 Paul Kranenburg @@ -163,7 +163,7 @@ char *argv[]; } break; case 0: - rval |= execl(*argv, *argv, NULL) != 0; + rval |= execl(*argv, *argv, (char *)NULL) != 0; perror(*argv); _exit(1); } diff --git a/gnu/usr.sbin/sendmail/smrsh/smrsh.c b/gnu/usr.sbin/sendmail/smrsh/smrsh.c index 35fa47cb223..fac4dfc7361 100644 --- a/gnu/usr.sbin/sendmail/smrsh/smrsh.c +++ b/gnu/usr.sbin/sendmail/smrsh/smrsh.c @@ -371,7 +371,7 @@ main(argc, argv) #ifdef DEBUG printf("%s\n", newcmdbuf); #endif /* DEBUG */ - (void) execle("/bin/sh", "/bin/sh", "-c", newcmdbuf, NULL, newenv); + (void) execle("/bin/sh", "/bin/sh", "-c", newcmdbuf, (char *)NULL, newenv); save_errno = errno; #ifndef DEBUG syslog(LOG_CRIT, "Cannot exec /bin/sh: %m"); diff --git a/kerberosIV/src/appl/bsd/login.c b/kerberosIV/src/appl/bsd/login.c index 769bfb46e06..1c3e801f6d5 100644 --- a/kerberosIV/src/appl/bsd/login.c +++ b/kerberosIV/src/appl/bsd/login.c @@ -109,7 +109,7 @@ change_passwd(struct passwd *who) warn("fork /bin/passwd"); sleepexit(1); case 0: - execlp("/bin/passwd", "passwd", who->pw_name, (char *) 0); + execlp("/bin/passwd", "passwd", who->pw_name, (char *)NULL); _exit(1); default: waitpid(pid, &status, 0); @@ -845,11 +845,11 @@ main(int argc, char **argv) krb_afslog(0, 0); } - execlp(pwd->pw_shell, tbuf, 0); + execlp(pwd->pw_shell, tbuf, (char *)NULL); if (getuid() == 0) { warnx("Can't exec %s, trying %s\n", pwd->pw_shell, _PATH_BSHELL); - execlp(_PATH_BSHELL, tbuf, 0); + execlp(_PATH_BSHELL, tbuf, (char *)NULL); err(1, "%s", _PATH_BSHELL); } err(1, "%s", pwd->pw_shell); diff --git a/kerberosIV/src/appl/bsd/rcp_util.c b/kerberosIV/src/appl/bsd/rcp_util.c index 44bed5dc9a8..7b219c14376 100644 --- a/kerberosIV/src/appl/bsd/rcp_util.c +++ b/kerberosIV/src/appl/bsd/rcp_util.c @@ -86,7 +86,7 @@ susystem(char *s, int userid) if(do_osfc2_magic(userid)) exit(1); setuid(userid); - execl(_PATH_BSHELL, "sh", "-c", s, NULL); + execl(_PATH_BSHELL, "sh", "-c", s, (char *)NULL); _exit(127); } istat = signal(SIGINT, SIG_IGN); diff --git a/kerberosIV/src/appl/bsd/rlogind.c b/kerberosIV/src/appl/bsd/rlogind.c index 11cad274048..31a32e268d5 100644 --- a/kerberosIV/src/appl/bsd/rlogind.c +++ b/kerberosIV/src/appl/bsd/rlogind.c @@ -42,7 +42,7 @@ #include "bsd_locl.h" -RCSID("$KTH: rlogind.c,v 1.109 1999/11/25 05:27:38 assar Exp $"); +RCSID("$KTH: rlogind.c,v 1.109.2.2 2000/06/23 02:37:06 assar Exp $"); extern int __check_rhosts_file; @@ -257,7 +257,7 @@ rlogind_logout(const char *line) ut.ut_exit.e_exit = 0; #endif #endif - time(&ut.ut_time); + ut.ut_time = time(NULL); fseek(fp, (long)-sizeof(struct utmp), SEEK_CUR); fwrite(&ut, sizeof(struct utmp), 1, fp); fseek(fp, (long)0, SEEK_CUR); @@ -297,7 +297,7 @@ logwtmp(const char *line, const char *name, const char *host) else ut.ut_type = DEAD_PROCESS; #endif - time(&ut.ut_time); + ut.ut_time = time(NULL); if (write(fd, &ut, sizeof(struct utmp)) != sizeof(struct utmp)) ftruncate(fd, buf.st_size); @@ -490,10 +490,17 @@ doit(int f, struct sockaddr_in *fromp) hostname); execl(new_login, "login", "-p", - "-h", hostname, "-f", "--", lusername, 0); + "-h", hostname, "-f", "--", lusername, (char *)NULL); + } else if (use_kerberos) { + fprintf(stderr, "User `%s' is not authorized to login as `%s'!\n", + krb_unparse_name_long(kdata->pname, + kdata->pinst, + kdata->prealm), + lusername); + exit(1); } else execl(new_login, "login", "-p", - "-h", hostname, "--", lusername, 0); + "-h", hostname, "--", lusername, (char *)NULL); fatal(STDERR_FILENO, new_login, 1); /*NOTREACHED*/ } diff --git a/kerberosIV/src/appl/bsd/rshd.c b/kerberosIV/src/appl/bsd/rshd.c index 7493a6de665..955a71c2832 100644 --- a/kerberosIV/src/appl/bsd/rshd.c +++ b/kerberosIV/src/appl/bsd/rshd.c @@ -613,7 +613,7 @@ doit(struct sockaddr_in *fromp) krb_afslog_uid_home (cell, NULL, uid, homedir); krb_afslog_uid_home(NULL, NULL, uid, homedir); } - execle(shell_path, cp, "-c", cmdbuf, 0, envinit); + execle(shell_path, cp, "-c", cmdbuf, (char *)NULL, envinit); err(1, "%s", shell_path); } diff --git a/kerberosIV/src/appl/kauth/kauth.c b/kerberosIV/src/appl/kauth/kauth.c index b0d64dd0d55..883ae4f0009 100644 --- a/kerberosIV/src/appl/kauth/kauth.c +++ b/kerberosIV/src/appl/kauth/kauth.c @@ -118,8 +118,8 @@ zrefresh(void) return -1; case 0: /* Child */ - execlp("zrefresh", "zrefresh", 0); - execl(BINDIR "/zrefresh", "zrefresh", 0); + execlp("zrefresh", "zrefresh", (char *)NULL); + execl(BINDIR "/zrefresh", "zrefresh", (char *)NULL); exit(1); default: /* Parent */ diff --git a/kerberosIV/src/appl/telnet/telnet/commands.c b/kerberosIV/src/appl/telnet/telnet/commands.c index d0e26444f8b..848f06b31e7 100644 --- a/kerberosIV/src/appl/telnet/telnet/commands.c +++ b/kerberosIV/src/appl/telnet/telnet/commands.c @@ -1307,9 +1307,9 @@ shell(int argc, char **argv) else shellname++; if (argc > 1) - execl(shellp, shellname, "-c", &saveline[1], 0); + execl(shellp, shellname, "-c", &saveline[1], (char *)NULL); else - execl(shellp, shellname, 0); + execl(shellp, shellname, (char *)NULL); perror("Execl"); _exit(1); } diff --git a/kerberosIV/src/appl/telnet/telnetd/sys_term.c b/kerberosIV/src/appl/telnet/telnetd/sys_term.c index b08e8528f59..ca3a298179b 100644 --- a/kerberosIV/src/appl/telnet/telnetd/sys_term.c +++ b/kerberosIV/src/appl/telnet/telnetd/sys_term.c @@ -33,7 +33,7 @@ #include "telnetd.h" -RCSID("$KTH: sys_term.c,v 1.89 1999/09/16 20:41:36 assar Exp $"); +RCSID("$KTH: sys_term.c,v 1.89.2.6 2000/12/08 23:34:05 assar Exp $"); #if defined(_CRAY) || (defined(__hpux) && !defined(HAVE_UTMPX_H)) # define PARENT_DOES_UTMP @@ -1154,7 +1154,7 @@ startslave(char *host, int autologin, char *autoname) /* * Create utmp entry for child */ - time(&wtmp.ut_time); + wtmp.ut_time = time(NULL); wtmp.ut_type = LOGIN_PROCESS; wtmp.ut_pid = pid; strncpy(wtmp.ut_user, "LOGIN", sizeof(wtmp.ut_user)); @@ -1205,26 +1205,50 @@ init_env(void) /* * scrub_env() * - * Remove variables from the environment that might cause login to - * behave in a bad manner. To avoid this, login should be staticly - * linked. + * We only accept the environment variables listed below. */ -static void scrub_env(void) +static void +scrub_env(void) { - static char *remove[] = { "LD_", "_RLD_", "LIBPATH=", "IFS=", NULL }; + static const char *reject[] = { + "TERMCAP=/", + NULL + }; + + static const char *accept[] = { + "XAUTH=", "XAUTHORITY=", "DISPLAY=", + "TERM=", + "EDITOR=", + "PAGER=", + "PRINTER=", + "LOGNAME=", + "POSIXLY_CORRECT=", + "TERMCAP=", + NULL + }; char **cpp, **cpp2; - char **p; + const char **p; for (cpp2 = cpp = environ; *cpp; cpp++) { - for(p = remove; *p; p++) + int reject_it = 0; + + for(p = reject; *p; p++) + if(strncmp(*cpp, *p, strlen(*p)) == 0) { + reject_it = 1; + break; + } + if (reject_it) + continue; + + for(p = accept; *p; p++) if(strncmp(*cpp, *p, strlen(*p)) == 0) break; - if(*p == NULL) + if(*p != NULL) *cpp2++ = *cpp; } - *cpp2 = 0; + *cpp2 = NULL; } @@ -1425,7 +1449,7 @@ rmut(void) #ifdef HAVE_STRUCT_UTMP_UT_HOST strncpy(wtmp.ut_host, "", sizeof(wtmp.ut_host)); #endif - time(&wtmp.ut_time); + wtmp.ut_time = time(NULL); write(f, &wtmp, sizeof(wtmp)); close(f); } @@ -1469,7 +1493,7 @@ rmut(void) #ifdef HAVE_STRUCT_UTMP_UT_HOST strncpy(u->ut_host, "", sizeof(u->ut_host)); #endif - time(&u->ut_time); + u->ut_time = time(NULL); write(f, u, sizeof(wtmp)); found++; } @@ -1484,7 +1508,7 @@ rmut(void) #ifdef HAVE_STRUCT_UTMP_UT_HOST strncpy(wtmp.ut_host, "", sizeof(wtmp.ut_host)); #endif - time(&wtmp.ut_time); + wtmp.ut_time = time(NULL); write(f, &wtmp, sizeof(wtmp)); close(f); } @@ -1853,7 +1877,7 @@ cleantmpdir(jid, tpath, user) tpath); break; case 0: - execl(CLEANTMPCMD, CLEANTMPCMD, user, tpath, 0); + execl(CLEANTMPCMD, CLEANTMPCMD, user, tpath, (char *)NULL); syslog(LOG_ERR, "TMPDIR cleanup(%s): execl(%s) failed: %m\n", tpath, CLEANTMPCMD); exit(1); diff --git a/kerberosIV/src/appl/xnlock/xnlock.c b/kerberosIV/src/appl/xnlock/xnlock.c index 3b900574179..31843f4ee75 100644 --- a/kerberosIV/src/appl/xnlock/xnlock.c +++ b/kerberosIV/src/appl/xnlock/xnlock.c @@ -8,7 +8,7 @@ */ #ifdef HAVE_CONFIG_H #include <config.h> -RCSID("$KTH: xnlock.c,v 1.78 1999/09/16 20:41:38 assar Exp $"); +RCSID("$KTH: xnlock.c,v 1.78.2.1 2000/06/23 03:09:47 assar Exp $"); #endif #include <stdio.h> @@ -286,8 +286,8 @@ zrefresh(void) return -1; case 0: /* Child */ - execlp("zrefresh", "zrefresh", 0); - execl(BINDIR "/zrefresh", "zrefresh", 0); + execlp("zrefresh", "zrefresh", (char *)NULL); + execl(BINDIR "/zrefresh", "zrefresh", (char *)NULL); return -1; default: /* Parent */ @@ -927,14 +927,19 @@ main (int argc, char **argv) */ { struct passwd *pw; + uid_t uid = getuid(); if (!(pw = k_getpwuid(0))) errx (1, "can't get root's passwd!"); strlcpy(root_cpass, pw->pw_passwd, sizeof(root_cpass)); - if (!(pw = k_getpwuid(getuid()))) + if (!(pw = k_getpwuid(uid))) errx (1, "Can't get your password entry!"); strlcpy(user_cpass, pw->pw_passwd, sizeof(user_cpass)); - setuid(getuid()); + setuid(uid); + if (uid != 0 && setuid(0) != -1) { + fprintf(stderr, "Failed to drop privileges!\n"); + exit(1); + } /* Now we're no longer running setuid root. */ strlcpy(login, pw->pw_name, sizeof(login)); } diff --git a/kerberosV/src/appl/dceutils/testpag.c b/kerberosV/src/appl/dceutils/testpag.c index 4613fba5e94..b8ab439ceb1 100644 --- a/kerberosV/src/appl/dceutils/testpag.c +++ b/kerberosV/src/appl/dceutils/testpag.c @@ -141,7 +141,7 @@ main(argc, argv) "FILE:/opt/dcelocal/var/security/creds/dcecred_%8.8x", pag); esetenv("KRB5CCNAME",ccname,1); - execl("/bin/csh","csh",0); + execl("/bin/csh","csh",(char *)NULL); } else { fprintf(stderr," Not a good pag value\n"); diff --git a/kerberosV/src/appl/kf/kfd.c b/kerberosV/src/appl/kf/kfd.c index adf166136e7..d173b3dd58f 100644 --- a/kerberosV/src/appl/kf/kfd.c +++ b/kerberosV/src/appl/kf/kfd.c @@ -32,7 +32,7 @@ */ #include "kf_locl.h" -RCSID("$KTH: kfd.c,v 1.8 2001/01/09 18:43:10 assar Exp $"); +RCSID("$KTH: kfd.c,v 1.9 2001/02/20 01:44:44 assar Exp $"); krb5_context context; char krb5_tkfile[MAXPATHLEN]; @@ -315,12 +315,12 @@ main(int argc, char **argv) int port; int ret; - set_progname (argv[0]); + setprogname (argv[0]); roken_openlog (argv[0], LOG_ODELAY | LOG_PID,LOG_AUTH); port = server_setup(&context, argc, argv); ret = doit (port, service); closelog(); if (ret == 0 && regpag_str != NULL) - ret = execl(regpag_str, "regpag", "-t", krb5_tkfile, "-r", NULL); + ret = execl(regpag_str, "regpag", "-t", krb5_tkfile, "-r", (char *)NULL); return ret; } diff --git a/kerberosV/src/appl/login/login.c b/kerberosV/src/appl/login/login.c index ab5041fbd39..81dc1d82f3e 100644 --- a/kerberosV/src/appl/login/login.c +++ b/kerberosV/src/appl/login/login.c @@ -39,7 +39,7 @@ #include <sys/capability.h> #endif -RCSID("$KTH: login.c,v 1.46 2001/01/29 02:18:03 assar Exp $"); +RCSID("$KTH: login.c,v 1.47 2001/02/20 01:44:45 assar Exp $"); static int login_timeout = 60; @@ -94,7 +94,7 @@ start_logout_process(void) ret = waitpid(pid, &status, 0); if(ret > 0) { if(WIFEXITED(status) || WIFSIGNALED(status)) { - execle(prog, argv0, NULL, env); + execle(prog, argv0, (char *)NULL, env); err(1, "exec %s", prog); } } else if(ret < 0) @@ -119,11 +119,11 @@ exec_shell(const char *shell, int fallback) else p = shell; asprintf(&sh, "-%s", p); - execle(shell, sh, NULL, env); + execle(shell, sh, (char *)NULL, env); if(fallback){ warnx("Can't exec %s, trying %s", shell, _PATH_BSHELL); - execle(_PATH_BSHELL, "-sh", NULL, env); + execle(_PATH_BSHELL, "-sh", (char *)NULL, env); err(1, "%s", _PATH_BSHELL); } err(1, "%s", shell); @@ -650,7 +650,7 @@ main(int argc, char **argv) int ask = 1; struct sigaction sa; - set_progname(argv[0]); + setprogname(argv[0]); #ifdef KRB5 { diff --git a/kerberosV/src/appl/rcp/util.c b/kerberosV/src/appl/rcp/util.c index baa1e36b41f..912a38816a4 100644 --- a/kerberosV/src/appl/rcp/util.c +++ b/kerberosV/src/appl/rcp/util.c @@ -113,7 +113,7 @@ susystem(s, userid) case 0: (void)setuid(userid); - execl(_PATH_BSHELL, "sh", "-c", s, NULL); + execl(_PATH_BSHELL, "sh", "-c", s, (char *)NULL); _exit(127); } istat = signal(SIGINT, SIG_IGN); diff --git a/kerberosV/src/appl/rsh/rshd.c b/kerberosV/src/appl/rsh/rshd.c index 528b248be37..ee532b7f292 100644 --- a/kerberosV/src/appl/rsh/rshd.c +++ b/kerberosV/src/appl/rsh/rshd.c @@ -32,7 +32,10 @@ */ #include "rsh_locl.h" -RCSID("$KTH: rshd.c,v 1.39 2001/01/09 18:44:29 assar Exp $"); +RCSID("$KTH: rshd.c,v 1.41 2001/02/20 01:44:48 assar Exp $"); + +int +login_access( struct passwd *user, char *from); enum auth_method auth_method; @@ -72,6 +75,10 @@ krb5_ticket *user_ticket; static void syslog_and_die (const char *m, ...) + __attribute__ ((format (printf, 1, 2))); + +static void +syslog_and_die (const char *m, ...) { va_list args; @@ -83,6 +90,10 @@ syslog_and_die (const char *m, ...) static void fatal (int sock, const char *m, ...) + __attribute__ ((format (printf, 2, 3))); + +static void +fatal (int sock, const char *m, ...) { va_list args; char buf[BUFSIZ]; @@ -586,7 +597,7 @@ doit (int do_kerberos, int check_rhosts) struct sockaddr *thataddr = (struct sockaddr *)&thataddr_ss; struct sockaddr_storage erraddr_ss; struct sockaddr *erraddr = (struct sockaddr *)&erraddr_ss; - socklen_t addrlen; + socklen_t thisaddr_len, thataddr_len; int port; int errsock = -1; char client_user[COMMAND_SZ], server_user[USERNAME_SZ]; @@ -594,12 +605,14 @@ doit (int do_kerberos, int check_rhosts) struct passwd *pwd; int s = STDIN_FILENO; char **env; + int ret; + char that_host[NI_MAXHOST]; - addrlen = sizeof(thisaddr_ss); - if (getsockname (s, thisaddr, &addrlen) < 0) + thisaddr_len = sizeof(thisaddr_ss); + if (getsockname (s, thisaddr, &thisaddr_len) < 0) syslog_and_die("getsockname: %m"); - addrlen = sizeof(thataddr_ss); - if (getpeername (s, thataddr, &addrlen) < 0) + thataddr_len = sizeof(thataddr_ss); + if (getpeername (s, thataddr, &thataddr_len) < 0) syslog_and_die ("getpeername: %m"); if (!do_kerberos && !is_reserved(socket_get_port(thataddr))) @@ -689,7 +702,7 @@ doit (int do_kerberos, int check_rhosts) syslog_and_die("recv_bsd_auth failed"); } -#if defined(DCE) && defined(AIX) +#if defined(DCE) && defined(_AIX) esetenv("AUTHSTATE", "DCE", 1); #endif @@ -703,6 +716,19 @@ doit (int do_kerberos, int check_rhosts) if (pwd->pw_uid != 0 && access (_PATH_NOLOGIN, F_OK) == 0) fatal (s, "Login disabled."); + + ret = getnameinfo_verified (thataddr, thataddr_len, + that_host, sizeof(that_host), + NULL, 0, 0); + if (ret) + fatal (s, "getnameinfo: %s", gai_strerror(ret)); + + if (login_access(pwd, that_host) == 0) { + syslog(LOG_NOTICE, "Kerberos rsh denied to %s from %s", + server_user, that_host); + fatal(s, "Permission denied"); + } + #ifdef HAVE_GETSPNAM { struct spwd *sp; @@ -810,7 +836,7 @@ doit (int do_kerberos, int check_rhosts) #endif /* KRB5 */ } #endif /* KRB4 */ - execle (pwd->pw_shell, pwd->pw_shell, "-c", cmd, NULL, env); + execle (pwd->pw_shell, pwd->pw_shell, "-c", cmd, (char *)NULL, env); err(1, "exec %s", pwd->pw_shell); } @@ -844,7 +870,7 @@ usage (int ret) NULL, ""); else - syslog (LOG_ERR, "Usage: %s [-ikxlvPL] [-p port]", __progname); + syslog (LOG_ERR, "Usage: %s [-ikxlvPL] [-p port]", getprogname()); exit (ret); } @@ -855,7 +881,7 @@ main(int argc, char **argv) int optind = 0; int port = 0; - set_progname (argv[0]); + setprogname (argv[0]); roken_openlog ("rshd", LOG_ODELAY | LOG_PID, LOG_AUTH); if (getarg(args, sizeof(args) / sizeof(args[0]), argc, argv, diff --git a/kerberosV/src/appl/telnet/telnet/commands.c b/kerberosV/src/appl/telnet/telnet/commands.c index 0aa1f56140f..eac310da5fc 100644 --- a/kerberosV/src/appl/telnet/telnet/commands.c +++ b/kerberosV/src/appl/telnet/telnet/commands.c @@ -33,7 +33,7 @@ #include "telnet_locl.h" -RCSID("$KTH: commands.c,v 1.64 2000/12/11 01:44:01 assar Exp $"); +RCSID("$KTH: commands.c,v 1.65 2001/02/20 03:12:09 assar Exp $"); #if defined(IPPROTO_IP) && defined(IP_TOS) int tos = -1; @@ -988,7 +988,6 @@ unsetcmd(int argc, char *argv[]) * 'mode' command. */ #ifdef KLUDGELINEMODE -extern int kludgelinemode; static int dokludgemode(void) @@ -1030,7 +1029,6 @@ static int dolmmode(int bit, int on) { unsigned char c; - extern int linemode; if (my_want_state_is_wont(TELOPT_LINEMODE)) { printf("?Need to have LINEMODE option enabled first.\r\n"); @@ -1307,9 +1305,9 @@ shell(int argc, char **argv) else shellname++; if (argc > 1) - execl(shellp, shellname, "-c", &saveline[1], 0); + execl(shellp, shellname, "-c", &saveline[1], (char *)NULL); else - execl(shellp, shellname, 0); + execl(shellp, shellname, (char *)NULL); perror("Execl"); _exit(1); } @@ -1328,8 +1326,6 @@ shell(int argc, char **argv) static int bye(int argc, char **argv) { - extern int resettermname; - if (connected) { shutdown(net, 2); printf("Connection closed.\r\n"); @@ -1551,7 +1547,6 @@ env_find(unsigned char *var) void env_init(void) { - extern char **environ; char **epp, *cp; struct env_lst *ep; @@ -1972,7 +1967,7 @@ status(int argc, char **argv) /* * Function that gets called when SIGINFO is received. */ -void +RETSIGTYPE ayt_status(int ignore) { call(status, "status", "notmuch", 0); @@ -2117,6 +2112,7 @@ tn(int argc, char **argv) goto usage; strlcpy (_hostname, hostp, sizeof(_hostname)); + hostp = _hostname; if (hostp[0] == '@' || hostp[0] == '!') { char *p; hostname = NULL; diff --git a/kerberosV/src/appl/telnet/telnetd/sys_term.c b/kerberosV/src/appl/telnet/telnetd/sys_term.c index ebe7b9b8c77..cd927e0ed36 100644 --- a/kerberosV/src/appl/telnet/telnetd/sys_term.c +++ b/kerberosV/src/appl/telnet/telnetd/sys_term.c @@ -33,7 +33,7 @@ #include "telnetd.h" -RCSID("$KTH: sys_term.c,v 1.97 2000/12/08 23:32:06 assar Exp $"); +RCSID("$KTH: sys_term.c,v 1.100 2001/04/24 23:11:43 assar Exp $"); #if defined(_CRAY) || (defined(__hpux) && !defined(HAVE_UTMPX_H)) # define PARENT_DOES_UTMP @@ -1110,7 +1110,8 @@ make_id (char *tty) /* ARGSUSED */ void -startslave(char *host, int autologin, char *autoname) +startslave(const char *host, const char *utmp_host, + int autologin, char *autoname) { int i; @@ -1158,7 +1159,7 @@ startslave(char *host, int autologin, char *autoname) wtmp.ut_type = LOGIN_PROCESS; wtmp.ut_pid = pid; strncpy(wtmp.ut_user, "LOGIN", sizeof(wtmp.ut_user)); - strncpy(wtmp.ut_host, host, sizeof(wtmp.ut_host)); + strncpy(wtmp.ut_host, utmp_host, sizeof(wtmp.ut_host)); strncpy(wtmp.ut_line, clean_ttyname(line), sizeof(wtmp.ut_line)); #ifdef HAVE_STRUCT_UTMP_UT_ID strncpy(wtmp.ut_id, wtmp.ut_line + 3, sizeof(wtmp.ut_id)); @@ -1192,7 +1193,6 @@ extern char **environ; void init_env(void) { - extern char *getenv(const char *); char **envp; envp = envinit; @@ -1259,10 +1259,10 @@ scrub_env(void) struct arg_val { int size; int argc; - char **argv; + const char **argv; }; -static void addarg(struct arg_val*, char*); +static void addarg(struct arg_val*, const char*); /* * start_login(host) @@ -1272,10 +1272,11 @@ static void addarg(struct arg_val*, char*); */ void -start_login(char *host, int autologin, char *name) +start_login(const char *host, int autologin, char *name) { struct arg_val argv; char *user; + int save_errno; #ifdef HAVE_UTMPX_H int pid = getpid(); @@ -1316,7 +1317,7 @@ start_login(char *host, int autologin, char *name) /* init argv structure */ argv.size=0; argv.argc=0; - argv.argv=(char**)malloc(0); /*so we can call realloc later */ + argv.argv=malloc(0); /*so we can call realloc later */ addarg(&argv, "login"); addarg(&argv, "-h"); addarg(&argv, host); @@ -1371,14 +1372,14 @@ start_login(char *host, int autologin, char *name) sleep(1); execv(new_login, argv.argv); - + save_errno = errno; syslog(LOG_ERR, "%s: %m\n", new_login); - fatalperror(net, new_login); + fatalperror_errno(net, new_login, save_errno); /*NOTREACHED*/ } static void -addarg(struct arg_val *argv, char *val) +addarg(struct arg_val *argv, const char *val) { if(argv->size <= argv->argc+1) { argv->argv = realloc(argv->argv, sizeof(char*) * (argv->size + 10)); @@ -1879,7 +1880,7 @@ cleantmpdir(jid, tpath, user) tpath); break; case 0: - execl(CLEANTMPCMD, CLEANTMPCMD, user, tpath, 0); + execl(CLEANTMPCMD, CLEANTMPCMD, user, tpath, (char *)NULL); syslog(LOG_ERR, "TMPDIR cleanup(%s): execl(%s) failed: %m\n", tpath, CLEANTMPCMD); exit(1); diff --git a/kerberosV/src/appl/xnlock/xnlock.c b/kerberosV/src/appl/xnlock/xnlock.c index d9327763329..3b13b0bbc88 100644 --- a/kerberosV/src/appl/xnlock/xnlock.c +++ b/kerberosV/src/appl/xnlock/xnlock.c @@ -8,7 +8,7 @@ */ #ifdef HAVE_CONFIG_H #include <config.h> -RCSID("$KTH: xnlock.c,v 1.83 2000/12/31 07:42:33 assar Exp $"); +RCSID("$KTH: xnlock.c,v 1.85 2001/03/15 17:13:13 joda Exp $"); #endif #include <stdio.h> @@ -199,7 +199,7 @@ get_words(void) static void usage(void) { - fprintf(stderr, "usage: %s [options] [message]\n", __progname); + fprintf(stderr, "usage: %s [options] [message]\n", getprogname()); fprintf(stderr, "-fg color foreground color\n"); fprintf(stderr, "-bg color background color\n"); fprintf(stderr, "-rv reverse foreground/background colors\n"); @@ -286,8 +286,8 @@ zrefresh(void) return -1; case 0: /* Child */ - execlp("zrefresh", "zrefresh", 0); - execl(BINDIR "/zrefresh", "zrefresh", 0); + execlp("zrefresh", "zrefresh", (char *)NULL); + execl(BINDIR "/zrefresh", "zrefresh", (char *)NULL); return -1; default: /* Parent */ @@ -584,12 +584,8 @@ verify_krb5(const char *password) ret = krb5_cc_retrieve_cred(context, id, 0, &mcred, &cred); if(ret == 0) { ret = krb524_convert_creds_kdc(context, id, &cred, &c); - if(ret == 0) { - snprintf(krb4tkfile, sizeof(krb4tkfile), "%s%d", TKT_ROOT, - getuid()); - krb_set_tkt_string(krb4tkfile); + if(ret == 0) tf_setup(&c, c.pname, c.pinst); - } memset(&c, 0, sizeof(c)); krb5_free_creds_contents(context, &cred); } @@ -946,7 +942,7 @@ main (int argc, char **argv) Widget override; XGCValues gcvalues; - set_progname (argv[0]); + setprogname (argv[0]); /* * Must be setuid root to read /etc/shadow, copy encrypted diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c index 561a45e9bba..7f47a5bb967 100644 --- a/lib/libc/gen/popen.c +++ b/lib/libc/gen/popen.c @@ -35,7 +35,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: popen.c,v 1.9 1997/09/11 18:51:04 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: popen.c,v 1.10 2001/07/09 07:04:39 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -118,7 +118,7 @@ popen(program, type) (void)close(pdes[0]); } } - execl(_PATH_BSHELL, "sh", "-c", program, NULL); + execl(_PATH_BSHELL, "sh", "-c", program, (char *)NULL); _exit(127); /* NOTREACHED */ } diff --git a/lib/libc_r/TEST/test_fcntl.c b/lib/libc_r/TEST/test_fcntl.c index c501eb8b59c..816cebd6f35 100644 --- a/lib/libc_r/TEST/test_fcntl.c +++ b/lib/libc_r/TEST/test_fcntl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: test_fcntl.c,v 1.3 2000/01/06 06:53:52 d Exp $ */ +/* $OpenBSD: test_fcntl.c,v 1.4 2001/07/09 07:04:40 deraadt Exp $ */ /* * Test fcntl() flag inheritance across a fork() */ @@ -17,7 +17,7 @@ main() CHECKe(child = fork()); switch(child) { case 0: /* child */ - CHECKe(execlp("test_create", "test_create", NULL)); + CHECKe(execlp("test_create", "test_create", (char *)NULL)); /* NOTREACHED */ default: /* parent */ CHECKe(wait(NULL)); diff --git a/lib/libc_r/TEST/test_sock_2.c b/lib/libc_r/TEST/test_sock_2.c index 88b3636236b..9b234702b5e 100644 --- a/lib/libc_r/TEST/test_sock_2.c +++ b/lib/libc_r/TEST/test_sock_2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: test_sock_2.c,v 1.5 2000/01/06 06:58:34 d Exp $ */ +/* $OpenBSD: test_sock_2.c,v 1.6 2001/07/09 07:04:40 deraadt Exp $ */ /* ==== test_sock_1.c ========================================================= * Copyright (c) 1993 by Chris Provenzano, proven@athena.mit.edu * @@ -96,7 +96,7 @@ sock_accept(arg) CHECKe(pid = fork()); switch(pid) { case 0: - execl("test_sock_2a", "test_sock_2a", "fork okay", NULL); + execl("test_sock_2a", "test_sock_2a", "fork okay", (char *)NULL); DIE(errno, "execl"); default: break; diff --git a/lib/libutil/passwd.c b/lib/libutil/passwd.c index 8b98890a77e..a3a2f534875 100644 --- a/lib/libutil/passwd.c +++ b/lib/libutil/passwd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: passwd.c,v 1.24 2001/01/02 18:22:32 millert Exp $ */ +/* $OpenBSD: passwd.c,v 1.25 2001/07/09 07:04:40 deraadt 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.24 2001/01/02 18:22:32 millert Exp $"; +static char rcsid[] = "$OpenBSD: passwd.c,v 1.25 2001/07/09 07:04:40 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -295,10 +295,10 @@ pw_mkdb(username) if (pw_lck) { if (username) execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", "-d", - pw_dir, "-u", username, pw_lck, NULL); + pw_dir, "-u", username, pw_lck, (char *)NULL); else execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", "-d", - pw_dir, pw_lck, NULL); + pw_dir, pw_lck, (char *)NULL); } _exit(1); } diff --git a/libexec/atrun/atrun.c b/libexec/atrun/atrun.c index 6d41d60920d..7ce28e5a7c2 100644 --- a/libexec/atrun/atrun.c +++ b/libexec/atrun/atrun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atrun.c,v 1.13 2001/05/29 21:37:16 millert Exp $ */ +/* $OpenBSD: atrun.c,v 1.14 2001/07/09 07:04:41 deraadt Exp $ */ /* * atrun.c - run jobs queued by at; run with root privileges. @@ -71,7 +71,7 @@ /* File scope variables */ static char *namep; -static char rcsid[] = "$OpenBSD: atrun.c,v 1.13 2001/05/29 21:37:16 millert Exp $"; +static char rcsid[] = "$OpenBSD: atrun.c,v 1.14 2001/07/09 07:04:41 deraadt Exp $"; static int debug = 0; /* Local functions */ @@ -320,7 +320,7 @@ run_file(filename, uid, gid) if (queue > 'b') (void) setpriority(PRIO_PROCESS, 0, queue - 'b'); - if (execle(_PATH_BSHELL, "sh", NULL, nenvp) != 0) + if (execle(_PATH_BSHELL, "sh", (char *)NULL, nenvp) != 0) perr("Exec failed for /bin/sh"); PRIV_END @@ -357,7 +357,7 @@ run_file(filename, uid, gid) chdir("/"); execl(_PATH_SENDMAIL, "sendmail", "-F", "Atrun Service", - "-odi", "-oem", "-t", (char *) NULL); + "-odi", "-oem", "-t", (char *)NULL); perr("Exec failed for mail command"); PRIV_END diff --git a/libexec/ld.so/ldd/ldd.c b/libexec/ld.so/ldd/ldd.c index 07e552e59e4..f46dc0b0366 100644 --- a/libexec/ld.so/ldd/ldd.c +++ b/libexec/ld.so/ldd/ldd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldd.c,v 1.6 2001/06/13 19:43:21 deraadt Exp $ */ +/* $OpenBSD: ldd.c,v 1.7 2001/07/09 07:04:42 deraadt Exp $ */ /* * Copyright (c) 2001 Artur Grabowski <art@openbsd.org> * All rights reserved. @@ -143,7 +143,7 @@ doit(char *name) case -1: err(1, "fork"); case 0: - execl(name, name, NULL); + execl(name, name, (char *)NULL); perror(name); _exit(1); default: @@ -166,4 +166,4 @@ doit(char *name) return 0; } -
\ No newline at end of file + diff --git a/libexec/mail.local/mail.local.c b/libexec/mail.local/mail.local.c index 6c39a336a04..1bd9f9d5ec9 100644 --- a/libexec/mail.local/mail.local.c +++ b/libexec/mail.local/mail.local.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mail.local.c,v 1.20 2000/04/21 21:50:00 millert Exp $ */ +/* $OpenBSD: mail.local.c,v 1.21 2001/07/09 07:04:42 deraadt Exp $ */ /*- * Copyright (c) 1996-1998 Theo de Raadt <deraadt@theos.com> @@ -45,7 +45,7 @@ char copyright[] = #if 0 static char sccsid[] = "from: @(#)mail.local.c 5.6 (Berkeley) 6/19/91"; #else -static char rcsid[] = "$OpenBSD: mail.local.c,v 1.20 2000/04/21 21:50:00 millert Exp $"; +static char rcsid[] = "$OpenBSD: mail.local.c,v 1.21 2001/07/09 07:04:42 deraadt Exp $"; #endif #endif /* not lint */ @@ -108,7 +108,7 @@ main(argc, argv) /* Support -H flag for backwards compat */ if (holdme) { - execl(_PATH_LOCKSPOOL, "lockspool", NULL); + execl(_PATH_LOCKSPOOL, "lockspool", (char *)NULL); err(FATAL, "execl: lockspool: %s", strerror(errno)); } else { if (!*argv) diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c index b110502028c..aab2c1c2faf 100644 --- a/libexec/rexecd/rexecd.c +++ b/libexec/rexecd/rexecd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rexecd.c,v 1.17 2001/05/29 21:37:16 millert Exp $ */ +/* $OpenBSD: rexecd.c,v 1.18 2001/07/09 07:04:44 deraadt Exp $ */ /* * Copyright (c) 1983 The Regents of the University of California. @@ -41,7 +41,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)rexecd.c 5.12 (Berkeley) 2/25/91";*/ -static char rcsid[] = "$OpenBSD: rexecd.c,v 1.17 2001/05/29 21:37:16 millert Exp $"; +static char rcsid[] = "$OpenBSD: rexecd.c,v 1.18 2001/07/09 07:04:44 deraadt Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -283,7 +283,7 @@ doit(f, fromp) else cp = pwd->pw_shell; closelog(); - execl(pwd->pw_shell, cp, "-c", cmdbuf, 0); + execl(pwd->pw_shell, cp, "-c", cmdbuf, (char *)NULL); perror(pwd->pw_shell); exit(1); } diff --git a/libexec/rshd/rshd.c b/libexec/rshd/rshd.c index 72f7958a46d..8592a841927 100644 --- a/libexec/rshd/rshd.c +++ b/libexec/rshd/rshd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rshd.c,v 1.38 2001/06/11 15:18:51 mickey Exp $ */ +/* $OpenBSD: rshd.c,v 1.39 2001/07/09 07:04:44 deraadt Exp $ */ /*- * Copyright (c) 1988, 1989, 1992, 1993, 1994 @@ -41,7 +41,7 @@ static char copyright[] = #ifndef lint /* from: static char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) 4/6/94"; */ -static char *rcsid = "$OpenBSD: rshd.c,v 1.38 2001/06/11 15:18:51 mickey Exp $"; +static char *rcsid = "$OpenBSD: rshd.c,v 1.39 2001/07/09 07:04:44 deraadt Exp $"; #endif /* not lint */ /* @@ -751,7 +751,7 @@ fail: syslog(LOG_INFO|LOG_AUTH, "%s@%s as %s: cmd='%.80s'", remuser, hostname, locuser, cmdbuf); } - execl(pwd->pw_shell, cp, "-c", cmdbuf, 0); + execl(pwd->pw_shell, cp, "-c", cmdbuf, (char *)NULL); perror(pwd->pw_shell); exit(1); } diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c index 0b8d19a0dd3..e0bf301bd93 100644 --- a/libexec/telnetd/sys_term.c +++ b/libexec/telnetd/sys_term.c @@ -1886,7 +1886,7 @@ cleantmpdir(jid, tpath, user) tpath); break; case 0: - execl(CLEANTMPCMD, CLEANTMPCMD, user, tpath, 0); + execl(CLEANTMPCMD, CLEANTMPCMD, user, tpath, (char *)NULL); syslog(LOG_ERR, "TMPDIR cleanup(%s): execl(%s) failed: %m\n", tpath, CLEANTMPCMD); exit(1); diff --git a/libexec/uucpd/uucpd.c b/libexec/uucpd/uucpd.c index b5bd02f8f77..ddf04f857a0 100644 --- a/libexec/uucpd/uucpd.c +++ b/libexec/uucpd/uucpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uucpd.c,v 1.18 2001/01/28 19:34:35 niklas Exp $ */ +/* $OpenBSD: uucpd.c,v 1.19 2001/07/09 07:04:45 deraadt Exp $ */ /* * Copyright (c) 1985 The Regents of the University of California. @@ -44,7 +44,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)uucpd.c 5.10 (Berkeley) 2/26/91";*/ -static char rcsid[] = "$OpenBSD: uucpd.c,v 1.18 2001/01/28 19:34:35 niklas Exp $"; +static char rcsid[] = "$OpenBSD: uucpd.c,v 1.19 2001/07/09 07:04:45 deraadt Exp $"; #endif /* not lint */ /* @@ -227,7 +227,7 @@ struct sockaddr_in *sinp; return; } chdir(pw->pw_dir); - execl(_PATH_UUCICO, "uucico", (char *)0); + execl(_PATH_UUCICO, "uucico", (char *)NULL); perror("uucico server: execl"); } diff --git a/sbin/init/init.c b/sbin/init/init.c index f71da41dcdc..aa69686b6ad 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.21 2001/01/19 17:57:37 deraadt Exp $ */ +/* $OpenBSD: init.c,v 1.22 2001/07/09 07:04:45 deraadt Exp $ */ /* $NetBSD: init.c,v 1.22 1996/05/15 23:29:33 jtc Exp $ */ /*- @@ -47,7 +47,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)init.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: init.c,v 1.21 2001/01/19 17:57:37 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: init.c,v 1.22 2001/07/09 07:04:45 deraadt Exp $"; #endif #endif /* not lint */ @@ -1416,7 +1416,7 @@ nice_death() sigprocmask(SIG_SETMASK, &sa.sa_mask, NULL); execl(_PATH_BSHELL, "sh", _PATH_RUNCOM, "shutdown", - NULL); + (char *)NULL); stall("can't exec %s for %s %s: %m", _PATH_BSHELL, _PATH_RUNCOM, "shutdown"); _exit(1); diff --git a/sbin/modload/modload.c b/sbin/modload/modload.c index 711023e26d5..ec982a68d8a 100644 --- a/sbin/modload/modload.c +++ b/sbin/modload/modload.c @@ -1,4 +1,4 @@ -/* $OpenBSD: modload.c,v 1.25 2001/07/07 18:26:15 deraadt Exp $ */ +/* $OpenBSD: modload.c,v 1.26 2001/07/09 07:04:46 deraadt Exp $ */ /* $NetBSD: modload.c,v 1.13 1995/05/28 05:21:58 jtc Exp $ */ /* @@ -103,7 +103,7 @@ linkcmd(kernel, entry, outfile, address, object) if (pid == 0) { execl(_PATH_LD, "ld", LDSYMTABLE, kernel, "-e", entrybuf, "-o", - outfile, LDTEXTSTART, addrbuf, object, NULL); + outfile, LDTEXTSTART, addrbuf, object, (char *)NULL); exit(128 + errno); } @@ -494,7 +494,7 @@ main(argc, argv) cleanup(); - execl(post, post, id, type, offset, 0); + execl(post, post, id, type, offset, (char *)NULL); err(16, "can't exec `%s'", post); } diff --git a/sbin/reboot/reboot.c b/sbin/reboot/reboot.c index d86c4b1541d..19cda4b9f52 100644 --- a/sbin/reboot/reboot.c +++ b/sbin/reboot/reboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: reboot.c,v 1.19 2001/06/04 14:59:49 mickey Exp $ */ +/* $OpenBSD: reboot.c,v 1.20 2001/07/09 07:04:46 deraadt Exp $ */ /* $NetBSD: reboot.c,v 1.8 1995/10/05 05:36:22 mycroft Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)reboot.c 8.1 (Berkeley) 6/5/93"; #else -static char rcsid[] = "$OpenBSD: reboot.c,v 1.19 2001/06/04 14:59:49 mickey Exp $"; +static char rcsid[] = "$OpenBSD: reboot.c,v 1.20 2001/07/09 07:04:46 deraadt Exp $"; #endif #endif /* not lint */ @@ -196,7 +196,7 @@ main(argc, argv) t.c_oflag |= (ONLCR | OPOST); tcsetattr(0, TCSANOW, &t); - execl(_PATH_BSHELL, "sh", _PATH_RC, "shutdown", NULL); + execl(_PATH_BSHELL, "sh", _PATH_RC, "shutdown", (char *)NULL); _exit(1); default: waitpid(pid, NULL, 0); diff --git a/sbin/shutdown/shutdown.c b/sbin/shutdown/shutdown.c index 52ed7cb6f86..7e5f93e8227 100644 --- a/sbin/shutdown/shutdown.c +++ b/sbin/shutdown/shutdown.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shutdown.c,v 1.21 2001/07/07 18:26:22 deraadt Exp $ */ +/* $OpenBSD: shutdown.c,v 1.22 2001/07/09 07:04:47 deraadt Exp $ */ /* $NetBSD: shutdown.c,v 1.9 1995/03/18 15:01:09 cgd Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)shutdown.c 8.2 (Berkeley) 2/16/94"; #else -static char rcsid[] = "$OpenBSD: shutdown.c,v 1.21 2001/07/07 18:26:22 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: shutdown.c,v 1.22 2001/07/09 07:04:47 deraadt Exp $"; #endif #endif /* not lint */ @@ -424,7 +424,7 @@ die_you_gravy_sucking_pig_dog() t.c_oflag |= (ONLCR | OPOST); tcsetattr(0, TCSANOW, &t); - execl(_PATH_BSHELL, "sh", _PATH_RC, "shutdown", NULL); + execl(_PATH_BSHELL, "sh", _PATH_RC, "shutdown", (char *)NULL); _exit(1); default: waitpid(pid, NULL, 0); diff --git a/usr.bin/apply/apply.c b/usr.bin/apply/apply.c index 079b955f491..06875df4a6a 100644 --- a/usr.bin/apply/apply.c +++ b/usr.bin/apply/apply.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apply.c,v 1.8 2000/12/24 11:22:54 aaron Exp $ */ +/* $OpenBSD: apply.c,v 1.9 2001/07/09 07:04:47 deraadt Exp $ */ /* $NetBSD: apply.c,v 1.3 1995/03/25 03:38:23 glass Exp $ */ /*- @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)apply.c 8.4 (Berkeley) 4/4/94"; #else -static char rcsid[] = "$OpenBSD: apply.c,v 1.8 2000/12/24 11:22:54 aaron Exp $"; +static char rcsid[] = "$OpenBSD: apply.c,v 1.9 2001/07/09 07:04:47 deraadt Exp $"; #endif #endif /* not lint */ @@ -218,7 +218,7 @@ system(command) err(1, "fork"); case 0: /* child */ (void)sigsetmask(omask); - execl(shell, name, "-c", command, NULL); + execl(shell, name, "-c", command, (char *)NULL); err(1, "%s", shell); } intsave = signal(SIGINT, SIG_IGN); diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c index 84d70a4735c..2b6766a0507 100644 --- a/usr.bin/calendar/io.c +++ b/usr.bin/calendar/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.11 2001/06/05 21:27:16 pjanzen Exp $ */ +/* $OpenBSD: io.c,v 1.12 2001/07/09 07:04:48 deraadt Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -43,7 +43,7 @@ static const char copyright[] = #if 0 static const char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94"; #else -static char rcsid[] = "$OpenBSD: io.c,v 1.11 2001/06/05 21:27:16 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: io.c,v 1.12 2001/07/09 07:04:48 deraadt Exp $"; #endif #endif /* not lint */ @@ -362,7 +362,7 @@ opencal() (void)close(pdes[0]); (void)setuid(geteuid()); (void)setgid(getegid()); - execl(_PATH_CPP, "cpp", "-P", "-I.", _PATH_INCLUDE, NULL); + execl(_PATH_CPP, "cpp", "-P", "-I.", _PATH_INCLUDE, (char *)NULL); warn(_PATH_CPP); _exit(1); } @@ -413,7 +413,7 @@ closecal(fp) (void)setuid(geteuid()); (void)setgid(getegid()); execl(_PATH_SENDMAIL, "sendmail", "-i", "-t", "-F", - "\"Reminder Service\"", NULL); + "\"Reminder Service\"", (char *)NULL); warn(_PATH_SENDMAIL); _exit(1); } diff --git a/usr.bin/learn/src/learn.c b/usr.bin/learn/src/learn.c index 3cabb520065..df4bc3eb907 100644 --- a/usr.bin/learn/src/learn.c +++ b/usr.bin/learn/src/learn.c @@ -2,7 +2,7 @@ * learn, from V7 UNIX: one of the earliest Computer Based Training (CBT) * programs still in existence. * - * $OpenBSD: learn.c,v 1.4 2000/06/30 16:00:23 millert Exp $ + * $OpenBSD: learn.c,v 1.5 2001/07/09 07:04:48 deraadt Exp $ */ /**************************************************************** @@ -469,8 +469,8 @@ makpipe() close(0); dup(f[0]); close(f[0]); - execl ("/bin/sh", "sh", "-i", 0); - execl ("/usr/bin/sh", "sh", "-i", 0); + execl ("/bin/sh", "sh", "-i", (char *)NULL); + execl ("/usr/bin/sh", "sh", "-i", (char *)NULL); write(2,"Exec error\n",11); } close(f[0]); @@ -496,7 +496,7 @@ maktee() close(out); dup(in); close(in); - execl (tee, "lrntee", 0); + execl (tee, "lrntee", (char *)NULL); fprintf(stderr, "Tee exec failed\n"); exit(1); } @@ -699,7 +699,7 @@ int system(const char *s) if ((pid = fork()) == 0) { signal(SIGINT, SIG_DFL); signal(SIGQUIT, SIG_DFL); - execl("/bin/sh", "sh", "-c", s, 0); + execl("/bin/sh", "sh", "-c", s, (char *)NULL); _exit(127); } while ((w = wait(&status)) != pid && w != -1) @@ -1029,8 +1029,8 @@ int n; chdir(".."); if ( (pid=fork()) ==0) { signal(SIGHUP, SIG_IGN); - execl("/bin/rm", "rm", "-r", playdir, 0); - execl("/usr/bin/rm", "rm", "-r", playdir, 0); + execl("/bin/rm", "rm", "-r", playdir, (char *)NULL); + execl("/usr/bin/rm", "rm", "-r", playdir, (char *)NULL); fprintf(stderr, "Can't find 'rm' command.\n"); exit(0); } diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c index ee03a7153f3..cf56213e0db 100644 --- a/usr.bin/login/login.c +++ b/usr.bin/login/login.c @@ -1,4 +1,4 @@ -/* $OpenBSD: login.c,v 1.41 2001/07/06 18:12:06 pvalchev Exp $ */ +/* $OpenBSD: login.c,v 1.42 2001/07/09 07:04:49 deraadt Exp $ */ /* $NetBSD: login.c,v 1.13 1996/05/15 23:50:16 jtc Exp $ */ /*- @@ -77,7 +77,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)login.c 8.4 (Berkeley) 4/2/94"; #endif -static char rcsid[] = "$OpenBSD: login.c,v 1.41 2001/07/06 18:12:06 pvalchev Exp $"; +static char rcsid[] = "$OpenBSD: login.c,v 1.42 2001/07/09 07:04:49 deraadt Exp $"; #endif /* not lint */ /* @@ -769,7 +769,7 @@ failed: kgettokens(pwd->pw_dir); #endif - execlp(shell, tbuf, 0); + execlp(shell, tbuf, (char *)NULL); err(1, "%s", shell); } diff --git a/usr.bin/mg/fileio.c b/usr.bin/mg/fileio.c index 9b92b28887b..567684ca869 100644 --- a/usr.bin/mg/fileio.c +++ b/usr.bin/mg/fileio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fileio.c,v 1.18 2001/07/06 13:32:45 art Exp $ */ +/* $OpenBSD: fileio.c,v 1.19 2001/07/09 07:04:49 deraadt Exp $ */ /* * POSIX fileio.c @@ -401,7 +401,7 @@ copy(frname, toname) if ((pid = vfork())) { if (pid == -1) return -1; - execl("/bin/cp", "cp", frname, toname, NULL); + execl("/bin/cp", "cp", frname, toname, (char *)NULL); _exit(1); /* shouldn't happen */ } waitpid(pid, &status, 0); diff --git a/usr.bin/newsyslog/newsyslog.c b/usr.bin/newsyslog/newsyslog.c index 058ec397f0a..ab87e856f1c 100644 --- a/usr.bin/newsyslog/newsyslog.c +++ b/usr.bin/newsyslog/newsyslog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: newsyslog.c,v 1.36 2001/03/01 20:34:10 aaron Exp $ */ +/* $OpenBSD: newsyslog.c,v 1.37 2001/07/09 07:04:50 deraadt Exp $ */ /* * Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com> @@ -88,7 +88,7 @@ provided "as is" without express or implied warranty. */ #ifndef lint -static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.36 2001/03/01 20:34:10 aaron Exp $"; +static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.37 2001/07/09 07:04:50 deraadt Exp $"; #endif /* not lint */ #ifndef CONF @@ -724,7 +724,7 @@ compress_log(log) if (pid < 0) { err(1, "fork"); } else if (!pid) { - (void)execl(COMPRESS, base, "-f", tmp, 0); + (void)execl(COMPRESS, base, "-f", tmp, (char *)NULL); warn(COMPRESS); _exit(1); } diff --git a/usr.bin/oldrdist/server.c b/usr.bin/oldrdist/server.c index 21b85ce56bf..21afe62243f 100644 --- a/usr.bin/oldrdist/server.c +++ b/usr.bin/oldrdist/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.12 1999/08/17 09:13:16 millert Exp $ */ +/* $OpenBSD: server.c,v 1.13 2001/07/09 07:04:50 deraadt Exp $ */ /* * Copyright (c) 1983, 1993 @@ -35,7 +35,7 @@ #ifndef lint /* from: static char sccsid[] = "@(#)server.c 8.1 (Berkeley) 6/9/93"; */ -static char *rcsid = "$OpenBSD: server.c,v 1.12 1999/08/17 09:13:16 millert Exp $"; +static char *rcsid = "$OpenBSD: server.c,v 1.13 2001/07/09 07:04:50 deraadt Exp $"; #endif /* not lint */ #include <sys/wait.h> @@ -1391,7 +1391,7 @@ dospecial(cmd) seteuid(userid); setuid(userid); #endif /* DIRECT_RCMD */ - execl(_PATH_BSHELL, "sh", "-c", cmd, 0); + execl(_PATH_BSHELL, "sh", "-c", cmd, (char *)NULL); _exit(127); } (void) close(fd[1]); diff --git a/usr.bin/rdist/common.c b/usr.bin/rdist/common.c index acda69d8315..6df127bbfcc 100644 --- a/usr.bin/rdist/common.c +++ b/usr.bin/rdist/common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: common.c,v 1.10 2000/11/10 15:33:12 provos Exp $ */ +/* $OpenBSD: common.c,v 1.11 2001/07/09 07:04:51 deraadt Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -39,7 +39,7 @@ static char RCSid[] = "$From: common.c,v 6.82 1998/03/23 23:27:33 michaelc Exp $"; #else static char RCSid[] = -"$OpenBSD: common.c,v 1.10 2000/11/10 15:33:12 provos Exp $"; +"$OpenBSD: common.c,v 1.11 2001/07/09 07:04:51 deraadt Exp $"; #endif static char sccsid[] = "@(#)common.c"; @@ -836,7 +836,7 @@ void runcommand(cmd) (void) dup(fd[PIPE_WRITE]); (void) close(fd[PIPE_READ]); (void) close(fd[PIPE_WRITE]); - (void) execl(_PATH_BSHELL, "sh", "-c", cmd, 0); + (void) execl(_PATH_BSHELL, "sh", "-c", cmd, (char *)NULL); _exit(127); } (void) close(fd[PIPE_WRITE]); diff --git a/usr.bin/rdist/rdist.c b/usr.bin/rdist/rdist.c index c4b19bb2869..ab48f86fb85 100644 --- a/usr.bin/rdist/rdist.c +++ b/usr.bin/rdist/rdist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rdist.c,v 1.7 1999/02/04 23:18:57 millert Exp $ */ +/* $OpenBSD: rdist.c,v 1.8 2001/07/09 07:04:51 deraadt Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -39,7 +39,7 @@ static char RCSid[] = "$From: rdist.c,v 6.65 1995/12/12 00:20:39 mcooper Exp $"; #else static char RCSid[] = -"$OpenBSD: rdist.c,v 1.7 1999/02/04 23:18:57 millert Exp $"; +"$OpenBSD: rdist.c,v 1.8 2001/07/09 07:04:51 deraadt Exp $"; #endif static char sccsid[] = "@(#)main.c 5.1 (Berkeley) 6/6/85"; @@ -143,7 +143,7 @@ main(argc, argv, envp) "Old rdist (-Server) requested; running %s", _PATH_OLDRDIST); (void) execl(_PATH_OLDRDIST, xbasename(_PATH_OLDRDIST), - "-Server", NULL); + "-Server", (char *)NULL); fatalerr("Exec old rdist failed: %s: %s.", _PATH_OLDRDIST, SYSERR); #else /* !_PATH_OLDRDIST */ diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index 0c1e5af3fcf..972a1cf405a 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -1,4 +1,4 @@ -/* $OpenBSD: script.c,v 1.14 2001/01/11 19:26:01 deraadt Exp $ */ +/* $OpenBSD: script.c,v 1.15 2001/07/09 07:04:52 deraadt Exp $ */ /* $NetBSD: script.c,v 1.3 1994/12/21 08:55:43 jtc Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)script.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: script.c,v 1.14 2001/01/11 19:26:01 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: script.c,v 1.15 2001/07/09 07:04:52 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -246,7 +246,7 @@ doshell() (void)close(master); (void)fclose(fscript); login_tty(slave); - execl(shell, shell, "-i", NULL); + execl(shell, shell, "-i", (char *)NULL); perror(shell); fail(); } diff --git a/usr.bin/skeyaudit/skeyaudit.c b/usr.bin/skeyaudit/skeyaudit.c index afba42ab5b8..84b2e183fc5 100644 --- a/usr.bin/skeyaudit/skeyaudit.c +++ b/usr.bin/skeyaudit/skeyaudit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: skeyaudit.c,v 1.10 2000/09/20 21:53:49 pjanzen Exp $ */ +/* $OpenBSD: skeyaudit.c,v 1.11 2001/07/09 07:04:52 deraadt Exp $ */ /* * Copyright (c) 1997, 2000 Todd C. Miller <Todd.Miller@courtesan.com> @@ -202,7 +202,7 @@ runsendmail(pw, pidp) _exit(127); } - execl(_PATH_SENDMAIL, "sendmail", "-t", NULL); + execl(_PATH_SENDMAIL, "sendmail", "-t", (char *)NULL); warn("cannot run \"%s -t\"", _PATH_SENDMAIL); _exit(127); } diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c index b705c189147..f19424783b2 100644 --- a/usr.bin/ssh/session.c +++ b/usr.bin/ssh/session.c @@ -33,7 +33,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: session.c,v 1.98 2001/07/02 13:59:15 markus Exp $"); +RCSID("$OpenBSD: session.c,v 1.99 2001/07/09 07:04:53 deraadt Exp $"); #include "ssh.h" #include "ssh1.h" @@ -1124,7 +1124,7 @@ do_child(Session *s, const char *command) /* Launch login(1). */ execl("/usr/bin/login", "login", "-h", hostname, - "-p", "-f", "--", pw->pw_name, NULL); + "-p", "-f", "--", pw->pw_name, (char *)NULL); /* Login couldn't be executed, die. */ diff --git a/usr.bin/ssh/sftp-int.c b/usr.bin/ssh/sftp-int.c index 0ec69ddc224..77b20f5f691 100644 --- a/usr.bin/ssh/sftp-int.c +++ b/usr.bin/ssh/sftp-int.c @@ -26,7 +26,7 @@ /* XXX: recursive operations */ #include "includes.h" -RCSID("$OpenBSD: sftp-int.c,v 1.37 2001/06/23 15:12:20 itojun Exp $"); +RCSID("$OpenBSD: sftp-int.c,v 1.38 2001/07/09 07:04:53 deraadt Exp $"); #include <glob.h> @@ -165,10 +165,10 @@ local_do_shell(const char *args) /* XXX: child has pipe fds to ssh subproc open - issue? */ if (args) { debug3("Executing %s -c \"%s\"", shell, args); - execl(shell, shell, "-c", args, NULL); + execl(shell, shell, "-c", args, (char *)NULL); } else { debug3("Executing %s", shell); - execl(shell, shell, NULL); + execl(shell, shell, (char *)NULL); } fprintf(stderr, "Couldn't execute \"%s\": %s\n", shell, strerror(errno)); diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c index ce8844c4d8c..7bef2df33cd 100644 --- a/usr.bin/telnet/commands.c +++ b/usr.bin/telnet/commands.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commands.c,v 1.35 2001/04/30 10:00:04 markus Exp $ */ +/* $OpenBSD: commands.c,v 1.36 2001/07/09 07:04:54 deraadt Exp $ */ /* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */ /* @@ -1382,9 +1382,9 @@ shell(argc, argv) else shellname++; if (argc > 1) - execl(shellp, shellname, "-c", &saveline[1], 0); + execl(shellp, shellname, "-c", &saveline[1], (char *)NULL); else - execl(shellp, shellname, 0); + execl(shellp, shellname, (char *)NULL); perror("Execl"); _exit(1); } diff --git a/usr.bin/tip/cmds.c b/usr.bin/tip/cmds.c index 4aa91ccfbde..96f431b4e0a 100644 --- a/usr.bin/tip/cmds.c +++ b/usr.bin/tip/cmds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmds.c,v 1.8 2000/04/20 06:19:33 deraadt Exp $ */ +/* $OpenBSD: cmds.c,v 1.9 2001/07/09 07:04:55 deraadt Exp $ */ /* $NetBSD: cmds.c,v 1.7 1997/02/11 09:24:03 mrg Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)cmds.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: cmds.c,v 1.8 2000/04/20 06:19:33 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: cmds.c,v 1.9 2001/07/09 07:04:55 deraadt Exp $"; #endif /* not lint */ #include "tip.h" @@ -594,7 +594,7 @@ shell() else cp++; shell_uid(); - execl(value(SHELL), cp, 0); + execl(value(SHELL), cp, (char *)NULL); printf("\r\ncan't execl!\r\n"); exit(1); } @@ -690,7 +690,7 @@ execute(s) else cp++; shell_uid(); - execl(value(SHELL), cp, "-c", s, 0); + execl(value(SHELL), cp, "-c", s, (char *)NULL); } int @@ -862,7 +862,7 @@ expand(name) close(pivec[1]); close(2); shell_uid(); - execl(Shell, Shell, "-c", cmdbuf, 0); + execl(Shell, Shell, "-c", cmdbuf, (char *)NULL); _exit(1); } if (pid == -1) { diff --git a/usr.bin/tn3270/sys_curses/system.c b/usr.bin/tn3270/sys_curses/system.c index 800913deaba..c22bf7de8f6 100644 --- a/usr.bin/tn3270/sys_curses/system.c +++ b/usr.bin/tn3270/sys_curses/system.c @@ -1,4 +1,4 @@ -/* $OpenBSD: system.c,v 1.8 2000/02/01 03:23:44 deraadt Exp $ */ +/* $OpenBSD: system.c,v 1.9 2001/07/09 07:04:55 deraadt Exp $ */ /*- * Copyright (c) 1988 The Regents of the University of California. @@ -35,7 +35,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)system.c 4.5 (Berkeley) 4/26/91";*/ -static char rcsid[] = "$OpenBSD: system.c,v 1.8 2000/02/01 03:23:44 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: system.c,v 1.9 2001/07/09 07:04:55 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -738,7 +738,7 @@ char *argv[]; extern char *getenv(); cmdname = getenv("SHELL"); - execlp(cmdname, cmdname, 0); + execlp(cmdname, cmdname, (char *)NULL); perror("Exec'ing new shell...\n"); _exit(1); } else { diff --git a/usr.bin/tput/tput.c b/usr.bin/tput/tput.c index 25ad655eb1f..26f42b9bf46 100644 --- a/usr.bin/tput/tput.c +++ b/usr.bin/tput/tput.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tput.c,v 1.10 1999/09/12 10:29:01 millert Exp $ */ +/* $OpenBSD: tput.c,v 1.11 2001/07/09 07:04:56 deraadt Exp $ */ /* * Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com> @@ -69,7 +69,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)tput.c 8.3 (Berkeley) 4/28/95"; #endif -static char rcsid[] = "$OpenBSD: tput.c,v 1.10 1999/09/12 10:29:01 millert Exp $"; +static char rcsid[] = "$OpenBSD: tput.c,v 1.11 2001/07/09 07:04:56 deraadt Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -301,7 +301,7 @@ init() break; case 0: /* child */ - execl(init_prog, init_prog, NULL); + execl(init_prog, init_prog, (char *)NULL); _exit(127); break; default: diff --git a/usr.bin/vacation/vacation.c b/usr.bin/vacation/vacation.c index 91f840a1483..7ae1ce1679c 100644 --- a/usr.bin/vacation/vacation.c +++ b/usr.bin/vacation/vacation.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vacation.c,v 1.13 2000/08/05 21:53:30 pjanzen Exp $ */ +/* $OpenBSD: vacation.c,v 1.14 2001/07/09 07:04:56 deraadt Exp $ */ /* $NetBSD: vacation.c,v 1.7 1995/04/29 05:58:27 cgd Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)vacation.c 8.2 (Berkeley) 1/26/94"; #endif -static char rcsid[] = "$OpenBSD: vacation.c,v 1.13 2000/08/05 21:53:30 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: vacation.c,v 1.14 2001/07/09 07:04:56 deraadt Exp $"; #endif /* not lint */ /* @@ -470,7 +470,7 @@ sendmessage(myname) close(pvect[1]); close(fileno(mfp)); execl(_PATH_SENDMAIL, "sendmail", "-f", myname, "--", - from, NULL); + from, (char *)NULL); syslog(LOG_ERR, "can't exec %s: %m", _PATH_SENDMAIL); _exit(1); } diff --git a/usr.bin/vi/ex/ex_argv.c b/usr.bin/vi/ex/ex_argv.c index e0b0f951529..1058ec05d09 100644 --- a/usr.bin/vi/ex/ex_argv.c +++ b/usr.bin/vi/ex/ex_argv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_argv.c,v 1.7 2001/01/29 01:58:41 niklas Exp $ */ +/* $OpenBSD: ex_argv.c,v 1.8 2001/07/09 07:04:57 deraadt Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -691,7 +691,7 @@ err: if (ifp != NULL) * XXX * Assume that all shells have -c. */ - execl(sh_path, sh, "-c", bp, NULL); + execl(sh_path, sh, "-c", bp, (char *)NULL); msgq_str(sp, M_SYSERR, sh_path, "118|Error: execl: %s"); _exit(127); default: /* Parent. */ diff --git a/usr.bin/vi/ex/ex_cscope.c b/usr.bin/vi/ex/ex_cscope.c index 010cfc31929..a81bad41a28 100644 --- a/usr.bin/vi/ex/ex_cscope.c +++ b/usr.bin/vi/ex/ex_cscope.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_cscope.c,v 1.5 2001/01/29 01:58:42 niklas Exp $ */ +/* $OpenBSD: ex_cscope.c,v 1.6 2001/07/09 07:04:57 deraadt Exp $ */ /*- * Copyright (c) 1994, 1996 @@ -406,7 +406,7 @@ err: if (to_cs[0] != -1) #define CSCOPE_CMD_FMT "cd '%s' && exec cscope -dl -f %s" (void)snprintf(cmd, sizeof(cmd), CSCOPE_CMD_FMT, csc->dname, dbname); - (void)execl(_PATH_BSHELL, "sh", "-c", cmd, NULL); + (void)execl(_PATH_BSHELL, "sh", "-c", cmd, (char *)NULL); msgq_str(sp, M_SYSERR, cmd, "execl: %s"); _exit (127); /* NOTREACHED */ diff --git a/usr.bin/vi/ex/ex_filter.c b/usr.bin/vi/ex/ex_filter.c index 4a6588e69f5..4f111788177 100644 --- a/usr.bin/vi/ex/ex_filter.c +++ b/usr.bin/vi/ex/ex_filter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_filter.c,v 1.3 2001/01/29 01:58:42 niklas Exp $ */ +/* $OpenBSD: ex_filter.c,v 1.4 2001/07/09 07:04:57 deraadt Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -143,7 +143,7 @@ err: if (input[0] != -1) else ++name; - execl(O_STR(sp, O_SHELL), name, "-c", cmd, NULL); + execl(O_STR(sp, O_SHELL), name, "-c", cmd, (char *)NULL); msgq_str(sp, M_SYSERR, O_STR(sp, O_SHELL), "execl: %s"); _exit (127); /* NOTREACHED */ diff --git a/usr.bin/vi/ex/ex_script.c b/usr.bin/vi/ex/ex_script.c index 1fd4da0d22b..a666909e90e 100644 --- a/usr.bin/vi/ex/ex_script.c +++ b/usr.bin/vi/ex/ex_script.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_script.c,v 1.5 2001/01/29 01:58:44 niklas Exp $ */ +/* $OpenBSD: ex_script.c,v 1.6 2001/07/09 07:04:57 deraadt Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -185,7 +185,7 @@ err: if (sc->sh_master != -1) sh = sh_path; else ++sh; - execl(sh_path, sh, "-i", NULL); + execl(sh_path, sh, "-i", (char *)NULL); msgq_str(sp, M_SYSERR, sh_path, "execl: %s"); _exit(127); default: /* Parent. */ diff --git a/usr.bin/vi/ex/ex_shell.c b/usr.bin/vi/ex/ex_shell.c index 198626e2a6c..0acd8992083 100644 --- a/usr.bin/vi/ex/ex_shell.c +++ b/usr.bin/vi/ex/ex_shell.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_shell.c,v 1.6 2001/01/29 01:58:44 niklas Exp $ */ +/* $OpenBSD: ex_shell.c,v 1.7 2001/07/09 07:04:57 deraadt Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -128,7 +128,7 @@ ex_exec_proc(sp, cmdp, cmd, msg, need_newline) name = O_STR(sp, O_SHELL); else ++name; - execl(O_STR(sp, O_SHELL), name, "-c", cmd, NULL); + execl(O_STR(sp, O_SHELL), name, "-c", cmd, (char *)NULL); msgq_str(sp, M_SYSERR, O_STR(sp, O_SHELL), "execl: %s"); _exit(127); /* NOTREACHED */ diff --git a/usr.bin/window/wwterminfo.c b/usr.bin/window/wwterminfo.c index 556d7811948..064dc2b4687 100644 --- a/usr.bin/window/wwterminfo.c +++ b/usr.bin/window/wwterminfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wwterminfo.c,v 1.8 1999/11/14 17:34:24 millert Exp $ */ +/* $OpenBSD: wwterminfo.c,v 1.9 2001/07/09 07:04:58 deraadt Exp $ */ /* * Copyright (c) 1982, 1993 @@ -40,7 +40,7 @@ #if 0 static char sccsid[] = "@(#)wwterminfo.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: wwterminfo.c,v 1.8 1999/11/14 17:34:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: wwterminfo.c,v 1.9 2001/07/09 07:04:58 deraadt Exp $"; #endif #endif /* not lint */ @@ -102,7 +102,7 @@ wwterminfoend() /* can't really do (or say) anything about errors */ return -1; case 0: - execl(_PATH_RM, _PATH_RM, "-rf", wwterminfopath, 0); + execl(_PATH_RM, _PATH_RM, "-rf", wwterminfopath, (char *)NULL); _exit(0); default: wait(NULL); diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index 2b95eb38c31..e298cd9dcae 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xinstall.c,v 1.26 2001/06/23 23:09:31 millert Exp $ */ +/* $OpenBSD: xinstall.c,v 1.27 2001/07/09 07:04:58 deraadt Exp $ */ /* $NetBSD: xinstall.c,v 1.9 1995/12/20 10:25:17 jonathan Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)xinstall.c 8.1 (Berkeley) 7/21/93"; #endif -static char rcsid[] = "$OpenBSD: xinstall.c,v 1.26 2001/06/23 23:09:31 millert Exp $"; +static char rcsid[] = "$OpenBSD: xinstall.c,v 1.27 2001/07/09 07:04:58 deraadt Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -561,7 +561,7 @@ strip(to_name) (void)unlink(to_name); errx(EX_TEMPFAIL, "forks: %s", strerror(serrno)); case 0: - execl(path_strip, "strip", to_name, NULL); + execl(path_strip, "strip", to_name, (char *)NULL); warn("%s", path_strip); _exit(EX_OSERR); default: diff --git a/usr.sbin/afs/src/appl/afsutils/klog.c b/usr.sbin/afs/src/appl/afsutils/klog.c index 9bf800b8d15..16ab67b2db5 100644 --- a/usr.sbin/afs/src/appl/afsutils/klog.c +++ b/usr.sbin/afs/src/appl/afsutils/klog.c @@ -56,7 +56,7 @@ #include <config.h> #endif -RCSID("$Id: klog.c,v 1.1 2000/09/11 14:40:33 art Exp $"); +RCSID("$Id: klog.c,v 1.2 2001/07/09 07:04:59 deraadt Exp $"); #include "appl_locl.h" #include "klog.h" @@ -787,7 +787,7 @@ main(int argc, char **argv) shell = pwd->pw_shell; } - execl(shell, shell, NULL); + execl(shell, shell, (char *)NULL); /* the AFS token is useless if the shell exec fails, because it is in a PAG that will soon go away. */ diff --git a/usr.sbin/afs/src/lwp/testlwp.c b/usr.sbin/afs/src/lwp/testlwp.c index 7fbeb1b7bd2..14cf825165b 100644 --- a/usr.sbin/afs/src/lwp/testlwp.c +++ b/usr.sbin/afs/src/lwp/testlwp.c @@ -43,7 +43,7 @@ * multiple commands on the command line to run several tests at the * same time. * - * $Id: testlwp.c,v 1.3 2000/09/11 14:41:10 art Exp $ + * $Id: testlwp.c,v 1.4 2001/07/09 07:04:59 deraadt Exp $ * */ @@ -198,7 +198,7 @@ startSelectPC (char *progname) if (dup2(pipa[1], 0) == -1) err(1, "dup2"); close(pipa[1]); - execl(progname, "testlwp", "selectproducer", NULL); + execl(progname, "testlwp", "selectproducer", (char *)NULL); err(1, "execl"); default: break; @@ -299,7 +299,7 @@ int main(int argc, char **argv) yaEndlessLoop(); } else if (strcasecmp("version", argv[1]) == 0) { printf("Version: " - "$Id: testlwp.c,v 1.3 2000/09/11 14:41:10 art Exp $\n"); + "$Id: testlwp.c,v 1.4 2001/07/09 07:04:59 deraadt Exp $\n"); exit (0); } else { printf("unknown command %s\n", argv[1]); diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c index 44e98dd103d..a7b2ab84229 100644 --- a/usr.sbin/apmd/apmd.c +++ b/usr.sbin/apmd/apmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apmd.c,v 1.15 2001/07/07 01:10:42 mickey Exp $ */ +/* $OpenBSD: apmd.c,v 1.16 2001/07/09 07:05:00 deraadt Exp $ */ /* * Copyright (c) 1995, 1996 John T. Kohl @@ -522,7 +522,7 @@ do_etc_file(const char *file) return; case 0: /* We are the child. */ - execl(file, prog, NULL); + execl(file, prog, (char *)NULL); _exit(1); /* NOTREACHED */ default: diff --git a/usr.sbin/cron/crontab.c b/usr.sbin/cron/crontab.c index 2846971c657..e36ee83826a 100644 --- a/usr.sbin/cron/crontab.c +++ b/usr.sbin/cron/crontab.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crontab.c,v 1.19 2001/02/18 19:48:32 millert Exp $ */ +/* $OpenBSD: crontab.c,v 1.20 2001/07/09 07:05:00 deraadt Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved */ @@ -21,7 +21,7 @@ */ #if !defined(lint) && !defined(LINT) -static char rcsid[] = "$OpenBSD: crontab.c,v 1.19 2001/02/18 19:48:32 millert Exp $"; +static char rcsid[] = "$OpenBSD: crontab.c,v 1.20 2001/07/09 07:05:00 deraadt Exp $"; #endif /* crontab - install and manage per-user crontab files @@ -419,7 +419,7 @@ edit_cmd(void) { ProgramName); exit(ERROR_EXIT); } - execlp(_PATH_BSHELL, _PATH_BSHELL, "-c", q, NULL); + execlp(_PATH_BSHELL, _PATH_BSHELL, "-c", q, (char *)NULL); perror(editor); exit(ERROR_EXIT); /*NOTREACHED*/ diff --git a/usr.sbin/httpd/src/main/http_log.c b/usr.sbin/httpd/src/main/http_log.c index 409ede21ee4..def2f335036 100644 --- a/usr.sbin/httpd/src/main/http_log.c +++ b/usr.sbin/httpd/src/main/http_log.c @@ -187,7 +187,7 @@ static int error_log_child(void *cmd, child_info *pinfo) child_pid = spawnl(P_NOWAIT, SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, NULL); return(child_pid); #else - execl(SHELL_PATH, SHELL_PATH, "-c", (char *)cmd, NULL); + execl(SHELL_PATH, SHELL_PATH, "-c", (char *)cmd, (char *)NULL); #endif exit(1); /* NOT REACHED */ @@ -623,7 +623,7 @@ static int piped_log_spawn(piped_log *pl) ap_cleanup_for_exec(); signal(SIGCHLD, SIG_DFL); /* for HPUX */ signal(SIGHUP, SIG_IGN); - execl(SHELL_PATH, SHELL_PATH, "-c", pl->program, NULL); + execl(SHELL_PATH, SHELL_PATH, "-c", pl->program, (char *)NULL); fprintf(stderr, "piped_log_spawn: unable to exec %s -c '%s': %s\n", SHELL_PATH, pl->program, strerror (errno)); @@ -772,7 +772,7 @@ static int piped_log_child(void *cmd, child_info *pinfo) child_pid = spawnl(P_NOWAIT, SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, NULL); return(child_pid); #else - execl (SHELL_PATH, SHELL_PATH, "-c", (char *)cmd, NULL); + execl (SHELL_PATH, SHELL_PATH, "-c", (char *)cmd, (char *)NULL); #endif perror("exec"); fprintf(stderr, "Exec of shell for logging failed!!!\n"); diff --git a/usr.sbin/httpd/src/main/util_script.c b/usr.sbin/httpd/src/main/util_script.c index 6474a501b8b..ce214a05fe7 100644 --- a/usr.sbin/httpd/src/main/util_script.c +++ b/usr.sbin/httpd/src/main/util_script.c @@ -1252,12 +1252,12 @@ API_EXPORT(int) ap_call_exec(request_rec *r, child_info *pinfo, char *argv0, if (shellcmd) { execle(SUEXEC_BIN, SUEXEC_BIN, execuser, grpname, argv0, - NULL, env); + (char *)NULL, env); } else if ((!r->args) || (!r->args[0]) || strchr(r->args, '=')) { execle(SUEXEC_BIN, SUEXEC_BIN, execuser, grpname, argv0, - NULL, env); + (char *)NULL, env); } else { @@ -1269,11 +1269,11 @@ API_EXPORT(int) ap_call_exec(request_rec *r, child_info *pinfo, char *argv0, } else { if (shellcmd) { - execle(SHELL_PATH, SHELL_PATH, "-c", argv0, NULL, env); + execle(SHELL_PATH, SHELL_PATH, "-c", argv0, (char *)NULL, env); } else if ((!r->args) || (!r->args[0]) || strchr(r->args, '=')) { - execle(r->filename, argv0, NULL, env); + execle(r->filename, argv0, (char *)NULL, env); } else { diff --git a/usr.sbin/httpd/src/modules/ssl/ssl_util.c b/usr.sbin/httpd/src/modules/ssl/ssl_util.c index af4a9672f25..2fefbb45037 100644 --- a/usr.sbin/httpd/src/modules/ssl/ssl_util.c +++ b/usr.sbin/httpd/src/modules/ssl/ssl_util.c @@ -258,7 +258,7 @@ int ssl_util_ppopen_child(void *cmd, child_info *pinfo) spawnl(P_NOWAIT, SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, NULL); #else /* Standard Unix */ - execl(SHELL_PATH, SHELL_PATH, "-c", (char *)cmd, NULL); + execl(SHELL_PATH, SHELL_PATH, "-c", (char *)cmd, (char *)NULL); #endif return (child_pid); } diff --git a/usr.sbin/httpd/src/modules/standard/mod_rewrite.c b/usr.sbin/httpd/src/modules/standard/mod_rewrite.c index 229771bb801..993b7b64960 100644 --- a/usr.sbin/httpd/src/modules/standard/mod_rewrite.c +++ b/usr.sbin/httpd/src/modules/standard/mod_rewrite.c @@ -3377,10 +3377,10 @@ static int rewritemap_program_child(void *cmd, child_info *pinfo) // Need something here!!! Spawn???? #elif defined(OS2) /* IBM OS/2 */ - execl(SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, NULL); + execl(SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, (char *)NULL); #else /* Standard Unix */ - execl(SHELL_PATH, SHELL_PATH, "-c", (char *)cmd, NULL); + execl(SHELL_PATH, SHELL_PATH, "-c", (char *)cmd, (char *)NULL); #endif return(child_pid); } diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c index 6b1b63d4d15..046e08d5b43 100644 --- a/usr.sbin/lpr/lpd/printjob.c +++ b/usr.sbin/lpr/lpd/printjob.c @@ -1,4 +1,4 @@ -/* $OpenBSD: printjob.c,v 1.22 2001/06/22 15:27:20 lebel Exp $ */ +/* $OpenBSD: printjob.c,v 1.23 2001/07/09 07:05:02 deraadt Exp $ */ /* $NetBSD: printjob.c,v 1.9.4.3 1996/07/12 22:31:39 jtc Exp $ */ /* @@ -569,7 +569,7 @@ print(format, file) for (n = 3, nofile = sysconf(_SC_OPEN_MAX); n < nofile; n++) (void) close(n); execl(_PATH_PR, "pr", width, length, - "-h", *title ? title : " ", 0); + "-h", *title ? title : " ", (char *)NULL); syslog(LOG_ERR, "cannot execl %s", _PATH_PR); exit(2); } @@ -1052,7 +1052,7 @@ sendmail(user, bombed) cp++; else cp = _PATH_SENDMAIL; - execl(_PATH_SENDMAIL, cp, "-t", 0); + execl(_PATH_SENDMAIL, cp, "-t", (char *)NULL); exit(0); } else if (s > 0) { /* parent */ dup2(p[1], 1); @@ -1288,7 +1288,7 @@ openpr() cp = OF; else cp++; - execl(OF, cp, width, length, 0); + execl(OF, cp, width, length, (char *)NULL); syslog(LOG_ERR, "%s: %s: %m", printer, OF); exit(1); } diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c index cf4f754236a..21848a7a64e 100644 --- a/usr.sbin/pkg_install/lib/file.c +++ b/usr.sbin/pkg_install/lib/file.c @@ -1,7 +1,7 @@ -/* $OpenBSD: file.c,v 1.14 2001/04/08 16:45:47 espie Exp $ */ +/* $OpenBSD: file.c,v 1.15 2001/07/09 07:05:03 deraadt Exp $ */ #ifndef lint -static const char *rcsid = "$OpenBSD: file.c,v 1.14 2001/04/08 16:45:47 espie Exp $"; +static const char *rcsid = "$OpenBSD: file.c,v 1.15 2001/07/09 07:05:03 deraadt Exp $"; #endif /* @@ -87,7 +87,7 @@ ftpGetURL(char *url, int *retcode) close(p[1]); fprintf(stderr, ">>> ftp -o - %s\n",url); - execl("/usr/bin/ftp","ftp","-V","-o","-",url,NULL); + execl("/usr/bin/ftp","ftp","-V","-o","-",url,(char *)NULL); exit(1); } else { /* parent */ @@ -342,7 +342,7 @@ fileGetURL(char *base, char *spec) tpid = fork(); if (!tpid) { dup2(fileno(ftp), 0); - i = execl("/bin/tar", "tar", Verbose ? "-xpzvf" : "-xpzf", "-", 0); + i = execl("/bin/tar", "tar", Verbose ? "-xpzvf" : "-xpzf", "-", (char *)NULL); exit(i); } else { diff --git a/usr.sbin/ppp/ppp/command.c b/usr.sbin/ppp/ppp/command.c index 50a5da493b4..dafdd2c8628 100644 --- a/usr.sbin/ppp/ppp/command.c +++ b/usr.sbin/ppp/ppp/command.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: command.c,v 1.63 2001/07/09 00:08:54 brian Exp $ + * $OpenBSD: command.c,v 1.64 2001/07/09 07:05:03 deraadt Exp $ */ #include <sys/param.h> @@ -558,7 +558,7 @@ ShellCommand(struct cmdargs const *arg, int bg) if (arg->prompt) printf("ppp: Pausing until %s finishes\n", shell); prompt_TtyOldMode(arg->prompt); - execl(shell, shell, NULL); + execl(shell, shell, (char *)NULL); } log_Printf(LogWARN, "exec() of %s failed: %s\n", diff --git a/usr.sbin/pppoe/common.c b/usr.sbin/pppoe/common.c index d49ab6ef516..0de402e942f 100644 --- a/usr.sbin/pppoe/common.c +++ b/usr.sbin/pppoe/common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: common.c,v 1.4 2001/04/24 05:04:51 jason Exp $ */ +/* $OpenBSD: common.c,v 1.5 2001/07/09 07:05:04 deraadt Exp $ */ /* * Copyright (c) 2000 Network Security Technologies, Inc. http://www.netsec.net @@ -116,7 +116,7 @@ runppp(bpffd, sysname) if (closeit) close(fds); - execlp(PPP_PROG, "ppp", "-direct", sysname, NULL); + execlp(PPP_PROG, "ppp", "-direct", sysname, (char *)NULL); perror("execlp"); syslog(LOG_INFO, "%s exec failed: %m", PPP_PROG); _exit(1); diff --git a/usr.sbin/ypserv/ypserv/ypserv_proc.c b/usr.sbin/ypserv/ypserv/ypserv_proc.c index b72f44ce0d0..806c538d431 100644 --- a/usr.sbin/ypserv/ypserv/ypserv_proc.c +++ b/usr.sbin/ypserv/ypserv/ypserv_proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypserv_proc.c,v 1.15 1998/01/08 22:36:48 maja Exp $ */ +/* $OpenBSD: ypserv_proc.c,v 1.16 2001/07/09 07:05:06 deraadt Exp $ */ /* * Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se> @@ -32,7 +32,7 @@ */ #ifndef LINT -static char rcsid[] = "$OpenBSD: ypserv_proc.c,v 1.15 1998/01/08 22:36:48 maja Exp $"; +static char rcsid[] = "$OpenBSD: ypserv_proc.c,v 1.16 2001/07/09 07:05:06 deraadt Exp $"; #endif #include <rpc/rpc.h> @@ -311,7 +311,7 @@ ypproc_xfr_2_svc(argp, rqstp) } if (pid == 0) { execl(ypxfr_proc, "ypxfr", "-d", argp->map_parms.domain, - "-C",tid, prog, ipadd, port, argp->map_parms.map, NULL); + "-C",tid, prog, ipadd, port, argp->map_parms.map, (char *)NULL); _exit(1); } @@ -932,7 +932,7 @@ bail: } if (pid == 0) { execl(yppush_proc, "yppush", "-d", argp->yppush_req_domain, - argp->yppush_req_map, NULL); + argp->yppush_req_map, (char *)NULL); _exit(1); } @@ -980,7 +980,7 @@ bail: } if (pid == 0) { execl(ypxfr_proc, "ypxfr", "-d", argp->yppull_req_domain, - argp->yppull_req_map, NULL); + argp->yppull_req_map, (char *)NULL); _exit(1); } @@ -1030,7 +1030,7 @@ bail: } if (pid == 0) { execl(ypxfr_proc, "ypxfr", "-d", argp->ypget_req_domain, "-h", - argp->ypget_req_owner, argp->yppush_req_map, NULL); + argp->ypget_req_owner, argp->yppush_req_map, (char *)NULL); _exit(1); } |