Let lpr build with -Wmissing-variable-declarations.
Mark variables static where possible and place the uid/euid variables in lp.h, so that we can compile-time enforce that these variables have the same type.
This commit is contained in:
parent
1e0706fdf7
commit
6511bcb8c0
@ -70,8 +70,6 @@ __FBSDID("$FreeBSD$");
|
||||
char line[BUFSIZ];
|
||||
const char *progname; /* program name */
|
||||
|
||||
extern uid_t uid, euid;
|
||||
|
||||
static int compar(const void *_p1, const void *_p2);
|
||||
|
||||
/*
|
||||
|
@ -75,8 +75,6 @@ __FBSDID("$FreeBSD$");
|
||||
/*
|
||||
* Stuff for handling job specifications
|
||||
*/
|
||||
extern uid_t uid, euid;
|
||||
|
||||
static int col; /* column on screen */
|
||||
static char current[MAXNAMLEN+1]; /* current file being printed */
|
||||
static char file[MAXNAMLEN+1]; /* print file name */
|
||||
|
@ -252,6 +252,9 @@ typedef enum { TR_SENDING, TR_RECVING, TR_PRINTING } tr_sendrecv;
|
||||
/*
|
||||
* seteuid() macros.
|
||||
*/
|
||||
|
||||
extern uid_t uid, euid;
|
||||
|
||||
#define PRIV_START { \
|
||||
if (seteuid(euid) != 0) err(1, "seteuid failed"); \
|
||||
}
|
||||
|
@ -80,8 +80,6 @@ u_char family = PF_UNSPEC;
|
||||
u_char family = PF_INET;
|
||||
#endif
|
||||
|
||||
extern uid_t uid, euid;
|
||||
|
||||
/*
|
||||
* Create a TCP connection to host "rhost" at port "rport".
|
||||
* If rport == 0, then use the printer service port.
|
||||
|
@ -69,8 +69,6 @@ static int all = 0; /* eliminate all files (root only) */
|
||||
static int cur_daemon; /* daemon's pid */
|
||||
static char current[7+MAXHOSTNAMELEN]; /* active control file name */
|
||||
|
||||
extern uid_t uid, euid; /* real and effective user id's */
|
||||
|
||||
static void alarmhandler(int _signo);
|
||||
static void do_unlink(char *_file);
|
||||
static int isowner(char *_owner, char *_file, const char *_cfhost);
|
||||
|
@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include "lp.h"
|
||||
#include "pathnames.h"
|
||||
|
||||
extern uid_t uid, euid;
|
||||
|
||||
/*
|
||||
* Tell the printer daemon that there are new files in the spool directory.
|
||||
*/
|
||||
|
@ -60,17 +60,17 @@ __FBSDID("$FreeBSD$");
|
||||
#define MAXWIDTH 132
|
||||
#define MAXREP 10
|
||||
|
||||
char buf[MAXREP][MAXWIDTH];
|
||||
int maxcol[MAXREP] = {-1};
|
||||
int lineno;
|
||||
int width = 132; /* default line length */
|
||||
int length = 66; /* page length */
|
||||
int indent; /* indentation length */
|
||||
int npages = 1;
|
||||
int literal; /* print control characters */
|
||||
char *name; /* user's login name */
|
||||
char *host; /* user's machine name */
|
||||
char *acctfile; /* accounting information file */
|
||||
static char buf[MAXREP][MAXWIDTH];
|
||||
static int maxcol[MAXREP] = {-1};
|
||||
static int lineno;
|
||||
static int width = 132; /* default line length */
|
||||
static int length = 66; /* page length */
|
||||
static int indent; /* indentation length */
|
||||
static int npages = 1;
|
||||
static int literal; /* print control characters */
|
||||
static char *name; /* user's login name */
|
||||
static char *host; /* user's machine name */
|
||||
static char *acctfile; /* accounting information file */
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
|
Loading…
x
Reference in New Issue
Block a user