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