-# $OpenBSD: Makefile,v 1.2 1996/06/23 14:30:09 deraadt Exp $
+# $OpenBSD: Makefile,v 1.3 1996/09/01 15:31:01 deraadt Exp $
# $NetBSD: Makefile,v 1.16 1995/03/18 14:54:53 cgd Exp $
# dump.h header file
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
-/* $OpenBSD: dumprmt.c,v 1.3 1996/08/06 17:02:06 deraadt Exp $ */
+/* $OpenBSD: dumprmt.c,v 1.4 1996/09/01 15:31:02 deraadt Exp $ */
/* $NetBSD: dumprmt.c,v 1.10 1996/03/15 22:39:26 scottr Exp $ */
/*-
static int rmtreply __P((char *));
extern int ntrec; /* blocking factor on tape */
-extern uid_t uid; /* real uid */
-extern uid_t euid; /* effective uid */
int
rmthost(host)
} else
tuser = pwd->pw_name;
- (void) seteuid(euid);
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 */
size = ntrec * TP_BSIZE;
if (size > 60 * 1024) /* XXX */
-/* $OpenBSD: main.c,v 1.7 1996/08/10 22:26:47 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.8 1996/09/01 15:31:02 deraadt Exp $ */
/* $NetBSD: main.c,v 1.8 1996/03/15 22:39:32 scottr Exp $ */
/*-
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 */
+gid_t gid, egid; /* real, effective gid */
static long numarg __P((char *, long, long));
static void obsolete __P((int *, char **[]));
int i, anydirskipped, bflag = 0, Tflag = 0, honorlevel = 1;
ino_t maxino;
- uid = getuid();
- euid = geteuid();
- (void) seteuid(uid);
+ gid = getgid();
+ egid = getegid();
+ setegid(gid);
spcl.c_date = 0;
(void)time((time_t *)&spcl.c_date);
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);
-/* $OpenBSD: optr.c,v 1.8 1996/09/01 15:30:18 deraadt Exp $ */
+/* $OpenBSD: optr.c,v 1.9 1996/09/01 15:31:03 deraadt Exp $ */
/* $NetBSD: optr.c,v 1.4 1996/05/18 16:16:17 jtk Exp $ */
/*-
#if 0
static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94";
#else
-static char rcsid[] = "$OpenBSD: optr.c,v 1.8 1996/09/01 15:30:18 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: optr.c,v 1.9 1996/09/01 15:31:03 deraadt Exp $";
#endif
#endif /* not lint */
int datesort __P((const void *, const void *));
static void sendmes __P((char *, char *));
+extern gid_t gid, egid;
+
/*
* Query the operator; This previously-fascist piece of code
* no longer requires an exact response.
(void) strcpy(t, _PATH_DEV);
(void) strncat(t, tty, sizeof t - strlen(_PATH_DEV));
+ setegid(egid);
if ((f_tty = fopen(t, "w")) != NULL) {
setbuf(f_tty, buf);
(void) fprintf(f_tty,
}
(void) fclose(f_tty);
}
+ setegid(gid);
}
/*