From f37be23211cb7a07566cbbb86cf2fcff9c717139 Mon Sep 17 00:00:00 2001 From: mrg Date: Tue, 7 Oct 1997 10:37:30 +0000 Subject: [PATCH] WARNS?=1 --- libexec/rshd/Makefile | 3 ++- libexec/rshd/rshd.8 | 3 ++- libexec/rshd/rshd.c | 30 ++++++++++++++++++------------ 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/libexec/rshd/Makefile b/libexec/rshd/Makefile index 894b1e845e30..b32cda4eefd2 100644 --- a/libexec/rshd/Makefile +++ b/libexec/rshd/Makefile @@ -1,6 +1,7 @@ +# $NetBSD: Makefile,v 1.7 1997/10/07 10:37:30 mrg Exp $ # from: @(#)Makefile 8.1 (Berkeley) 6/4/93 -# $Id: Makefile,v 1.6 1994/12/22 10:28:04 cgd Exp $ +WARNS?= 1 PROG= rshd MAN= rshd.8 diff --git a/libexec/rshd/rshd.8 b/libexec/rshd/rshd.8 index f5e4738f6a93..fc1e8b46a234 100644 --- a/libexec/rshd/rshd.8 +++ b/libexec/rshd/rshd.8 @@ -1,3 +1,5 @@ +.\" $NetBSD: rshd.8,v 1.5 1997/10/07 10:37:32 mrg Exp $ +.\" .\" Copyright (c) 1983, 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -30,7 +32,6 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)rshd.8 8.1 (Berkeley) 6/4/93 -.\" $Id: rshd.8,v 1.4 1994/06/05 15:33:23 cgd Exp $ .\" .Dd June 4, 1993 .Dt RSHD 8 diff --git a/libexec/rshd/rshd.c b/libexec/rshd/rshd.c index 06054cabffcf..b708c7a7dea8 100644 --- a/libexec/rshd/rshd.c +++ b/libexec/rshd/rshd.c @@ -1,3 +1,5 @@ +/* $NetBSD: rshd.c,v 1.10 1997/10/07 10:37:33 mrg Exp $ */ + /*- * Copyright (c) 1988, 1989, 1992, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -31,15 +33,15 @@ * SUCH DAMAGE. */ +#include #ifndef lint -static char copyright[] = -"@(#) Copyright (c) 1988, 1989, 1992, 1993, 1994\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -/* from: static char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) 4/6/94"; */ -static char *rcsid = "$Id: rshd.c,v 1.9 1995/01/20 18:48:50 christos Exp $"; +__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1992, 1993, 1994\n\ + The Regents of the University of California. All rights reserved.\n"); +#if 0 +static char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) 4/6/94"; +#else +__RCSID("$NetBSD: rshd.c,v 1.10 1997/10/07 10:37:33 mrg Exp $"); +#endif #endif /* not lint */ /* @@ -81,6 +83,7 @@ void getstr __P((char *, int, char *)); int local_domain __P((char *)); char *topdomain __P((char *)); void usage __P((void)); +int main __P((int, char *[])); #define OPTIONS "alnL" @@ -137,6 +140,9 @@ main(argc, argv) syslog(LOG_WARNING, "setsockopt (SO_LINGER): %m"); doit(&from); /* NOTREACHED */ +#ifdef __GNUC__ + exit(0); +#endif } char username[20] = "USER="; @@ -156,9 +162,9 @@ doit(fromp) struct passwd *pwd; u_short port; fd_set ready, readfrom; - int cc, nfd, pv[2], pid, s; + int cc, nfd, pv[2], pid, s = -1; /* XXX gcc */ int one = 1; - char *hostname, *errorstr, *errorhost; + char *hostname, *errorstr, *errorhost = NULL; /* XXX gcc */ char *cp, sig, buf[BUFSIZ]; char cmdbuf[NCARGS+1], locuser[16], remuser[16]; char remotehost[2 * MAXHOSTNAMELEN + 1]; @@ -337,9 +343,9 @@ doit(fromp) if (errorstr || - pwd->pw_passwd != 0 && *pwd->pw_passwd != '\0' && + (pwd->pw_passwd != 0 && *pwd->pw_passwd != '\0' && iruserok(fromp->sin_addr.s_addr, pwd->pw_uid == 0, - remuser, locuser) < 0) { + remuser, locuser) < 0)) { if (__rcmd_errstr) syslog(LOG_INFO|LOG_AUTH, "%s@%s as %s: permission denied (%s). cmd='%.80s'",