From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 17:32:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4830B1065675; Sun, 6 Nov 2011 17:32:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EDB88FC0A; Sun, 6 Nov 2011 17:32:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA6HWUCj033050; Sun, 6 Nov 2011 17:32:30 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6HWTWw033046; Sun, 6 Nov 2011 17:32:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061732.pA6HWTWw033046@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 17:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227233 - head/usr.bin/at X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 17:32:30 -0000 Author: ed Date: Sun Nov 6 17:32:29 2011 New Revision: 227233 URL: http://svn.freebsd.org/changeset/base/227233 Log: Add missing static keywords to at(1). While there, tidy up the privs.h part, where at.c has to #define to declare some globals. Also group static and non-static global variables in at.c. Modified: head/usr.bin/at/at.c head/usr.bin/at/parsetime.c head/usr.bin/at/privs.h Modified: head/usr.bin/at/at.c ============================================================================== --- head/usr.bin/at/at.c Sun Nov 6 17:31:57 2011 (r227232) +++ head/usr.bin/at/at.c Sun Nov 6 17:32:29 2011 (r227233) @@ -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 }; /* w /* 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 */ Modified: head/usr.bin/at/parsetime.c ============================================================================== --- head/usr.bin/at/parsetime.c Sun Nov 6 17:31:57 2011 (r227232) +++ head/usr.bin/at/parsetime.c Sun Nov 6 17:32:29 2011 (r227233) @@ -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? */ Modified: head/usr.bin/at/privs.h ============================================================================== --- head/usr.bin/at/privs.h Sun Nov 6 17:31:57 2011 (r227232) +++ head/usr.bin/at/privs.h Sun Nov 6 17:32:29 2011 (r227233) @@ -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(); \