From 5dd823ab5d3a4115f960bc5ddf9207e1f1ff93fa Mon Sep 17 00:00:00 2001 From: mycroft Date: Sun, 26 Jul 1998 19:44:12 +0000 Subject: [PATCH] const poisoning. --- bin/sh/expand.c | 6 +++--- libexec/identd/parse.c | 10 +++++----- libexec/mail.local/mail.local.c | 10 +++++----- libexec/rexecd/rexecd.c | 7 ++++--- libexec/rshd/rshd.c | 7 ++++--- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/bin/sh/expand.c b/bin/sh/expand.c index 98d6638c625e..4a1b4fd34773 100644 --- a/bin/sh/expand.c +++ b/bin/sh/expand.c @@ -1,4 +1,4 @@ -/* $NetBSD: expand.c,v 1.39 1998/03/29 04:41:44 mrg Exp $ */ +/* $NetBSD: expand.c,v 1.40 1998/07/26 19:44:12 mycroft Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95"; #else -__RCSID("$NetBSD: expand.c,v 1.39 1998/03/29 04:41:44 mrg Exp $"); +__RCSID("$NetBSD: expand.c,v 1.40 1998/07/26 19:44:12 mycroft Exp $"); #endif #endif /* not lint */ @@ -255,7 +255,7 @@ exptilde(p, flag) { char c, *startp = p; struct passwd *pw; - char *home; + const char *home; int quotes = flag & (EXP_FULL | EXP_CASE); while ((c = *p) != '\0') { diff --git a/libexec/identd/parse.c b/libexec/identd/parse.c index 1664ec3eba54..82b99ddcb420 100644 --- a/libexec/identd/parse.c +++ b/libexec/identd/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.9 1998/07/15 07:31:57 msaitoh Exp $ */ +/* $NetBSD: parse.c,v 1.10 1998/07/26 19:47:06 mycroft Exp $ */ /* ** parse.c This file contains the protocol parser @@ -50,7 +50,7 @@ extern int errno; #include "error.h" static int eat_whitespace __P((void)); -static int check_noident __P((char *)); +static int check_noident __P((const char *)); static int valid_fhost(struct in_addr *, char *); /* @@ -132,7 +132,7 @@ static int valid_fhost(faddr, password) ** file in a users home directory. */ static int check_noident(homedir) - char *homedir; + const char *homedir; { char *tmp_path; struct stat sbuf; @@ -629,8 +629,8 @@ int parse(fp, laddr, faddr) #ifdef ALLOW_FORMAT if (format_flag) { - char* cp; - char** gmp; + char *cp; + const char *const *gmp; int bp; char buff[512]; for (cp = format, bp = 0; *cp != 0; cp++) diff --git a/libexec/mail.local/mail.local.c b/libexec/mail.local/mail.local.c index d2626912b5b7..19577354be8b 100644 --- a/libexec/mail.local/mail.local.c +++ b/libexec/mail.local/mail.local.c @@ -1,4 +1,4 @@ -/* $NetBSD: mail.local.c,v 1.14 1997/10/08 01:03:00 enami Exp $ */ +/* $NetBSD: mail.local.c,v 1.15 1998/07/26 19:48:10 mycroft Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)mail.local.c 8.22 (Berkeley) 6/21/95"; #else -__RCSID("$NetBSD: mail.local.c,v 1.14 1997/10/08 01:03:00 enami Exp $"); +__RCSID("$NetBSD: mail.local.c,v 1.15 1998/07/26 19:48:10 mycroft Exp $"); #endif #endif /* not lint */ @@ -69,7 +69,7 @@ __RCSID("$NetBSD: mail.local.c,v 1.14 1997/10/08 01:03:00 enami Exp $"); int deliver __P((int, char *, int)); void err __P((int, const char *, ...)); void notifybiff __P((char *)); -int store __P((char *)); +int store __P((const char *)); void usage __P((void)); int main __P((int, char **)); @@ -81,7 +81,7 @@ main(argc, argv) struct passwd *pw; int ch, fd, eval, lockfile = 0; uid_t uid; - char *from; + const char *from; /* use a reasonable umask */ (void) umask(0077); @@ -130,7 +130,7 @@ main(argc, argv) int store(from) - char *from; + const char *from; { FILE *fp = NULL; /* XXX gcc */ time_t tval; diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c index 63f0e2003cac..1af2e71fc35d 100644 --- a/libexec/rexecd/rexecd.c +++ b/libexec/rexecd/rexecd.c @@ -1,4 +1,4 @@ -/* $NetBSD: rexecd.c,v 1.5 1998/07/04 19:03:20 mrg Exp $ */ +/* $NetBSD: rexecd.c,v 1.6 1998/07/26 19:49:03 mycroft Exp $ */ /* * Copyright (c) 1983, 1993 @@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\ #if 0 static char sccsid[] = "from: @(#)rexecd.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: rexecd.c,v 1.5 1998/07/04 19:03:20 mrg Exp $"); +__RCSID("$NetBSD: rexecd.c,v 1.6 1998/07/26 19:49:03 mycroft Exp $"); #endif #endif /* not lint */ @@ -117,7 +117,8 @@ doit(f, fromp) struct sockaddr_in *fromp; { struct pollfd fds[2]; - char cmdbuf[NCARGS+1], *cp, *namep; + char cmdbuf[NCARGS+1], *namep; + const char *cp; char user[16], pass[16]; char buf[BUFSIZ], sig; struct passwd *pwd; diff --git a/libexec/rshd/rshd.c b/libexec/rshd/rshd.c index 00e43b6854e6..b88778b614bc 100644 --- a/libexec/rshd/rshd.c +++ b/libexec/rshd/rshd.c @@ -1,4 +1,4 @@ -/* $NetBSD: rshd.c,v 1.14 1998/07/06 06:48:56 mrg Exp $ */ +/* $NetBSD: rshd.c,v 1.15 1998/07/26 19:51:21 mycroft Exp $ */ /*- * Copyright (c) 1988, 1989, 1992, 1993, 1994 @@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1992, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) 4/6/94"; #else -__RCSID("$NetBSD: rshd.c,v 1.14 1998/07/06 06:48:56 mrg Exp $"); +__RCSID("$NetBSD: rshd.c,v 1.15 1998/07/26 19:51:21 mycroft Exp $"); #endif #endif /* not lint */ @@ -165,7 +165,8 @@ doit(fromp) int cc, nfd, pv[2], pid, s = -1; /* XXX gcc */ int one = 1; char *hostname, *errorstr, *errorhost = NULL; /* XXX gcc */ - char *cp, sig, buf[BUFSIZ]; + const char *cp; + char sig, buf[BUFSIZ]; char cmdbuf[NCARGS+1], locuser[16], remuser[16]; char remotehost[2 * MAXHOSTNAMELEN + 1]; char hostnamebuf[2 * MAXHOSTNAMELEN + 1];