common.h revision 1.1
1/* RE_SID: @(%)/usr/dosnfs/shades_SCCS/unix/pcnfsd/v2/src/SCCS/s.common.h 1.3 91/12/17 14:32:05 SMI */
2/*
3**=====================================================================
4** Copyright (c) 1986,1987,1988,1989,1990,1991 by Sun Microsystems, Inc.
5**
6**         D I S C L A I M E R   S E C T I O N ,   E T C .
7**
8** pcnfsd is copyrighted software, but is freely licensed. This
9** means that you are free to redistribute it, modify it, ship it
10** in binary with your system, whatever, provided:
11**
12** - you leave the Sun copyright notice in the source code
13** - you make clear what changes you have introduced and do
14**   not represent them as being supported by Sun.
15** - you do not charge money for the source code (unlikely, given
16**   its free availability)
17**
18** If you make changes to this software, we ask that you do so in
19** a way which allows you to build either the "standard" version or
20** your custom version from a single source file. Test it, lint
21** it (it won't lint 100%, very little does, and there are bugs in
22** some versions of lint :-), and send it back to Sun via email
23** so that we can roll it into the source base and redistribute
24** it. We'll try to make sure your contributions are acknowledged
25** in the source, but after all these years it's getting hard to
26** remember who did what.
27**
28** The main contributors have been (in no special order):
29**
30** Glen Eustace <G.Eustace@massey.ac.nz>
31**    user name caching for b-i-g password files
32** Paul Emerson <paul@sdgsun.uucp>
33**    cleaning up Interactive 386/ix handling, fixing the lp
34**    interface, and generally tidying up the sources
35** Keith Ericson <keithe@sail.labs.tek.com>
36**    more 386/ix fixes
37** Jeff Stearns <jeff@tc.fluke.com>
38**    setuid/setgid for lpr
39** Peter Van Campen <petervc@sci.kun.nl>
40**    fixing setuid/gid stuff, syslog
41** Ted Nolan <ted@usasoc.soc.mil>
42**    /usr/adm/wtmp, other security suggestions
43**
44** Thanks to everyone who has contributed.
45**
46**    Geoff Arnold, PC-NFS architect <geoff@East.Sun.COM>
47**=====================================================================
48*/
49/*
50**=====================================================================
51**             C U S T O M I Z A T I O N   S E C T I O N              *
52**                                                                    *
53** You should not uncomment these #defines in this version of pcnfsd  *
54** Instead you should edit the makefile CDEFS variable.               *
55**                                                                    *
56**=====================================================================
57*/
58
59/*
60**---------------------------------------------------------------------
61** Define (via Makefile) the following symbol to enable the use of a
62** shadow password file
63**---------------------------------------------------------------------
64**/
65
66/* #define SHADOW_SUPPORT */
67
68/*
69**---------------------------------------------------------------------
70** Define (via Makefile) the following symbol to enable the logging
71** of authentication requests to /usr/adm/wtmp
72**---------------------------------------------------------------------
73**/
74
75/* #define WTMP */
76
77/*
78**------------------------------------------------------------------------
79** Define (via Makefile) the following symbol conform to Interactive
80** System's 2.0
81**------------------------------------------------------------------------
82*/
83
84/* #define ISC_2_0 */
85
86/*
87**---------------------------------------------------------------------
88** Define (via Makefile) the following symbol to use a cache of recently-used
89** user names. This has certain uses in university and other settings
90** where (1) the pasword file is very large, and (2) a group of users
91** frequently logs in together using the same account (for example,
92** a class userid).
93**---------------------------------------------------------------------
94*/
95
96/* #define USER_CACHE */
97
98/*
99**---------------------------------------------------------------------
100** Define (via Makefile) the following symbol to build a System V version
101**---------------------------------------------------------------------
102*/
103
104/* #define SYSV */
105
106/*
107**---------------------------------------------------------------------
108** Define (via Makefile) the following symbol to build a version that uses
109** System V style "lp" instead of BSD-style "lpr" to print
110**---------------------------------------------------------------------
111*/
112
113/* #define USE_LP */
114
115/*
116**---------------------------------------------------------------------
117** Define (via Makefile) the following symbol to build a typical
118** "local feature": in this case recognizing the special printer
119** names "rotated" and "2column" and using the Adobe "enscript"
120** command to format the output appropriately.
121**---------------------------------------------------------------------
122*/
123
124/* #define HACK_FOR_ROTATED_TRANSCRIPT */
125
126/*
127**---------------------------------------------------------------------
128** Define (via Makefile) the following symbol to build a version that
129** will use the setusershell()/getusershell()/endusershell() calls
130** to determine if a password entry contains a legal shell (and therefore
131** identifies a user who may log in). The default is to check that
132** the last two characters of the shell field are "sh", which should
133** cope with "sh", "csh", "ksh", "bash".... See the routine get_pasword()
134** in pcnfsd_misc.c for more details.
135**
136** Note: For some reason that I haven't yet figured out, getusershell()
137** only seems to work when RPC_SVC_FG is defined (for debugging). It doesn't
138** seem to matter whether /etc/shells exists or not. Tracing
139** things doesn't throw any light on this....  Geoff Dec.17 '91
140*/
141
142/*
143**---------------------------------------------------------------------
144** Define (via Makefile) the following symbol to build a version that
145** will consult the NIS (formerly Yellow Pages) "auto.home" map to
146** locate the user's home directory (returned by the V2 authentication
147** procedure).
148**---------------------------------------------------------------------
149*/
150
151/* #define USE_YP */
152
153
154/* #define USE_GETUSERSHELL */
155
156
157/*
158**---------------------------------------------------------------------
159** The following should force the right things for Interactive 2.0
160**---------------------------------------------------------------------
161*/
162#ifdef ISC_2_0
163#define SYSV
164#define USE_LP
165#define SHADOW_SUPPORT
166#endif
167
168/*
169**---------------------------------------------------------------------
170** Other #define's
171**---------------------------------------------------------------------
172*/
173
174#define assert(ex) {if (!(ex)) \
175    {char asstmp[256];(void)sprintf(asstmp,"rpc.pcnfsd: Assertion failed: line %d of %s: \"%s\"\n", \
176    __LINE__, __FILE__, "ex"); (void)msg_out(asstmp); \
177    sleep (10); exit(1);}}
178
179
180