~ubuntu-branches/ubuntu/hardy/lpr/hardy

« back to all changes in this revision

Viewing changes to common_source/lp.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Majer
  • Date: 2004-07-27 16:45:19 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040727164519-fjgr6gmzlkuh53zz
Tags: 1:2003.09.23-7
Remove bash specific syntax in postinst. To make sure permissions are fixed
for the new lpr, rerun permission fixups on /var/spool/lpd/*, again.
(closes: #261590)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*      $OpenBSD: lp.h,v 1.3 1997/01/17 16:11:35 millert Exp $  */
 
1
/*      $OpenBSD: lp.h,v 1.14 2003/06/02 23:36:53 millert Exp $ */
 
2
/*      $NetBSD: lp.h,v 1.14 2000/04/16 14:43:58 mrg Exp $      */
2
3
 
3
4
/*
4
5
 * Copyright (c) 1983, 1993
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.
22
19
 *
35
32
 *      @(#)lp.h        8.2 (Berkeley) 4/28/95
36
33
 */
37
34
 
 
35
#include <dirent.h>
 
36
#include <sys/param.h>
 
37
#include <signal.h>
 
38
#include <grp.h>
38
39
 
39
40
/*
40
41
 * Global definitions for the line printer system.
44
45
extern long      BR;            /* baud rate if lp is a tty */
45
46
extern char     *CF;            /* name of cifplot filter (per job) */
46
47
extern char     *DF;            /* name of tex filter (per job) */
47
 
extern long      DU;            /* daeomon user-id */
 
48
extern long      DU;            /* daemon user-id */
48
49
extern long      FC;            /* flags to clear if lp is a tty */
49
50
extern char     *FF;            /* form feed string */
50
51
extern long      FS;            /* flags to set if lp is a tty */
56
57
extern char     *LP;            /* line printer device name */
57
58
extern long      MC;            /* maximum number of copies allowed */
58
59
extern char     *MS;            /* stty flags to set if lp is a tty */
59
 
extern long  MX;                /* maximum number of blocks to copy */
 
60
extern long      MX;            /* maximum number of blocks to copy */
60
61
extern char     *NF;            /* name of ditroff(1) filter (per job) */
61
62
extern char     *OF;            /* name of output filter (created once) */
62
63
extern long      PL;            /* page length */
83
84
 
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 */
 
94
 
 
95
extern uid_t    real_uid, effective_uid;
 
96
extern gid_t    real_gid, effective_gid;
 
97
 
 
98
extern volatile sig_atomic_t    gotintr;
 
99
 
93
100
/*
94
101
 * Structure used for building a sorted list of control files.
95
102
 */
98
105
        char    q_name[MAXNAMLEN+1];    /* control file name */
99
106
};
100
107
 
 
108
/*
 
109
 * Macros to raise/lower permissions.
 
110
 */
 
111
#define PRIV_START do {                         \
 
112
        int save_errno = errno;                 \
 
113
        (void)seteuid(effective_uid);           \
 
114
        (void)setegid(effective_gid);           \
 
115
        errno = save_errno;                     \
 
116
} while (0)
 
117
 
 
118
#define PRIV_END do {                           \
 
119
        int save_errno = errno;                 \
 
120
        (void)setegid(real_gid);                \
 
121
        (void)seteuid(real_uid);                \
 
122
        errno = save_errno;                     \
 
123
} while (0)
 
124
 
101
125
#include <sys/cdefs.h>
102
126
 
103
127
__BEGIN_DECLS
104
128
struct dirent;
105
129
 
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));
130
 
 
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 *));
 
130
void     blankfill(int);
 
131
char    *checkremote(void);
 
132
int      chk(char *);
 
133
void     displayq(int);
 
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 ***);
 
140
void     header(void);
 
141
int      inlist(char *, char *);
 
142
int      iscf(const struct dirent *);
 
143
int      isowner(char *, char *);
 
144
void     ldump(char *, char *, int);
 
145
void     prank(int);
 
146
void     process(char *);
 
147
void     rmjob(void);
 
148
void     rmremote(void);
 
149
void     show(char *, char *, int);
 
150
int      startdaemon(char *);
 
151
void     nodaemon(void);
 
152
void     delay(int);
 
153
int      safe_open(const char *, int, mode_t);
 
154
 
 
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 *);
 
162
 
 
163
size_t  strlcpy(char *dst, const char *src, size_t siz);
 
164
size_t  strlcat(char *dst, const char *src, size_t siz);
 
165
 
 
166
int     cgetclose();
 
167
int     lprGetUID(void);
 
168
 
137
169
__END_DECLS