diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c index c036013febbc..283965ea068d 100644 --- a/usr.bin/at/at.c +++ b/usr.bin/at/at.c @@ -63,8 +63,6 @@ __FBSDID("$FreeBSD$"); #include "panic.h" #include "parsetime.h" #include "perm.h" - -#define MAIN #include "privs.h" /* Macros */ @@ -90,22 +88,22 @@ enum { ATQ, ATRM, AT, BATCH, CAT }; /* what program we want to run */ /* File scope variables */ -const char *no_export[] = -{ +static const char *no_export[] = { "TERM", "TERMCAP", "DISPLAY", "_" -} ; +}; static int send_mail = 0; +static char *atinput = NULL; /* where to get input from */ +static char atqueue = 0; /* which queue to examine for jobs (atq) */ /* External variables */ extern char **environ; int fcreated; char atfile[] = ATJOB_DIR "12345678901234"; - -char *atinput = (char*)0; /* where to get input from */ -char atqueue = 0; /* which queue to examine for jobs (atq) */ 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/parsetime.c b/usr.bin/at/parsetime.c index 195a38d21df6..8c83bcc4f826 100644 --- a/usr.bin/at/parsetime.c +++ b/usr.bin/at/parsetime.c @@ -72,7 +72,7 @@ enum { /* symbols */ /* parse translation table - table driven parsers can be your FRIEND! */ -struct { +static const struct { const char *name; /* token name */ int value; /* token id */ int plural; /* is this plural? */ diff --git a/usr.bin/at/privs.h b/usr.bin/at/privs.h index 50dd6b108af4..c84f277507d2 100644 --- a/usr.bin/at/privs.h +++ b/usr.bin/at/privs.h @@ -59,15 +59,8 @@ * to the real userid before calling any of them. */ -#ifndef MAIN -extern -#endif -uid_t real_uid, effective_uid; - -#ifndef MAIN -extern -#endif -gid_t real_gid, effective_gid; +extern uid_t real_uid, effective_uid; +extern gid_t real_gid, effective_gid; #define RELINQUISH_PRIVS { \ real_uid = getuid(); \