From 99b82bb76a54abea9a9c36de152579f5f6a64f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Wed, 8 May 2002 00:47:01 +0000 Subject: [PATCH] Use rather than "pathnames.h", and fix a couple of whitespace nits. Sponsored by: DARPA, NAI Labs --- bin/rcp/pathnames.h | 42 ------------------------------------- bin/rcp/rcp.c | 13 +++++++++--- libexec/rlogind/pathnames.h | 40 ----------------------------------- libexec/rlogind/rlogind.c | 13 +++++++++--- usr.bin/rlogin/Makefile | 1 - usr.bin/rlogin/rlogin.c | 10 +++++++-- usr.bin/rsh/Makefile | 3 +-- usr.bin/rsh/pathnames.h | 36 ------------------------------- usr.bin/rsh/rsh.c | 13 ++++++++---- 9 files changed, 38 insertions(+), 133 deletions(-) delete mode 100644 bin/rcp/pathnames.h delete mode 100644 libexec/rlogind/pathnames.h delete mode 100644 usr.bin/rsh/pathnames.h diff --git a/bin/rcp/pathnames.h b/bin/rcp/pathnames.h deleted file mode 100644 index b1f0ec083179..000000000000 --- a/bin/rcp/pathnames.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 - * $FreeBSD$ - */ - -#include - -#define _PATH_CP "/bin/cp" -#define _PATH_RCP "/bin/rcp" -#define _PATH_RLOGIN "/usr/bin/rlogin" -#define _PATH_RSH "/usr/bin/rsh" diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c index 3cc6ceb86e02..8f0a01d4c62c 100644 --- a/bin/rcp/rcp.c +++ b/bin/rcp/rcp.c @@ -1,6 +1,13 @@ /* * Copyright (c) 1983, 1990, 1992, 1993 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * Portions of this software were developed for the FreeBSD Project by + * ThinkSec AS and NAI Labs, the Security Research Division of Network + * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 + * ("CBOSS"), as part of the DARPA CHATS research program. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -61,6 +68,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -69,7 +77,6 @@ static const char rcsid[] = #include #include -#include "pathnames.h" #include "extern.h" #ifdef KERBEROS @@ -80,7 +87,7 @@ static const char rcsid[] = char dst_realm_buf[REALM_SZ]; char *dest_realm = NULL; int use_kerberos = 1; -CREDENTIALS cred; +CREDENTIALS cred; Key_schedule schedule; extern char *krb_realmofhost(); #ifdef CRYPT @@ -429,7 +436,7 @@ source(int argc, char *argv[]) char *last, *name, buf[BUFSIZ]; for (indx = 0; indx < argc; ++indx) { - name = argv[indx]; + name = argv[indx]; if ((fd = open(name, O_RDONLY, 0)) < 0) goto syserr; if (fstat(fd, &stb)) { diff --git a/libexec/rlogind/pathnames.h b/libexec/rlogind/pathnames.h deleted file mode 100644 index 17a8f5cf5341..000000000000 --- a/libexec/rlogind/pathnames.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)pathnames.h 8.1 (Berkeley) 6/4/93 - * $FreeBSD$ - */ - -#include - -#define _PATH_LOGIN "/usr/bin/login" -#define _PATH_RLOGIN "/usr/bin/rlogin" diff --git a/libexec/rlogind/rlogind.c b/libexec/rlogind/rlogind.c index 20db3f1b3077..cdc62a6b5187 100644 --- a/libexec/rlogind/rlogind.c +++ b/libexec/rlogind/rlogind.c @@ -1,6 +1,13 @@ /*- * Copyright (c) 1983, 1988, 1989, 1993 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * Portions of this software were developed for the FreeBSD Project by + * ThinkSec AS and NAI Labs, the Security Research Division of Network + * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 + * ("CBOSS"), as part of the DARPA CHATS research program. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -72,13 +79,13 @@ static const char rcsid[] = #include #include +#include #include #include #include #include #include #include -#include "pathnames.h" #ifndef TIOCPKT_WINDOW @@ -177,7 +184,7 @@ main(int argc, char *argv[]) if (no_delay && setsockopt(0, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) < 0) syslog(LOG_WARNING, "setsockopt (TCP_NODELAY): %m"); - if (from.su_family == AF_INET) + if (from.su_family == AF_INET) { on = IPTOS_LOWDELAY; if (setsockopt(0, IPPROTO_IP, IP_TOS, (char *)&on, sizeof(int)) < 0) @@ -238,7 +245,7 @@ doit(int f, union sockunion *fromp) } #ifdef IP_OPTIONS if (fromp->su_family == AF_INET) - { + { u_char optbuf[BUFSIZ/3]; int optsize = sizeof(optbuf), ipproto, i; struct protoent *ip; diff --git a/usr.bin/rlogin/Makefile b/usr.bin/rlogin/Makefile index 42f0d3ef39c1..42d4b813ed84 100644 --- a/usr.bin/rlogin/Makefile +++ b/usr.bin/rlogin/Makefile @@ -3,7 +3,6 @@ PROG= rlogin SRCS= rlogin.c -CFLAGS+=-I${.CURDIR}/../../libexec/rlogind BINOWN= root BINMODE=4555 diff --git a/usr.bin/rlogin/rlogin.c b/usr.bin/rlogin/rlogin.c index f5c312b2620a..10f07a2cede7 100644 --- a/usr.bin/rlogin/rlogin.c +++ b/usr.bin/rlogin/rlogin.c @@ -1,6 +1,13 @@ /* * Copyright (c) 1983, 1990, 1993 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * Portions of this software were developed for the FreeBSD Project by + * ThinkSec AS and NAI Labs, the Security Research Division of Network + * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 + * ("CBOSS"), as part of the DARPA CHATS research program. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -76,7 +83,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "../../bin/rcp/pathnames.h" #include "krb.h" CREDENTIALS cred; @@ -140,7 +146,7 @@ main(int argc, char *argv[]) #ifdef KERBEROS char *k; #endif - struct sockaddr_storage ss; + struct sockaddr_storage ss; int sslen; argoff = dflag = Dflag = 0; diff --git a/usr.bin/rsh/Makefile b/usr.bin/rsh/Makefile index 87691870e70c..844c1f225b13 100644 --- a/usr.bin/rsh/Makefile +++ b/usr.bin/rsh/Makefile @@ -7,8 +7,7 @@ CFLAGS+=-I${.CURDIR}/../../libexec/rlogind .if defined(MAKE_KERBEROS4) && !defined(NO_OPENSSL) && !defined(NOCRYPT) SRCS+= krcmd.c kcmd.c rcmd_util.c -CFLAGS+=-DKERBEROS -DCRYPT -DHAVE_CONFIG_H \ - -I${.CURDIR}/../rlogin -I${.CURDIR} -I- \ +CFLAGS+=-DKERBEROS -DCRYPT -DHAVE_CONFIG_H -I- \ -I${.CURDIR}/../../kerberosIV/include \ -I${.CURDIR}/../../crypto/kerberosIV/include \ -I${.CURDIR}/../../crypto/kerberosIV/lib/roken \ diff --git a/usr.bin/rsh/pathnames.h b/usr.bin/rsh/pathnames.h deleted file mode 100644 index 16753c8fd62c..000000000000 --- a/usr.bin/rsh/pathnames.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)pathnames.h 8.1 (Berkeley) 6/6/93 - */ - -#define _PATH_RLOGIN "/usr/bin/rlogin" diff --git a/usr.bin/rsh/rsh.c b/usr.bin/rsh/rsh.c index 44a4e953f78a..394a19b96e36 100644 --- a/usr.bin/rsh/rsh.c +++ b/usr.bin/rsh/rsh.c @@ -1,6 +1,13 @@ /*- * Copyright (c) 1983, 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2002 Networks Associates Technology, Inc. + * All rights reserved. + * + * Portions of this software were developed for the FreeBSD Project by + * ThinkSec AS and NAI Labs, the Security Research Division of Network + * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 + * ("CBOSS"), as part of the DARPA CHATS research program. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -65,8 +73,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "pathnames.h" - #ifdef KERBEROS #include #include @@ -313,7 +319,7 @@ main(int argc, char *argv[]) if (pid < 0) err(1, "fork"); } - else + else (void)shutdown(rem, 1); #ifdef KERBEROS @@ -497,4 +503,3 @@ usage(void) #endif exit(1); } -