|
|
1.1 root 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 [email protected] or
23: c/o Infinity Development Systems, P.O. Box 520, Waltham, MA 02254.
24: */
25:
26: /* This header file contains macro definitions which must be set by
27: each site before compilation. The first few are system
28: characteristics that can not be easily discovered by the
29: configuration script. Most are configuration decisions that must
30: be made by the local administrator. */
31:
32: /* System characteristics. */
33:
34: /* This code tries to use several ANSI C features, including
35: prototypes, stdarg.h, the const qualifier and the types void
36: (including void * pointers) and unsigned char. By default it will
37: use these features if the compiler defines __STDC__. If your
38: compiler supports these features but does not define __STDC__, you
39: should set ANSI_C to 1. If your compiler does not support these
40: features but defines __STDC__ (no compiler should do this, in my
41: opinion), you should set ANSI_C to 0. In most cases (or if you're
42: not sure) just leave the line below commented out. */
43: /* #define ANSI_C 1 */
44:
45: /* Set USE_STDIO to 1 if data files should be read using the stdio
46: routines (fopen, fread, etc.) rather than the UNIX unbuffered I/O
47: calls (open, read, etc.). Unless you know your stdio is really
48: rotten, you should leave this as 1. */
49: #define USE_STDIO 1
50:
51: /* Exactly one of the following macros must be set to 1. Many modern
52: systems support more than one of these choices through some form of
53: compilation environment, in which case the setting will depend on
54: the compilation environment you use. If you have a reasonable
55: choice between options, I suspect that TERMIO or TERMIOS will be
56: more efficient than TTY, but I have not done any head to head
57: comparisons.
58:
59: If you don't set any of these macros, the code below will guess.
60: It will doubtless be wrong on some systems.
61:
62: HAVE_BSD_TTY -- Use the 4.2BSD tty routines
63: HAVE_SYSV_TERMIO -- Use the System V termio routines
64: HAVE_POSIX_TERMIOS -- Use the POSIX termios routines
65: */
66: #define HAVE_BSD_TTY 0
67: #define HAVE_SYSV_TERMIO 1
68: #define HAVE_POSIX_TERMIOS 0
69:
70: /* This code tries to guess which terminal driver to use if you did
71: not make a choice above. It is in this file to make it easy to
72: figure out what's happening if something goes wrong. */
73:
74: #if HAVE_BSD_TTY + HAVE_SYSV_TERMIO + HAVE_POSIX_TERMIOS == 0
75: #if HAVE_CBREAK
76: #undef HAVE_BSD_TTY
77: #define HAVE_BSD_TTY 1
78: #else
79: #undef HAVE_SYSV_TERMIO
80: #define HAVE_SYSV_TERMIO 1
81: #endif
82: #endif
83:
84: /* On some systems a write to a serial port will block even if the
85: file descriptor has been set to not block. File transfer can be
86: more efficient if the package knows that a write to the serial port
87: will not block; however, if the write does block unexpectedly then
88: data loss is possible at high speeds.
89:
90: If writes to a serial port always block even when requested not to,
91: you should set HAVE_UNBLOCKED_WRITES to 0; otherwise you should set
92: it to 1. In general on System V releases without STREAMS-based
93: ttys (e.g., before SVR4) HAVE_UNBLOCKED_WRITES should be 0 and on
94: BSD or SVR4 it should be 1.
95:
96: If HAVE_UNBLOCKED_WRITES is set to 1 when it should be 0 you may
97: see an unexpectedly large number of transmission errors, or, if you
98: have hardware handshaking, transfer times may be lower than
99: expected (but then, they always are). If HAVE_UNBLOCKED_WRITES is
100: set to 0 when it should be 1, file transfer will use more CPU time
101: than necessary. If you are unsure, setting HAVE_UNBLOCKED_WRITES
102: to 0 should always be safe. */
103: #define HAVE_UNBLOCKED_WRITES 0
104:
105: /* When the code does do a blocking write, it wants to write the
106: largest amount of data which the kernel will accept as a single
107: unit. On BSD this is typically the value of OBUFSIZ in
108: <sys/tty.h>, usually 100. On System V before SVR4 this is
109: typically the size of a clist, CLSIZE in <sys/tty.h>, which is
110: usually 64. On SVR4, which uses STREAMS-based ttys, 2048 is
111: reasonable. Define SINGLE_WRITE to the correct value for your
112: system. If SINGLE_WRITE is too large, data loss may occur. If
113: SINGLE_WRITE is too small, file transfer will use more CPU time
114: than necessary. If you have no idea, 64 should work on most modern
115: systems. */
116: #define SINGLE_WRITE 64
117:
118: /* Some tty drivers, such as those from SCO and AT&T's Unix PC, have a
119: bug in the implementation of ioctl() that causes CLOCAL to be
120: ineffective until the port is opened a second time. If
121: HAVE_CLOCAL_BUG is set to 1, code will be added to do this second
122: open on the port. Set this if you are getting messages that say
123: "Line disconnected" while in the dial chat script after only
124: writing the first few characters to the port. This bug causes the
125: resetting of CLOCAL to have no effect, so the "\m" (require
126: carrier) escape sequence won't function properly in dialer chat
127: scripts. */
128: #define HAVE_CLOCAL_BUG 0
129:
130: /* On some systems, such as SCO Xenix, resetting DTR on a port
131: apparently prevents getty from working on the port, and thus
132: prevents anybody from dialing in. If HAVE_RESET_BUG is set to 1,
133: DTR will not be reset when a serial port is closed. */
134: #define HAVE_RESET_BUG 0
135:
136: /* The Sony NEWS reportedly handles no parity by clearing both the odd
137: and even parity bits in the sgtty structure, unlike most BSD based
138: systems in which no parity is indicated by setting both the odd and
139: even parity bits. Setting HAVE_PARITY_BUG to 1 will handle this
140: correctly. */
141: #define HAVE_PARITY_BUG 0
142:
143: #if HAVE_BSD_TTY
144: #ifdef sony
145: #undef HAVE_PARITY_BUG
146: #define HAVE_PARITY_BUG 1
147: #endif
148: #endif
149:
150: /* On Ultrix 4.0, at least, setting CBREAK causes input characters to
151: be stripped, regardless of the setting of LPASS8 and LLITOUT. This
152: can be worked around by using the termio call to reset ISTRIP.
153: This probably does not apply to any other operating system.
154: Setting HAVE_STRIP_BUG to 1 will use this workaround. */
155: #define HAVE_STRIP_BUG 0
156:
157: #if HAVE_BSD_TTY
158: #ifdef ultrix
159: #undef HAVE_STRIP_BUG
160: #define HAVE_STRIP_BUG 1
161: #endif
162: #endif
163:
164: /* TIMES_TICK is the fraction of a second which times(2) returns (for
165: example, if times returns 100ths of a second TIMES_TICK should be
166: set to 100). On a true POSIX system (one which has the sysconf
167: function and also has _SC_CLK_TCK defined in <unistd.h>) TIMES_TICK
168: may simply be left as 0. On some systems the environment variable
169: HZ is what you want for TIMES_TICK, but on some other systems HZ
170: has the wrong value; check the man page. If you leave this set to
171: 0, the code will try to guess; it will doubtless be wrong on some
172: non-POSIX systems. If TIMES_TICK is wrong the code may report
173: incorrect file transfer times in the statistics file, but on many
174: systems times(2) will actually not be used and this value will not
175: matter at all. */
176: #define TIMES_TICK 100
177:
178: /* If your system does not support saved set user ID, set
179: HAVE_SAVED_SETUID to 0. However, this is ignored if your system
180: has the setreuid function. Most modern Unixes have one or the
181: other. If your system has the setreuid function, don't worry about
182: this define, or about the following discussion.
183:
184: If you set HAVE_SAVED_SETUID to 0, you will not be able to use uucp
185: to transfer files that the uucp user can not read. Basically, you
186: will only be able to use uucp on world-readable files. If you set
187: HAVE_SAVED_SETUID to 1, but your system does not have saved set
188: user ID, uucp will fail with an error message whenever anybody
189: other than the uucp user uses it. */
190: #define HAVE_SAVED_SETUID 1
191:
192: /* On some systems, such as the DG Aviion and, possibly, the RS/6000,
193: the setreuid function is broken. It should be possible to use
194: setreuid to swap the real and effective user ID's, but on some
195: systems it will not change the real user ID (I believe this is due
196: to a misreading of the POSIX standard). On such a system you must
197: set HAVE_BROKEN_SETREUID to 1; if you do not, you will get error
198: messages from setreuid. Systems on which setreuid exists but is
199: broken pretty much always have saved setuid. */
200: #define HAVE_BROKEN_SETREUID 0
201:
202: /* On the 3B2, and possibly other systems, nap takes an argument in
203: hundredths of a second rather than milliseconds. I don't know of
204: any way to test for this. Set HAVE_HUNDREDTHS_NAP to 1 if this is
205: true on your system. This does not matter if your system does not
206: have the nap function. */
207: #define HAVE_HUNDREDTHS_NAP 0
208:
209: /* Set PS_PROGRAM to the program to run to get a process status,
210: including the arguments to pass it. This is used by ``uustat -p''.
211: Set HAVE_PS_MULTIPLE to 1 if a comma separated list of process
212: numbers may be appended (e.g. ``ps -flp1,10,100''). Otherwise ps
213: will be invoked several times, with a single process number append
214: each time. The default definitions should work on most systems,
215: although some (such as the NeXT) will complain about the 'p'
216: option; for those, use the second set of definitions. The third
217: set of definitions are appropriate for System V. To use the second
218: or third set of definitions, change the ``#if 1'' to ``#if 0'' and
219: change the appropriate ``#if 0'' to ``#if 1''. */
220: #if 0
221: #define PS_PROGRAM "/bin/ps -lp"
222: #define HAVE_PS_MULTIPLE 0
223: #endif
224: #if 1
225: #define PS_PROGRAM "/bin/ps -l"
226: #define HAVE_PS_MULTIPLE 0
227: #endif
228: #if 0
229: #define PS_PROGRAM "/bin/ps -flp"
230: #define HAVE_PS_MULTIPLE 1
231: #endif
232:
233: /* If you use other programs that also lock devices, such as cu or
234: uugetty, the other programs and UUCP must agree on whether a device
235: is locked. This is typically done by creating a lock file in a
236: specific directory; the lock files are generally named
237: LCK..something or LK.something. If the LOCKDIR macro is defined,
238: these lock files will be placed in the named directory; otherwise
239: they will be placed in the default spool directory. On some HDB
240: systems the lock files are placed in /etc/locks. On some they are
241: placed in /usr/spool/locks. On the NeXT they are placed in
242: /usr/spool/uucp/LCK. */
243: #define LOCKDIR "/usr/spool/uucp"
244: /* #define LOCKDIR "/etc/locks" */
245: /* #define LOCKDIR "/usr/spool/locks" */
246: /* #define LOCKDIR "/usr/spool/uucp/LCK" */
247:
248: /* You must also specify the format of the lock files by setting
249: exactly one of the following macros to 1. Check an existing lock
250: file to decide which of these choices is more appropriate.
251:
252: The HDB style is to write the locking process ID in ASCII, passed
253: to ten characters, followed by a newline.
254:
255: The V2 style is to write the locking process ID as four binary
256: bytes in the host byte order. Many BSD derived systems use this
257: type of lock file, including the NeXT.
258:
259: SCO lock files are similar to HDB lock files, but always lock the
260: lowercase version of the tty (i.e., LCK..tty2a is created if you
261: are locking tty2A). They are appropriate if you are using Taylor
262: UUCP on an SCO Unix, SCO Xenix, or SCO Open Desktop system.
263:
264: SVR4 lock files are also similar to HDB lock files, but they use a
265: different naming convention. The filenames are LK.xxx.yyy.zzz,
266: where xxx is the major device number of the device holding the
267: special device file, yyy is the major device number of the port
268: device itself, and zzz is the minor device number of the port
269: device.
270:
271: Coherent use a completely different method of terminal locking.
272: See unix/cohtty for details. For locks other than for terminals,
273: HDB type lock files are used. */
274: #define HAVE_V2_LOCKFILES 0
275: #define HAVE_HDB_LOCKFILES 0
276: #define HAVE_SCO_LOCKFILES 0
277: #define HAVE_SVR4_LOCKFILES 0
278: #define HAVE_COHERENT_LOCKFILES 1
279:
280: /* If your system supports Internet mail addresses (which look like
281: [email protected] rather than system!user), HAVE_INTERNET_MAIL
282: should be set to 1. This is checked by uuxqt when sending error
283: (or success, if requested) notifications to the person who
284: submitted the job. */
285: #define HAVE_INTERNET_MAIL 1
286:
287: /* Adminstrative decisions. */
288:
289: /* Set USE_RCS_ID to 1 if you want the RCS ID strings compiled into
290: the executable. Leaving them out will decrease the executable
291: size. Leaving them in will make it easier to determine which
292: version you are running. */
293: #define USE_RCS_ID 0
294:
295: /* DEBUG controls how much debugging information is compiled into the
296: code. If DEBUG is defined as 0, no sanity checks will be done and
297: no debugging messages will be compiled in. If DEBUG is defined as
298: 1 sanity checks will be done but there will still be no debugging
299: messages. If DEBUG is 2 than debugging messages will be compiled
300: in. When initially testing, DEBUG should be 2, and you should
301: probably leave it at 2 unless a small reduction in the executable
302: file size will be very helpful. */
303: #define DEBUG 2
304:
305: /* Set the default grade to use for a uucp command if the -g option is
306: not used. The grades, from highest to lowest, are 0 to 9, A to Z,
307: a to z. */
308: #define BDEFAULT_UUCP_GRADE ('N')
309:
310: /* Set the default grade to use for a uux command if the -g option is
311: not used. */
312: #define BDEFAULT_UUX_GRADE ('N')
313:
314: /* To compile in use of the new style of configuration files described
315: in the documentation, set HAVE_TAYLOR_CONFIG to 1. */
316: #define HAVE_TAYLOR_CONFIG 1
317:
318: /* To compile in use of V2 style configuration files (L.sys, L-devices
319: and so on), set HAVE_V2_CONFIG to 1. To compile in use of HDB
320: style configuration files (Systems, Devices and so on) set
321: HAVE_HDB_CONFIG to 1. The files will be looked up in the
322: oldconfigdir directory as defined in the Makefile.
323:
324: You may set any or all of HAVE_TAYLOR_CONFIG, HAVE_V2_CONFIG and
325: HAVE_HDB_CONFIG to 1 (you must set at least one of the macros).
326: When looking something up (a system, a port, etc.) the new style
327: configuration files will be read first, followed by the V2
328: configuration files, followed by the HDB configuration files. */
329: #define HAVE_V2_CONFIG 0
330: #define HAVE_HDB_CONFIG 0
331:
332: /* Exactly one of the following macros must be set to 1. The exact
333: format of the spool directories is explained in unix/spool.c.
334:
335: SPOOLDIR_V2 -- Use a Version 2 (original UUCP) style spool directory
336: SPOOLDIR_BSD42 -- Use a BSD 4.2 style spool directory
337: SPOOLDIR_BSD43 -- Use a BSD 4.3 style spool directory
338: SPOOLDIR_HDB -- Use a HDB (BNU) style spool directory
339: SPOOLDIR_ULTRIX -- Use an Ultrix style spool directory
340: SPOOLDIR_SVR4 -- Use a System V Release 4 spool directory
341: SPOOLDIR_TAYLOR -- Use a new style spool directory
342:
343: If you are not worried about compatibility with a currently running
344: UUCP, use SPOOLDIR_TAYLOR. */
345: #define SPOOLDIR_V2 0
346: #define SPOOLDIR_BSD42 0
347: #define SPOOLDIR_BSD43 0
348: #define SPOOLDIR_HDB 1
349: #define SPOOLDIR_ULTRIX 0
350: #define SPOOLDIR_SVR4 0
351: #define SPOOLDIR_TAYLOR 0
352:
353: /* You must select which type of logging you want by setting exactly
354: one of the following to 1. These control output to the log file
355: and to the statistics file.
356:
357: If you define HAVE_TAYLOR_LOGGING, each line in the log file will
358: look something like this:
359:
360: uucico uunet uucp (1991-12-10 09:04:34.45 16390) Receiving uunet/D./D.uunetSwJ72
361:
362: and each line in the statistics file will look something like this:
363:
364: uucp uunet (1991-12-10 09:04:40.20) received 2371 bytes in 5 seconds (474 bytes/sec)
365:
366: If you define HAVE_V2_LOGGING, each line in the log file will look
367: something like this:
368:
369: uucico uunet uucp (12/10-09:04 16390) Receiving uunet/D./D.uunetSwJ72
370:
371: and each line in the statistics file will look something like this:
372:
373: uucp uunet (12/10-09:04 16390) (692373862) received data 2371 bytes 5 seconds
374:
375: If you define HAVE_HDB_LOGGING, each program will by default use a
376: separate log file. For uucico talking to uunet, for example, it
377: will be /usr/spool/uucp/.Log/uucico/uunet. Each line will look
378: something like this:
379:
380: uucp uunet (12/10-09:04:22,16390,1) Receiving uunet/D./D.uunetSwJ72
381:
382: and each line in the statistics file will look something like this:
383:
384: uunet!uucp M (12/10-09:04:22) (C,16390,1) [ttyXX] <- 2371 / 5.000 secs, 474 bytes/sec
385:
386: The main reason to prefer one format over another is that you may
387: have shell scripts which expect the files to have a particular
388: format. If you have none, choose whichever format you find more
389: appealing. */
390: #define HAVE_TAYLOR_LOGGING 0
391: #define HAVE_V2_LOGGING 0
392: #define HAVE_HDB_LOGGING 1
393:
394: /* If you would like the log, debugging and statistics files to be
395: closed after each message, set CLOSE_LOGFILES to 1. This will
396: permit the log files to be easily moved. If a log file does not
397: exist when a new message is written out, it will be created.
398: Setting CLOSE_LOGFILES to 1 will obviously require slightly more
399: processing time. */
400: #define CLOSE_LOGFILES 0
401:
402: /* The name of the default spool directory. If HAVE_TAYLOR_CONFIG is
403: set to 1, this may be overridden by the ``spool'' command in the
404: configuration file. */
405: #define SPOOLDIR "/usr/spool/uucp"
406:
407: /* The name of the default public directory. If HAVE_TAYLOR_CONFIG is
408: set to 1, this may be overridden by the ``pubdir'' command in the
409: configuration file. Also, a particular system may be given a
410: specific public directory by using the ``pubdir'' command in the
411: system file. */
412: #define PUBDIR "/usr/spool/uucppublic"
413:
414: /* The default command path. This is a space separated list of
415: directories. Remote command executions requested by uux are looked
416: up using this path. If you are using HAVE_TAYLOR_CONFIG, the
417: command path may be overridden for a particular system. For most
418: systems, you should just make sure that the programs rmail and
419: rnews can be found using this path. */
420: #define CMDPATH "/bin /usr/bin /usr/local/bin"
421:
422: /* The default amount of free space to require for systems that do not
423: specify an amount with the ``free-space'' command. This is only
424: used when talking to another instance of Taylor UUCP; if accepting
425: a file would not leave at least this many bytes free on the disk,
426: it will be refused. */
427: #define DEFAULT_FREE_SPACE (50000)
428:
429: /* While a file is being received, Taylor UUCP will periodically check
430: to see if there is enough free space remaining on the disk. If
431: there is not enough space available on the disk (as determined by
432: DEFAULT_FREE_SPACE, above, or the ``free-space'' command for the
433: system) the communication will be aborted. The disk will be
434: checked each time FREE_SPACE_DELTA bytes are received. Lower
435: values of FREE_SPACE_DELTA are less likely to fill up the disk, but
436: will also waste more time checking the amount of free space. To
437: avoid checking the disk while the file is being received, set
438: FREE_SPACE_DELTA to 0. */
439: #define FREE_SPACE_DELTA (0)
440:
441: /* It is possible for an execute job to request to be executed using
442: sh(1), rather than execve(2). This is such a security risk, it is
443: being disabled by default; to allow such jobs, set the following
444: macro to 1. */
445: #define ALLOW_SH_EXECUTION 0
446:
447: /* If a command executed on behalf of a remote system takes a filename
448: as an argument, a security breach may be possible (note that on my
449: system neither of the default commands, rmail and rnews, take
450: filename arguments). If you set ALLOW_FILENAME_ARGUMENTS to 0, all
451: arguments to a command will be checked; if any argument
452: 1) starts with ../
453: 2) contains the string /../
454: 3) begins with a / but does not name a file that may be sent or
455: received (according to the specified ``remote-send'' and
456: ``remote-receive'')
457: the command will be rejected. By default, any argument is
458: permitted. */
459: #define ALLOW_FILENAME_ARGUMENTS 1
460:
461: #if HAVE_TAYLOR_LOGGING
462:
463: /* The default log file when using HAVE_TAYLOR_LOGGING. When using
464: HAVE_TAYLOR_CONFIG, this may be overridden by the ``logfile''
465: command in the configuration file. */
466: #define LOGFILE "/usr/spool/uucp/Log"
467:
468: /* The default statistics file when using HAVE_TAYLOR_LOGGING. When
469: using HAVE_TAYLOR_CONFIG, this may be overridden by the
470: ``statfile'' command in the configuration file. */
471: #define STATFILE "/usr/spool/uucp/Stats"
472:
473: /* The default debugging file when using HAVE_TAYLOR_LOGGING. When
474: using HAVE_TAYLOR_CONFIG, this may be overridden by the
475: ``debugfile'' command in the configuration file. */
476: #define DEBUGFILE "/usr/spool/uucp/Debug"
477:
478: #endif /* HAVE_TAYLOR_LOGGING */
479:
480: #if HAVE_V2_LOGGING
481:
482: /* The default log file when using HAVE_V2_LOGGING. When using
483: HAVE_TAYLOR_CONFIG, this may be overridden by the ``logfile''
484: command in the configuration file. */
485: #define LOGFILE "/usr/spool/uucp/LOGFILE"
486:
487: /* The default statistics file when using HAVE_V2_LOGGING. When using
488: HAVE_TAYLOR_CONFIG, this may be overridden by the ``statfile''
489: command in the configuration file. */
490: #define STATFILE "/usr/spool/uucp/SYSLOG"
491:
492: /* The default debugging file when using HAVE_V2_LOGGING. When using
493: HAVE_TAYLOR_CONFIG, this may be overridden by the ``debugfile''
494: command in the configuration file. */
495: #define DEBUGFILE "/usr/spool/uucp/DEBUG"
496:
497: #endif /* HAVE_V2_LOGGING */
498:
499: #if HAVE_HDB_LOGGING
500:
501: /* The default log file when using HAVE_HDB_LOGGING. When using
502: HAVE_TAYLOR_CONFIG, this may be overridden by the ``logfile''
503: command in the configuration file. The first %s in the string will
504: be replaced by the program name (e.g. uucico); the second %s will
505: be replaced by the system name (if there is no appropriate system,
506: "ANY" will be used). No other '%' character may appear in the
507: string. */
508: #define LOGFILE "/usr/spool/uucp/.Log/%s/%s"
509:
510: /* The default statistics file when using HAVE_HDB_LOGGING. When using
511: HAVE_TAYLOR_CONFIG, this may be overridden by the ``statfile''
512: command in the configuration file. */
513: #define STATFILE "/usr/spool/uucp/.Admin/xferstats"
514:
515: /* The default debugging file when using HAVE_HDB_LOGGING. When using
516: HAVE_TAYLOR_CONFIG, this may be overridden by the ``debugfile''
517: command in the configuration file. */
518: #define DEBUGFILE "/usr/spool/uucp/.Admin/audit.local"
519:
520: #endif /* HAVE_HDB_LOGGING */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.