summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/pac
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1997-07-23 00:49:46 +0000
committerimp <imp@FreeBSD.org>1997-07-23 00:49:46 +0000
commitf080009db57e6a7b246a2ab15d8a73e4563931b4 (patch)
tree3f6c130b47ee18671302ddcfcae8cef66be97455 /usr.sbin/lpr/pac
parent5d2b7fa5ede6cefc6d4c6f7df3987bea7b9149b8 (diff)
downloadFreeBSD-src-f080009db57e6a7b246a2ab15d8a73e4563931b4.zip
FreeBSD-src-f080009db57e6a7b246a2ab15d8a73e4563931b4.tar.gz
Use setuid/seteuid around dangerous operations. Also a few buffer
overflow patches that were "near" to where these operations are taking place. The buffer overflows are from OpenBSD. The setuid/seteuid patches are from NetBSD by way of OpenBSD (they changed them a little), at least from my read of the tree. This is the first of a series of OpenBSD lpr/et al merges. It (and them) should be merged back into 2.2 and/or 2.1 (if requested) branches when they have been shaken out in -current. Obtained from: OpenBSD
Diffstat (limited to 'usr.sbin/lpr/pac')
-rw-r--r--usr.sbin/lpr/pac/pac.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.sbin/lpr/pac/pac.c b/usr.sbin/lpr/pac/pac.c
index 692f005..609d407 100644
--- a/usr.sbin/lpr/pac/pac.c
+++ b/usr.sbin/lpr/pac/pac.c
@@ -71,6 +71,8 @@ static int sort; /* Sort by cost */
static char *sumfile; /* summary file */
static int summarize; /* Compress accounting file */
+uid_t uid, euid;
+
/*
* Grossness follows:
* Names to be accumulated are hashed into the following
@@ -106,6 +108,8 @@ main(argc, argv)
register FILE *acct;
register char *cp;
+ euid = geteuid(); /* these aren't used in pac(1) */
+ uid = getuid();
while (--argc) {
cp = *++argv;
if (*cp++ == '-') {
OpenPOWER on IntegriCloud