386BSD 0.1 development
[unix-history] / usr / src / libexec / uucp / policy.h
CommitLineData
6ed179b5
WJ
1/* policy.h
2 Configuration file for policy decisions. To be edited on site.
3
4 Copyright (C) 1991, 1992 Ian Lance Taylor
5
6 This file is part of the Taylor UUCP package.
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of the
11 License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
22 The author of the program may be contacted at ian@airs.com or
23 c/o AIRS, P.O. Box 520, Waltham, MA 02254.
24
25 $Log: policy.h,v $
26 Revision 1.8 1992/04/01 21:58:35 ian
27 Added CLOSE_LOGFILES configuration parameter
28
29 Revision 1.7 1992/03/30 15:29:58 ian
30 Added HAVE_SVR4_LOCKFILES
31
32 Revision 1.6 1992/03/27 05:31:09 ian
33 David J. MacKenzie: various cleanups
34
35 Revision 1.5 1992/03/16 01:23:08 ian
36 Make blocking writes optional
37
38 Revision 1.4 1992/03/12 19:54:43 ian
39 Debugging based on types rather than number
40
41 Revision 1.3 1992/03/11 22:34:25 ian
42 Chip Salzenberg: support Internet mail addresses in uuxqt replies
43
44 Revision 1.2 1992/03/02 04:53:07 ian
45 Marc Unangst: added HAVE_SCO_LOCKFILES configuration parameter
46
47 Revision 1.1 1992/02/23 03:26:51 ian
48 Initial revision
49
50 */
51
52/* This header file contains macro definitions which must be set by
53 each site before compilation. The first few are system
54 characteristics that can not be easily discovered by the
55 configuration script. Most are configuration decisions that must
56 be made by the local administrator. */
57\f
58/* System characteristics. */
59
60/* This code tries to use several ANSI C features, including
61 prototypes, stdarg.h, the const qualifier and the types void
62 (including void * pointers) and unsigned char. By default it will
63 use these features if the compiler defines __STDC__. If your
64 compiler supports these features but does not define __STDC__, you
65 should set ANSI_C to 1. If your compiler does not support these
66 features but defines __STDC__ (no compiler should do this, in my
67 opinion), you should set ANSI_C to 0. In most cases (or if you're
68 not sure) just leave the line below commented out. */
69/* #define ANSI_C 1 */
70
71/* Set USE_STDIO to 1 if data files should be read using the stdio
72 routines (fopen, fread, etc.) rather than the UNIX unbuffered I/O
73 calls (open, read, etc.). Unless you know your stdio is really
74 rotten, you should leave this as 1. */
75#define USE_STDIO 1
76
77/* Exactly one of the following macros must be set to 1. Many modern
78 systems support more than one of these choices through some form of
79 compilation environment, in which case the setting will depend on
80 the compilation environment you use. If you have a reasonable
81 choice between options, I suspect that TERMIO or TERMIOS will be
82 more efficient than TTY, but I have not done any head to head
83 comparisons.
84
85 If you don't set any of these macros, the code below will guess.
86 It will doubtless be wrong on some systems.
87
88 HAVE_BSD_TTY -- Use the 4.2BSD tty routines
89 HAVE_SYSV_TERMIO -- Use the System V termio routines
90 HAVE_POSIX_TERMIOS -- Use the POSIX termios routines
91 */
92#define HAVE_BSD_TTY 1
93#define HAVE_SYSV_TERMIO 0
94#define HAVE_POSIX_TERMIOS 0
95
96/* This code tries to guess which terminal driver to use if you did
97 not make a choice above. It is in this file to make it easy to
98 figure out what's happening if something goes wrong. */
99
100#if HAVE_BSD_TTY + HAVE_SYSV_TERMIO + HAVE_POSIX_TERMIOS == 0
101#if HAVE_CBREAK
102#undef HAVE_BSD_TTY
103#define HAVE_BSD_TTY 1
104#else
105#undef HAVE_SYSV_TERMIO
106#define HAVE_SYSV_TERMIO 1
107#endif
108#endif
109
110/* On some systems a write to a serial port will block even if the
111 file descriptor has been set to not block. File transfer can be
112 more efficient if the package knows that a write to the serial port
113 will not block; however, if the write does block unexpectedly then
114 data loss is possible at high speeds.
115
116 If writes to a serial port always block even when requested not to,
117 you should set HAVE_UNBLOCKED_WRITES to 0; otherwise you should set
118 it to 1. In general on System V HAVE_UNBLOCKED_WRITES should be 0
119 and on BSD it should be 1.
120
121 If HAVE_UNBLOCKED_WRITES is set to 1 when it should be 0 you may
122 see an unexpectedly large number of transmission errors, or, if you
123 have hardware handshaking, transfer times may be lower than
124 expected (but then, they always are). If HAVE_UNBLOCKED_WRITES is
125 set to 0 when it should be 1, file transfer will use more CPU time
126 than necessary. If you are unsure, setting HAVE_UNBLOCKED_WRITES
127 to 0 should always be safe. */
128#define HAVE_UNBLOCKED_WRITES 1
129
130/* When the code does do a blocking write, it wants to write the
131 largest amount of data which the kernel will accept as a single
132 unit. On BSD this is typically the value of OBUFSIZ in
133 <sys/tty.h>, usually 100. On System V this is typically the size
134 of a clist, CLSIZE in <sys/tty.h>, which is usually 64. Define
135 SINGLE_WRITE to the correct value for your system. If SINGLE_WRITE
136 is too large, data loss may occur. If SINGLE_WRITE is too small,
137 file transfer will use more CPU time than necessary. If you have
138 no idea, 64 should work on most modern systems. */
139#define SINGLE_WRITE 100
140
141/* Set TIMES_TICK to the fraction of a second which times(2) returns
142 (for example, if times returns 100ths of a second TIMES_TICK should
143 be set to 100). On a true POSIX system TIMES_TICK may simply be
144 defined as CLK_TCK. On some systems the environment variable HZ is
145 what you want for TIMES_TICK, but on some other systems HZ has the
146 wrong value; check the man page. If you leave this set to 0, the
147 code will try to guess; it will doubtless be wrong on some systems.
148 If TIMES_TICK is wrong the code may report incorrect file transfer
149 times in the statistics file, but on many systems times(2) will
150 actually not be used and this value will not matter at all. */
151#define TIMES_TICK 60
152
153/* Set PS_PROGRAM to the program to run to get a process status,
154 including the arguments to pass it. This is used by ``uustat -p''.
155 Set HAVE_PS_MULTIPLE to 1 if a comma separated list of process
156 numbers may be appended (e.g. ``ps -flp1,10,100''). Otherwise ps
157 will be invoked several times, with a single process number append
158 each time. The default definitions should work on most systems,
159 although some may complain about the 'p' option. The second set of
160 definitions are appropriate for System V. To use the second set of
161 definitions, change the ``#if 1'' to ``#if 0''. */
162#if 1
163#define PS_PROGRAM "/bin/ps -lp"
164#define HAVE_PS_MULTIPLE 0
165#else
166#define PS_PROGRAM "/bin/ps -flp"
167#define HAVE_PS_MULTIPLE 1
168#endif
169
170/* If you use other programs that also lock devices, such as cu or
171 uugetty, the other programs and UUCP must agree on whether a device
172 is locked. This is typically done by creating a lock file in a
173 specific directory. The lock file is named LCK.. followed by the
174 name of the device (UUCP and some versions of cu also lock systems
175 this way). If the LOCKDIR macro is defined, these lock files will
176 be placed in the named directory; otherwise they will be placed in
177 the default spool directory. On some BNU systems the lock files
178 are placed in /etc/locks. On some they are placed in
179 /usr/spool/locks. */
180/* #define LOCKDIR "/etc/locks" */
181#define LOCKDIR "/var/spool/lock"
182
183/* You must also specify the format of the lock files by setting
184 exactly one of the following macros to 1. Check an existing lock
185 file to decide which of these choices is more appropriate.
186
187 The BNU style is to write the locking process ID in ASCII, passed
188 to ten characters, followed by a newline.
189
190 The V2 style is to write the locking process ID as four binary
191 bytes in the host byte order.
192
193 SCO lock files are similar to BNU lock files, but always lock the
194 lowercase version of the tty (i.e., LCK..tty2a is created if you
195 are locking tty2A). They are appropriate if you are using Taylor
196 UUCP on an SCO Unix, SCO Xenix, or SCO Open Desktop system.
197
198 SVR4 lock files are also similar to BNU lock files, but they use a
199 different naming convention. The filenames are LK.xxx.yyy.zzz,
200 where xxx is the major device number of the device holding the
201 special device file, yyy is the major device number of the port
202 device itself, and zzz is the minor device number of the port
203 device. */
204#define HAVE_V2_LOCKFILES 0
205#define HAVE_BNU_LOCKFILES 1
206#define HAVE_SCO_LOCKFILES 0
207#define HAVE_SVR4_LOCKFILES 0
208
209/* If your system supports Internet mail addresses, HAVE_INTERNET_MAIL
210 should be set to 1. This is checked by uuxqt when sending error
211 (or success, if requested) notifications to the person who
212 submitted the job. */
213#define HAVE_INTERNET_MAIL 1
214\f
215/* Adminstrative decisions. */
216
217/* Set USE_RCS_ID to 1 if you want the RCS ID strings compiled into
218 the executable. Leaving them out will decrease the executable
219 size. Leaving them in will make it easier to determine which
220 version you are running. */
221#define USE_RCS_ID 1
222
223/* DEBUG controls how much debugging information is compiled into the
224 code. If DEBUG is defined as 0, no sanity checks will be done and
225 no debugging messages will be compiled in. If DEBUG is defined as
226 1 sanity checks will be done but there will still be no debugging
227 messages. If DEBUG is 2 than debugging messages will be compiled
228 in. When initially testing, DEBUG should be 2, and you should
229 probably leave it at 2 unless a small reduction in the executable
230 file size will be very helpful. */
231#define DEBUG 2
232
233/* Set the default grade to use for a uucp command if the -g option is
234 not used. The grades, from highest to lowest, are 0 to 9, A to Z,
235 a to z. */
236#define BDEFAULT_UUCP_GRADE ('N')
237
238/* Set the default grade to use for a uux command if the -g option is
239 not used. */
240#define BDEFAULT_UUX_GRADE ('N')
241
242/* The maximum number of times to retry calling a system which is not
243 answering. If this many calls to the system have failed, the
244 system will not be called again until the status file has been
245 removed (on a Unix system the status file is in the .Status
246 subdirectory of the main spool directory, and has the same name as
247 the system name). If this is set to 0 the system may be called
248 regardless of how many previous calls have failed. */
249#define CMAXRETRIES 26
250
251/* To compile in use of the new style of configuration files described
252 in the documentation, set HAVE_TAYLOR_CONFIG to 1. */
253#define HAVE_TAYLOR_CONFIG 1
254
255/* To compile in use of V2 style configuration files (L.sys, L-devices
256 and so on), set HAVE_V2_CONFIG to 1. To compile in use of BNU
257 style configuration files (Systems, Devices and so on) set
258 HAVE_BNU_CONFIG to 1. The files will be looked up in the
259 oldconfigdir directory as defined in the Makefile.
260
261 You may set any or all of HAVE_TAYLOR_CONFIG, HAVE_V2_CONFIG and
262 HAVE_BNU_CONFIG to 1 (you must set at least one of the macros).
263 When looking something up (a system, a port, etc.) the new style
264 configuration files will be read first, followed by the V2
265 configuration files, followed by the BNU configuration files. */
266#define HAVE_V2_CONFIG 0
267#define HAVE_BNU_CONFIG 0
268
269/* Exactly one of the following macros must be set to 1. The exact
270 format of the spool directories is explained in sys3.unx.
271
272 SPOOLDIR_V2 -- Use a Version 2 (original UUCP) style spool directory
273 SPOOLDIR_BSD42 -- Use a BSD 4.2 style spool directory
274 SPOOLDIR_BSD43 -- Use a BSD 4.3 style spool directory
275 SPOOLDIR_BNU -- Use a BNU (HDB) style spool directory
276 SPOOLDIR_ULTRIX -- Use an Ultrix style spool directory
277 SPOOLDIR_TAYLOR -- Use a new style spool directory
278
279 If you are not worried about compatibility with a currently running
280 UUCP, use SPOOLDIR_TAYLOR. */
281#define SPOOLDIR_V2 0
282#define SPOOLDIR_BSD42 0
283#define SPOOLDIR_BSD43 0
284#define SPOOLDIR_BNU 0
285#define SPOOLDIR_ULTRIX 0
286#define SPOOLDIR_TAYLOR 1
287
288/* You must select which type of logging you want by setting exactly
289 one of the following to 1. These control output to the log file
290 and to the statistics file.
291
292 If you define HAVE_TAYLOR_LOGGING, each line in the log file will
293 look something like this:
294
295 uucico uunet uucp (1991-12-10 09:04:34.45 16390) Receiving uunet/D./D.uunetSwJ72
296
297 and each line in the statistics file will look something like this:
298
299 uucp uunet (1991-12-10 09:04:40.20) received 2371 bytes in 5 seconds (474 bytes/sec)
300
301 If you define HAVE_V2_LOGGING, each line in the log file will look
302 something like this:
303
304 uucico uunet uucp (12/10-09:04 16390) Receiving uunet/D./D.uunetSwJ72
305
306 and each line in the statistics file will look something like this:
307
308 uucp uunet (12/10-09:04 16390) (692373862) received data 2371 bytes 5 seconds
309
310 If you define HAVE_BNU_LOGGING, each program will by default use a
311 separate log file. For uucico talking to uunet, for example, it
312 will be /usr/spool/uucp/.Log/uucico/uunet. Each line will look
313 something like this:
314
315 uucp uunet (12/10-09:04:22,16390,1) Receiving uunet/D./D.uunetSwJ72
316
317 and each line in the statistics file will look something like this:
318
319 uunet!uucp M (12/10-09:04:22) (C,16390,1) [ttyXX] <- 2371 / 5.000 secs, 474 bytes/sec
320
321 The main reason to prefer one format over another is that you may
322 have shell scripts which expect the files to have a particular
323 format. If you have none, choose whichever format you find more
324 appealing. */
325#define HAVE_TAYLOR_LOGGING 1
326#define HAVE_V2_LOGGING 0
327#define HAVE_BNU_LOGGING 0
328
329/* If you would like the log, debugging and statistics files to be
330 closed after each message, set CLOSE_LOGFILES to 1. This will
331 permit the log files to be easily moved. If a log file does not
332 exist when a new message is written out, it will be created.
333 Setting CLOSE_LOGFILES to 1 will obviously require slightly more
334 processing time. */
335#define CLOSE_LOGFILES 0
336
337/* The name of the default spool directory. If HAVE_TAYLOR_CONFIG is
338 set to 1, this may be overridden by the ``spool'' command in the
339 configuration file. */
340#define SPOOLDIR "/var/spool/uucp"
341
342/* The name of the default public directory. If HAVE_TAYLOR_CONFIG is
343 set to 1, this may be overridden by the ``pubdir'' command in the
344 configuration file. Also, a particular system may be given a
345 specific public directory by using the ``pubdir'' command in the
346 system file. */
347#define PUBDIR "/var/spool/uucppublic"
348
349/* The default command path. This is a space separated list of
350 directories. Remote command executions requested by uux are looked
351 up using this path. If you are using HAVE_TAYLOR_CONFIG, the
352 command path may be overridden for a particular system. For most
353 systems, you should just make sure that the programs rmail and
354 rnews can be found using this path. */
355#define CMDPATH "/bin /usr/bin /usr/local/bin"
356
357/* The default amount of free space to require for systems that do not
358 specify an amount with the ``free-space'' command. This is only
359 used when talking to another instance of Taylor UUCP; if accepting
360 a file would not leave at least this many bytes free on the disk,
361 it will be refused. */
362#define DEFAULT_FREE_SPACE (50000)
363
364/* It is possible for an execute job to request to be executed using
365 sh(1), rather than execve(2). This is such a security risk, it is
366 being disabled by default; to allow such jobs, set the following
367 macro to 1. */
368#define ALLOW_SH_EXECUTION 0
369
370/* If a command executed on behalf of a remote system takes a filename
371 as an argument, a security breach may be possible (note that on my
372 system neither of the default commands, rmail and rnews, take
373 filename arguments). If you set ALLOW_FILENAME_ARGUMENTS to 0, all
374 arguments to a command will be checked; if any argument
375 1) starts with ../
376 2) contains the string /../
377 3) begins with a / but does not name a file that may be sent or
378 received (according to the specified ``remote-send'' and
379 ``remote-receive'')
380 the command will be rejected. By default, any argument is
381 permitted. */
382#define ALLOW_FILENAME_ARGUMENTS 1
383
384#if HAVE_TAYLOR_LOGGING
385
386/* The default log file when using HAVE_TAYLOR_LOGGING. When using
387 HAVE_TAYLOR_CONFIG, this may be overridden by the ``logfile''
388 command in the configuration file. */
389#define LOGFILE "/var/spool/uucp/Log"
390
391/* The default statistics file when using HAVE_TAYLOR_LOGGING. When
392 using HAVE_TAYLOR_CONFIG, this may be overridden by the
393 ``statfile'' command in the configuration file. */
394#define STATFILE "/var/spool/uucp/Stats"
395
396/* The default debugging file when using HAVE_TAYLOR_LOGGING. When
397 using HAVE_TAYLOR_CONFIG, this may be overridden by the
398 ``debugfile'' command in the configuration file. */
399#define DEBUGFILE "/var/spool/uucp/Debug"
400
401#endif /* HAVE_TAYLOR_LOGGING */
402
403#if HAVE_V2_LOGGING
404
405/* The default log file when using HAVE_V2_LOGGING. When using
406 HAVE_TAYLOR_CONFIG, this may be overridden by the ``logfile''
407 command in the configuration file. */
408#define LOGFILE "/var/spool/uucp/LOGFILE"
409
410/* The default statistics file when using HAVE_V2_LOGGING. When using
411 HAVE_TAYLOR_CONFIG, this may be overridden by the ``statfile''
412 command in the configuration file. */
413#define STATFILE "/var/spool/uucp/SYSLOG"
414
415/* The default debugging file when using HAVE_V2_LOGGING. When using
416 HAVE_TAYLOR_CONFIG, this may be overridden by the ``debugfile''
417 command in the configuration file. */
418#define DEBUGFILE "/var/spool/uucp/DEBUG"
419
420#endif /* HAVE_V2_LOGGING */
421
422#if HAVE_BNU_LOGGING
423
424/* The default log file when using HAVE_BNU_LOGGING. When using
425 HAVE_TAYLOR_CONFIG, this may be overridden by the ``logfile''
426 command in the configuration file. The first %s in the string will
427 be replaced by the program name (e.g. uucico); the second %s will
428 be replaced by the system name (if there is no appropriate system,
429 "ANY" will be used). No other '%' character may appear in the
430 string. */
431#define LOGFILE "/var/spool/uucp/.Log/%s/%s"
432
433/* The default statistics file when using HAVE_BNU_LOGGING. When using
434 HAVE_TAYLOR_CONFIG, this may be overridden by the ``statfile''
435 command in the configuration file. */
436#define STATFILE "/var/spool/uucp/.Admin/xferstats"
437
438/* The default debugging file when using HAVE_BNU_LOGGING. When using
439 HAVE_TAYLOR_CONFIG, this may be overridden by the ``debugfile''
440 command in the configuration file. */
441#define DEBUGFILE "/var/spool/uucp/.Admin/audit.local"
442
443#endif /* HAVE_BNU_LOGGING */