File: common.h

package info (click to toggle)
netstd 3.07-7slink.3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 6,312 kB
  • ctags: 9,027
  • sloc: ansic: 72,107; cpp: 6,144; makefile: 1,650; yacc: 1,614; sh: 1,164; perl: 308; awk: 46
file content (305 lines) | stat: -rw-r--r-- 10,089 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
/* RE_SID: @(%)/tmp_mnt/vol/dosnfs/shades_SCCS/unix/pcnfsd/v2/src/SCCS/s.common.h 1.8 93/01/29 17:52:15 SMI */
/*
**=====================================================================
** Copyright (c) 1986-1993 by Sun Microsystems, Inc.
**
**         D I S C L A I M E R   S E C T I O N ,   E T C .
**
** pcnfsd is copyrighted software, but is freely licensed. This
** means that you are free to redistribute it, modify it, ship it
** in binary with your system, whatever, provided:
**
** - you leave the Sun copyright notice in the source code
** - you make clear what changes you have introduced and do
**   not represent them as being supported by Sun.
** - you do not charge money for the source code (unlikely, given
**   its free availability)
**
** If you make changes to this software, we ask that you do so in
** a way which allows you to build either the "standard" version or
** your custom version from a single source file. Test it, lint
** it (it won't lint 100%, very little does, and there are bugs in
** some versions of lint :-), and send it back to Sun via email
** so that we can roll it into the source base and redistribute
** it. We'll try to make sure your contributions are acknowledged
** in the source, but after all these years it's getting hard to
** remember who did what.
**
** The main contributors have been (in no special order):
**
** Glen Eustace <G.Eustace@massey.ac.nz>
**    user name caching for b-i-g password files
** Paul Emerson <paul@sdgsun.uucp>
**    cleaning up Interactive 386/ix handling, fixing the lp
**    interface, and generally tidying up the sources
** Keith Ericson <keithe@sail.labs.tek.com>
**    more 386/ix fixes
** Jeff Stearns <jeff@tc.fluke.com>
**    setuid/setgid for lpr
** Peter Van Campen <petervc@sci.kun.nl>
**    fixing setuid/gid stuff, syslog
** Ted Nolan <ted@usasoc.soc.mil>
**    /usr/adm/wtmp, other security suggestions
** Mogens Trab Damsgaard <trab@kubism.ku.dk>
**    allow SVR4 and BSD names to be used as appropriate.
** Arthur David Olson <ado@elsie.nci.nih.gov>
**    dozens of fixes all over the place
** Phil Servita <meister@ftp.com>
**    Ultrix authentication
** Greg Hinkel <guh@dsunx1.dsrd.ornl.gov>
**    more Ultrix stuff
**
** Thanks to everyone who has contributed.
**
**    Geoff Arnold, PC-NFS architect <geoff@East.Sun.COM>
**=====================================================================
*/
/*
**=====================================================================
**             C U S T O M I Z A T I O N   S E C T I O N              *
**=====================================================================
*/

/*
**---------------------------------------------------------------------
** Define the following symbol to enable the use of a 
** shadow password file
**---------------------------------------------------------------------
**/

/* #define SHADOW_SUPPORT */

/*
**---------------------------------------------------------------------
** Define the following symbol to enable the logging 
** of authentication requests to /usr/adm/wtmp
**---------------------------------------------------------------------
**/

#define WTMP

/*
**------------------------------------------------------------------------
** Define the following symbol conform to Interactive
** System's 2.0
**------------------------------------------------------------------------
*/

/* #define ISC_2_0 */

/*
**---------------------------------------------------------------------
** Define the following symbol to use a cache of recently-used
** user names. This has certain uses in university and other settings
** where (1) the pasword file is very large, and (2) a group of users
** frequently logs in together using the same account (for example,
** a class userid).
**---------------------------------------------------------------------
*/

/* #define USER_CACHE */

/*
**---------------------------------------------------------------------
** Define the following symbol to build a System V version
**---------------------------------------------------------------------
*/

/* #define SYSV */

/*
**---------------------------------------------------------------------
** Define the following symbol to build an Ultrix 4.2 version
**---------------------------------------------------------------------
*/

/* #define ULTRIX */



/*
**---------------------------------------------------------------------
** Define the following symbol to build a version that
** will use the setusershell()/getusershell()/endusershell() calls
** to determine if a password entry contains a legal shell (and therefore
** identifies a user who may log in). The default is to check that
** the last two characters of the shell field are "sh", which should
** cope with "sh", "csh", "ksh", "bash".... See the routine get_password()
** in pcnfsd_misc.c for more details.
*/

/* #define USE_GETUSERSHELL */

/*
**---------------------------------------------------------------------
** Define the following symbol to build a version that
** will consult the NIS (formerly Yellow Pages) "auto.home" map to
** locate the user's home directory (returned by the V2 authentication
** procedure).
**---------------------------------------------------------------------
*/

/* #define USE_YP */


/*
**---------------------------------------------------------------------
** Define one of the following symbols to select the way in which
** the "print file" printer operation is to be implemented.
** See pcnfsd_printer.c for more details.
**---------------------------------------------------------------------
*/

/* #define SVR4_STYLE_PRINT */
/* #define BSD_STYLE_PRINT */

/*
**---------------------------------------------------------------------
** Define one of the following symbols to select the way in which
** the "list printers" printer operation is to be implemented.
** See pcnfsd_printer.c for more details.
**---------------------------------------------------------------------
*/

/* #define SVR4_STYLE_PR_LIST */
/* #define BSD_STYLE_PR_LIST */

/*
**---------------------------------------------------------------------
** Define one of the following symbols to select the way in which
** the "list queue" printer operation is to be implemented.
** See pcnfsd_printer.c for more details.
**---------------------------------------------------------------------
*/

/* #define SVR4_STYLE_QUEUE */
/* #define BSD_STYLE_QUEUE */

/*
**---------------------------------------------------------------------
** Define one of the following symbols to select the way in which
** the "cancel job" printer operation is to be implemented.
** See pcnfsd_printer.c for more details.
**---------------------------------------------------------------------
*/

/* #define SVR4_STYLE_CANCEL */
/* #define BSD_STYLE_CANCEL */

/*
**---------------------------------------------------------------------
** Define one of the following symbols to select the way in which
** the "printer status" printer operation is to be implemented.
** See pcnfsd_printer.c for more details.
**---------------------------------------------------------------------
*/

/* #define SVR4_STYLE_STATUS */
/* #define BSD_STYLE_STATUS */

/*
**---------------------------------------------------------------------
** Define one of the following symbols to select the file or directory
** for which any change should cause the printer list to be rebuilt.
** See pcnfsd_printer.c for more details.
**---------------------------------------------------------------------
*/

/* #define SVR4_STYLE_MONITOR */
/* #define BSD_STYLE_MONITOR */

/*
**---------------------------------------------------------------------
** trab -jan 1993:
** Define the following symbol, if you have defined BSD style print
** operations with:
**	BSD_STYLE_PRINT
**	BSD_STYLE_QUEUE
**	BSD_STYLE_STATUS
**	BSD_STYLE_MONITOR
** but have choosen:
**	SVR4_STYLE_PR_LIST 
** for "list printers".
** This will permit use of both the SVR4 printer names (from lpstat)
** and the BSD printer names (first name in printcap entries).
** See pcnfsd_printer.c for more details.
**---------------------------------------------------------------------

/* #define ACCEPT_BSD_PR_NAMES */


/*
**=====================================================================
**                 P E R - O / S   S E C T I O N                      *
**                                                                    *
** For each supported OS, we gather the options in a single #ifdef    *
**=====================================================================
*/

#ifdef OSVER_SOLARIS2X
#define SVR4_STYLE_PRINT
#define SVR4_STYLE_PR_LIST
#define SVR4_STYLE_QUEUE
#define SVR4_STYLE_CANCEL
#define SVR4_STYLE_STATUS
#define SVR4_STYLE_MONITOR
#define SHADOW_SUPPORT
#define SVR4
#define WTMP
#endif

#ifdef OSVER_SUNOS41
#define BSD_STYLE_PRINT
#define BSD_STYLE_QUEUE
#define BSD_STYLE_CANCEL
#define BSD_STYLE_STATUS
#define BSD_STYLE_MONITOR
#define SVR4_STYLE_PR_LIST
#define ACCEPT_BSD_PR_NAMES
#endif

#ifdef OSVER_SUNOS403C
#define BSD_STYLE_PRINT
#define BSD_STYLE_PR_LIST
#define BSD_STYLE_QUEUE
#define BSD_STYLE_CANCEL
#define BSD_STYLE_STATUS
#define BSD_STYLE_MONITOR
#define SUNOS_403C
#endif

#ifdef OSVER_BSD386
#define BSD_STYLE_PRINT
#define BSD_STYLE_PR_LIST
#define BSD_STYLE_QUEUE
#define BSD_STYLE_CANCEL
#define BSD_STYLE_STATUS
#define BSD_STYLE_MONITOR
#define BSD386
#endif

#ifdef OSVER_ULTRIX
#define BSD_STYLE_PRINT
#define BSD_STYLE_PR_LIST
#define BSD_STYLE_QUEUE
#define BSD_STYLE_CANCEL
#define BSD_STYLE_STATUS
#define BSD_STYLE_MONITOR
#define WTMP
#define ULTRIX
#define ULTRIX_AUTH
#endif


/*
**=====================================================================
**              " O T H E R  S T U F F "   S E C T I O N              *
**=====================================================================
*/

#ifndef assert
#define assert(ex) {if (!(ex)) \
    {char asstmp[256];(void)sprintf(asstmp,"rpc.pcnfsd: Assertion failed: line %d of %s\n", \
    __LINE__, __FILE__); (void)msg_out(asstmp); \
    sleep (10); exit(1);}}
#endif