From a35353de88d75b241f455719b98a1ac4bbd9baf3 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Sun, 6 Nov 2011 20:30:21 +0000 Subject: [PATCH] Partially revert r227233. The privs.h header is not only used by at(1), it's also used by atrun(8). Just let the code the way it used to be (for now). Reported by: kwm, tinderbox Hat to: me --- usr.bin/at/at.c | 4 ++-- usr.bin/at/privs.h | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c index 283965ea068..cb2fadb9741 100644 --- a/usr.bin/at/at.c +++ b/usr.bin/at/at.c @@ -63,6 +63,8 @@ __FBSDID("$FreeBSD$"); #include "panic.h" #include "parsetime.h" #include "perm.h" + +#define MAIN #include "privs.h" /* Macros */ @@ -102,8 +104,6 @@ int fcreated; char atfile[] = ATJOB_DIR "12345678901234"; char atverify = 0; /* verify time instead of queuing job */ char *namep; -uid_t real_uid, effective_uid; -gid_t real_gid, effective_gid; /* Function declarations */ diff --git a/usr.bin/at/privs.h b/usr.bin/at/privs.h index c84f277507d..50dd6b108af 100644 --- a/usr.bin/at/privs.h +++ b/usr.bin/at/privs.h @@ -59,8 +59,15 @@ * to the real userid before calling any of them. */ -extern uid_t real_uid, effective_uid; -extern gid_t real_gid, effective_gid; +#ifndef MAIN +extern +#endif +uid_t real_uid, effective_uid; + +#ifndef MAIN +extern +#endif +gid_t real_gid, effective_gid; #define RELINQUISH_PRIVS { \ real_uid = getuid(); \