From 88c38b1d8caad1c581d0267e761e1ebf09dd63a9 Mon Sep 17 00:00:00 2001 From: mrg Date: Tue, 27 May 1997 08:35:25 +0000 Subject: [PATCH] enable rcmd(). garbage collect. --- sbin/dump/Makefile | 5 ++--- sbin/dump/dumprmt.c | 18 +++--------------- sbin/dump/main.c | 11 ++--------- 3 files changed, 7 insertions(+), 27 deletions(-) diff --git a/sbin/dump/Makefile b/sbin/dump/Makefile index d49fef2b75ac..1b4180e1f00b 100644 --- a/sbin/dump/Makefile +++ b/sbin/dump/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.16 1995/03/18 14:54:53 cgd Exp $ +# $NetBSD: Makefile,v 1.17 1997/05/27 08:35:25 mrg Exp $ # @(#)Makefile 8.1 (Berkeley) 6/5/93 # dump.h header file @@ -17,9 +17,8 @@ PROG= dump LINKS= ${BINDIR}/dump ${BINDIR}/rdump CFLAGS+=-DRDUMP SRCS= itime.c main.c optr.c dumprmt.c tape.c traverse.c unctime.c -BINOWN= root BINGRP= tty -BINMODE=6555 +BINMODE=2555 MAN= dump.8 MLINKS+=dump.8 rdump.8 diff --git a/sbin/dump/dumprmt.c b/sbin/dump/dumprmt.c index d26c1f9d618b..c3ef93fee039 100644 --- a/sbin/dump/dumprmt.c +++ b/sbin/dump/dumprmt.c @@ -1,4 +1,4 @@ -/* $NetBSD: dumprmt.c,v 1.14 1997/05/26 15:18:25 mrg Exp $ */ +/* $NetBSD: dumprmt.c,v 1.15 1997/05/27 08:35:27 mrg Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)dumprmt.c 8.1 (Berkeley) 6/5/93"; #else -static char rcsid[] = "$NetBSD: dumprmt.c,v 1.14 1997/05/26 15:18:25 mrg Exp $"; +static char rcsid[] = "$NetBSD: dumprmt.c,v 1.15 1997/05/27 08:35:27 mrg Exp $"; #endif #endif /* not lint */ @@ -129,7 +129,6 @@ rmtgetconn() #endif char *tuser; int size; - int throughput; if (sp == NULL) { sp = getservbyname("shell", "tcp"); @@ -148,10 +147,8 @@ rmtgetconn() } else tuser = pwd->pw_name; - (void) seteuid(euid); - rmtape = orcmd(&rmtpeer, (u_short)sp->s_port, pwd->pw_name, tuser, + rmtape = rcmd(&rmtpeer, (u_short)sp->s_port, pwd->pw_name, tuser, _PATH_RMT, (int *)0); - (void) setuid(uid); /* Just to be Really Really safe */ if (rmtape < 0) return; @@ -164,15 +161,6 @@ rmtgetconn() setsockopt(rmtape, SOL_SOCKET, SO_SNDBUF, &size, sizeof (size)) < 0) size -= TP_BSIZE; (void)setsockopt(rmtape, SOL_SOCKET, SO_RCVBUF, &size, sizeof (size)); - throughput = IPTOS_THROUGHPUT; - if (setsockopt(rmtape, IPPROTO_IP, IP_TOS, - &throughput, sizeof(throughput)) < 0) - perror("IP_TOS:IPTOS_THROUGHPUT setsockopt"); - -#ifdef notdef - if (setsockopt(rmtape, IPPROTO_TCP, TCP_NODELAY, &on, sizeof (on)) < 0) - perror("TCP_NODELAY setsockopt"); -#endif } static int diff --git a/sbin/dump/main.c b/sbin/dump/main.c index ee3d00f792e3..903456c15e50 100644 --- a/sbin/dump/main.c +++ b/sbin/dump/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.12 1997/04/21 11:31:16 mrg Exp $ */ +/* $NetBSD: main.c,v 1.13 1997/05/27 08:35:28 mrg Exp $ */ /*- * Copyright (c) 1980, 1991, 1993, 1994 @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 4/15/94"; #else -static char rcsid[] = "$NetBSD: main.c,v 1.12 1997/04/21 11:31:16 mrg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.13 1997/05/27 08:35:28 mrg Exp $"; #endif #endif /* not lint */ @@ -89,8 +89,6 @@ int cartridge = 0; /* Assume non-cartridge tape */ long dev_bsize = 1; /* recalculated below */ long blocksperfile; /* output blocks per file */ char *host = NULL; /* remote host (if any) */ -uid_t uid; /* real uid */ -uid_t euid; /* effective uid */ static long numarg __P((char *, long, long)); static void obsolete __P((int *, char **[])); @@ -111,10 +109,6 @@ main(argc, argv) ino_t maxino; time_t tnow; - uid = getuid(); - euid = geteuid(); - (void) seteuid(uid); - spcl.c_date = 0; (void)time((time_t *)&spcl.c_date); @@ -253,7 +247,6 @@ main(argc, argv) exit(X_ABORT); #endif } - (void) setuid(uid); /* rmthost() is the only reason to be setuid */ if (signal(SIGHUP, SIG_IGN) != SIG_IGN) signal(SIGHUP, sig);