12
13
* 2. Redistributions in binary form must reproduce the above copyright
13
14
* notice, this list of conditions and the following disclaimer in the
14
15
* documentation and/or other materials provided with the distribution.
15
* 3. All advertising materials mentioning features or use of this software
16
* must display the following acknowledgement:
17
* This product includes software developed by the University of
18
* California, Berkeley and its contributors.
19
* 4. Neither the name of the University nor the names of its contributors
16
* 3. Neither the name of the University nor the names of its contributors
20
17
* may be used to endorse or promote products derived from this software
21
18
* without specific prior written permission.
84
85
extern char line[BUFSIZ];
85
86
extern char *bp; /* pointer into printcap buffer */
86
extern char *name; /* program name */
87
87
extern char *printer; /* printer name */
88
88
/* host machine name */
89
89
extern char host[MAXHOSTNAMELEN];
90
90
extern char *from; /* client's machine name */
91
91
extern int remote; /* true if sending files to a remote host */
92
extern char *printcapdb[]; /* printcap database array */
92
extern char *printcapdb[]; /* printcap database array */
93
extern u_int wait_time; /* time to wait for remote responses */
95
extern uid_t real_uid, effective_uid;
96
extern gid_t real_gid, effective_gid;
98
extern volatile sig_atomic_t gotintr;
94
101
* Structure used for building a sorted list of control files.
98
105
char q_name[MAXNAMLEN+1]; /* control file name */
109
* Macros to raise/lower permissions.
111
#define PRIV_START do { \
112
int save_errno = errno; \
113
(void)seteuid(effective_uid); \
114
(void)setegid(effective_gid); \
115
errno = save_errno; \
118
#define PRIV_END do { \
119
int save_errno = errno; \
120
(void)setegid(real_gid); \
121
(void)seteuid(real_uid); \
122
errno = save_errno; \
101
125
#include <sys/cdefs.h>
106
void blankfill __P((int));
107
char *checkremote __P((void));
108
int chk __P((char *));
109
void displayq __P((int));
110
void dump __P((char *, char *, int));
111
void fatal __P((const char *, ...));
112
int getcfline __P((FILE *));
113
int getport __P((char *, int));
114
int getq __P((struct queue *(*[])));
115
void header __P((void));
116
void inform __P((char *));
117
int inlist __P((char *, char *));
118
int iscf __P((const struct dirent *));
119
int isowner __P((char *, char *));
120
void ldump __P((char *, char *, int));
121
int lockchk __P((char *));
122
void prank __P((int));
123
void process __P((char *));
124
void rmjob __P((void));
125
void rmremote __P((void));
126
void show __P((char *, char *, int));
127
int startdaemon __P((char *));
128
void warn __P((void));
129
void delay __P((int));
131
char *cgetcap __P((char *, const char *, int));
132
int cgetent __P((char **, char **, const char *));
133
int cgetmatch __P((char *, const char *));
134
int cgetnext __P((char **, char **));
135
int cgetstr __P((char *, const char *, char **));
136
int cgetunum __P((char *, const char *, long *));
131
char *checkremote(void);
134
void dump(char *, char *, int);
135
void fatal(const char *, ...)
136
__attribute__((__format__(__printf__, 1, 2)));
137
int getcfline(FILE *);
138
int getport(char *, int);
139
int getq(struct queue ***);
141
int inlist(char *, char *);
142
int iscf(const struct dirent *);
143
int isowner(char *, char *);
144
void ldump(char *, char *, int);
146
void process(char *);
149
void show(char *, char *, int);
150
int startdaemon(char *);
153
int safe_open(const char *, int, mode_t);
155
char *cgetcap (char *, const char *, int);
156
int cgetent (char **, char **, const char *);
157
int cgetmatch (char *, const char *);
158
int cgetnext (char **, char **);
159
int cgetstr (char *, const char *, char **);
160
int cgetunum (char *, const char *, long *);
161
int cgetnum(char *, const char *, long *);
163
size_t strlcpy(char *dst, const char *src, size_t siz);
164
size_t strlcat(char *dst, const char *src, size_t siz);