xref: /titanic_44/usr/src/cmd/bnu/uucp.h (revision b7f45089ccbe01bab3d7c7377b49d80d2ae18a69)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1998 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 
31 #pragma ident	"%Z%%M%	%I%	%E% SMI"
32 
33 #ifndef _UUCP_H
34 #define _UUCP_H
35 
36 #include <unistd.h>
37 #include <stdlib.h>
38 #include <string.h>
39 #include <locale.h>
40 #include <wchar.h>
41 #include <widec.h>
42 #include <wctype.h>
43 #include <ulimit.h>
44 #include <values.h>
45 
46 #include "parms.h"
47 
48 #ifdef ATTSV
49 #define ATTSVKILL
50 #define ATTSVTTY
51 #define UNAME
52 #ifdef ATTSVR4
53 #define	ATTSVR3
54 #endif /*ATTSVR4*/
55 #endif /*ATTSV*/
56 
57 #ifdef BSD4_3
58 #define BSD4_2
59 #define	BSDINETD
60 #endif /*BSD4_3 */
61 
62 #ifdef DIAL
63 #define EXTERN static
64 #define GLOBAL static
65 #else
66 #define EXTERN extern
67 #define GLOBAL
68 #endif
69 
70 #ifdef BSD4_2
71 #define V7
72 #define ATTSVKILL
73 #undef NONAP	/* conn.c has a nap() for 4.2 -- it's called select() */
74 #undef FASTTIMER
75 #endif /* BSD4_2 */
76 
77 #ifdef V8
78 #define V7
79 #define ATTSVKILL
80 #define UNAME
81 #endif /* V8 */
82 
83 #ifdef FASTTIMER
84 #undef NONAP
85 #endif
86 
87 #include <stdio.h>
88 #include <ctype.h>
89 #include <setjmp.h>
90 #include <sys/param.h>
91 
92 /*
93  * param.h includes types.h and signal.h in 4bsd
94  */
95 #ifdef V7
96 #ifdef ATTSVTTY
97 #include <termio.h>
98 #else /* ATTSVTTY */
99 #include <sgtty.h>
100 #endif /* ATTSVTTY */
101 #include <sys/timeb.h>
102 #ifdef BSD4_2
103 #include <fcntl.h>
104 #endif /* BSD4_2 */
105 #else /* !V7 */
106 #include <termio.h>
107 #include <sys/types.h>
108 #include <signal.h>
109 #include <fcntl.h>
110 #endif /* V7 */
111 
112 #include <sys/stat.h>
113 #include <utime.h>
114 #include <dirent.h>
115 
116 #ifdef BSD4_2
117 #include <sys/time.h>
118 #else /* !BSD4_2 */
119 #include <time.h>
120 #endif /* BSD4_2 */
121 
122 #include <sys/times.h>
123 #include <errno.h>
124 
125 #ifdef ATTSV
126 #ifdef ATTSVR4
127 #include <sys/mkdev.h>
128 #else /* !ATTSVR4 */
129 #include <sys/sysmacros.h>
130 #endif /* ATTSVR4 */
131 #endif /* ATTSV */
132 
133 #ifdef	RT
134 #include "rt/types.h"
135 #include "rt/unix/param.h"
136 #include "rt/stat.h"
137 #include <sys/ustat.h>
138 #endif /* RT */
139 
140 #include <sysexits.h>
141 
142 #ifndef ATTSVR4
143 #define	const
144 #endif /* ATTSVR4 */
145 
146 /* what mode should user files be allowed to have upon creation? */
147 /* NOTE: This does not allow setuid or execute bits on transfer. */
148 #define LEGALMODE (mode_t) 0666
149 
150 /* what mode should public files have upon creation? */
151 #define PUB_FILEMODE (mode_t) 0666
152 
153 /* what mode should log files have upon creation? */
154 #define LOGFILEMODE (mode_t) 0644
155 
156 /* what mode should C. files have upon creation? */
157 #define CFILEMODE (mode_t) 0644
158 
159 /* what mode should D. files have upon creation? */
160 #define DFILEMODE (mode_t) 0600
161 
162 /* define the value of PUBMASK, used for creating "public" directories */
163 #define PUBMASK (mode_t) 0000
164 
165 /* what mode should public directories have upon creation? */
166 #define PUB_DIRMODE (mode_t) 0777
167 
168 /* define the value of DIRMASK, used for creating "system" subdirectories */
169 #define DIRMASK (mode_t) 0022
170 
171 #define MAXSTART	300	/* how long to wait on startup */
172 
173 /* define the last characters for ACU  (used for 801/212 dialers) */
174 #define ACULAST "<"
175 
176 /*  caution - the fillowing names are also in Makefile
177  *    any changes here have to also be made there
178  *
179  * it's a good idea to make directories .foo, since this ensures
180  * that they'll be ignored by processes that search subdirectories in SPOOL
181  *
182  *  XQTDIR=/var/uucp/.Xqtdir
183  *  CORRUPT=/var/uucp/.Corrupt
184  *  LOGDIR=/var/uucp/.Log
185  *  SEQDIR=/var/uucp/.Sequence
186  *  STATDIR=/var/uucp/.Status
187  *
188  */
189 
190 /* where to put the STST. files? */
191 #define STATDIR		"/var/uucp/.Status"
192 
193 /* where should logfiles be kept? */
194 #define LOGUUX		"/var/uucp/.Log/uux"
195 #define LOGUUXQT	"/var/uucp/.Log/uuxqt"
196 #define LOGUUCP		"/var/uucp/.Log/uucp"
197 #define LOGCICO		"/var/uucp/.Log/uucico"
198 
199 /* some sites use /var/uucp/.Corrupt and /var/uucp/.Xqtdir here */
200 /* use caution since things are linked into there from /var/spool/uucp */
201 #define CORRUPTDIR	"/var/spool/uucp/.Corrupt"
202 #define XQTDIR		"/var/spool/uucp/.Xqtdir"
203 
204 /* how much of a system name can we print in a [CX]. file? */
205 /* MAXBASENAME - 1 (pre) - 1 ('.') - 1 (grade) - 4 (sequence number) */
206 #define SYSNSIZE (MAXBASENAME - 7)
207 
208 #ifdef USRSPOOLLOCKS
209 #define LOCKPRE		"/var/spool/locks/LCK."
210 #else /*!USRSPOOLLOCKS*/
211 #define LOCKPRE		"/var/spool/uucp/LCK."
212 #endif /* USRSPOOLLOCKS */
213 
214 #define SQFILE		"/etc/uucp/SQFILE"
215 #define SQTMP		"/etc/uucp/SQTMP"
216 #define SLCKTIME	5400	/* system/device timeout (LCK.. files) */
217 #define DIALCODES	"/etc/uucp/Dialcodes"
218 #define PERMISSIONS	"/etc/uucp/Permissions"
219 #define SYSNAMEFILE	"/etc/uucp/Sysname"
220 
221 #define SPOOL		"/var/spool/uucp"
222 #define SEQDIR		"/var/uucp/.Sequence"
223 
224 #define X_LOCKTIME	3600
225 #ifdef USRSPOOLLOCKS
226 #define SEQLOCK		"/var/spool/locks/LCK.SQ."
227 #define SQLOCK		"/var/spool/locks/LCK.SQ"
228 #define X_LOCK		"/var/spool/locks/LCK.X"
229 #define S_LOCK		"/var/spool/locks/LCK.S"
230 #define L_LOCK		"/var/spool/locks/LK"
231 #define X_LOCKDIR	"/var/spool/locks"	/* must be dir part of above */
232 #else /*!USRSPOOLLOCKS*/
233 #define SEQLOCK		"/var/spool/uucp/LCK.SQ."
234 #define SQLOCK		"/var/spool/uucp/LCK.SQ"
235 #define X_LOCK		"/var/spool/uucp/LCK.X"
236 #define S_LOCK		"/var/spool/uucp/LCK.S"
237 #define L_LOCK		"/var/spool/uucp/LK"
238 #define X_LOCKDIR	"/var/spool/uucp"	/* must be dir part of above */
239 #endif /* USRSPOOLLOCKS */
240 #define X_LOCKPRE	"LCK.X"		/* must be last part of above */
241 #define	S_LOCKPRE	"LCK.S"
242 
243 /*
244  * Note: this should be "/usr/spool/uucppublic", not "/var/spool/uucppublic",
245  * because if a Permissions file entry doesn't explicitly list directories to
246  * which and from which files can be copied you can only copy files to and from
247  * PUBDIR, and most systems out there will think PUBDIR is
248  * "/usr/spool/uucppublic" not "/var/spool/uucppublic" (i.e., if you change
249  * this, other systems may be rudely surprised when they try to get things from
250  * or to PUBDIR).
251  */
252 #define PUBDIR		"/usr/spool/uucppublic"
253 #define ADMIN		"/var/uucp/.Admin"
254 #define ERRLOG		"/var/uucp/.Admin/errors"
255 #define SYSLOG		"/var/uucp/.Admin/xferstats"
256 #define RMTDEBUG	"/var/uucp/.Admin/audit"
257 #define CLEANUPLOGFILE	"/var/uucp/.Admin/uucleanup"
258 #define CMDLOG		"/var/uucp/.Admin/command"
259 #define PERFLOG		"/var/uucp/.Admin/perflog"
260 #define ACCOUNT		"/var/uucp/.Admin/account"
261 #define SECURITY	"/var/uucp/.Admin/security"
262 
263 /*
264  * WORKSPACE should be in the same filesystem as SPOOL so that "mv"
265  * between the two will work.  Otherwise, the file must be copied
266  * and a window exists during which the file is mode 666.
267  */
268 #define	WORKSPACE	"/var/spool/uucp/.Workspace"
269 
270 #define SQTIME		60
271 #define TRYCALLS	2	/* number of tries to dial call */
272 #define MINULIMIT	(1L<<11)	/* minimum reasonable ulimit */
273 #define	MAX_LOCKTRY	5	/* number of attempts to lock device */
274 
275 /*
276  * CDEBUG is for communication line debugging
277  * DEBUG is for program debugging
278  * #define SMALL to compile without the DEBUG code
279  */
280 
281 #ifndef DIAL
282 #define CDEBUG(l, f, s) if (Debug >= l) fprintf(stderr, f, s)
283 #else
284 #define CDEBUG(l, f, s)
285 #define SMALL
286 #endif
287 
288 #ifndef SMALL
289 #define DEBUG(l, f, s) if (Debug >= l) fprintf(stderr, f, s)
290 #else
291 #define DEBUG(l, f, s)
292 #endif /* SMALL */
293 
294 /*
295  * VERBOSE is used by cu and ct to inform the user of progress
296  * In other programs, the Value of Verbose is always 0.
297  */
298 #define VERBOSE(f, s) { if (Verbose > 0) fprintf(stderr, f, s); }
299 
300 #define PREFIX(pre, str)	(strncmp((pre), (str), strlen(pre)) == SAME)
301 #define BASENAME(str, c) ((Bnptr = strrchr((str), c)) ? (Bnptr + 1) : (str))
302 #define EQUALS(a,b)	((a != CNULL) && (b != CNULL) && (strcmp((a),(b))==SAME))
303 #define WEQUALS(a,b)	((a != CNULL) && (b != CNULL) && (wcscmp((a),(b))==SAME))
304 #define EQUALSN(a,b,n)	((a != CNULL) && (b != CNULL) && (strncmp((a),(b),(n))==SAME))
305 #define WEQUALSN(a,b,n)	((a != CNULL) && (b != CNULL) && (wcsncmp((a),(b),(n))==SAME))
306 #define LASTCHAR(s)	(s+strlen(s)-1)
307 
308 #define SAME 0
309 #define ANYREAD 04
310 #define ANYWRITE 02
311 #define FAIL -1
312 #define SUCCESS 0
313 #define NULLCHAR	'\0'
314 #define CNULL ((void *) 0)
315 #define STBNULL (struct sgttyb *) 0
316 #define MASTER 1
317 #define SLAVE 0
318 #define MAXBASENAME 14 /* should be DIRSIZ but that is now fs dependent */
319 #define MAXFULLNAME BUFSIZ
320 #define MAXNAMESIZE	64	/* /var/spool/uucp/<14 chars>/<14 chars>+slop */
321 #define CONNECTTIME 30
322 #define EXPECTTIME 45
323 #define MSGTIME 60
324 #define NAMESIZE MAXBASENAME+1
325 #define	SIZEOFPID	10		/* maximum number of digits in a pid */
326 #define EOTMSG "\004\n\004\n"
327 #define CALLBACK 1
328 
329 /* manifests for sysfiles.c's sysaccess()	*/
330 /* check file access for REAL user id */
331 #define	ACCESS_SYSTEMS	1
332 #define	ACCESS_DEVICES	2
333 #define	ACCESS_DIALERS	3
334 /* check file access for EFFECTIVE user id */
335 #define	EACCESS_SYSTEMS	4
336 #define	EACCESS_DEVICES	5
337 #define	EACCESS_DIALERS	6
338 
339 /* manifest for chkpth flag */
340 #define CK_READ		0
341 #define CK_WRITE	1
342 
343 /*
344  * commands
345  */
346 #define SHELL		"/usr/bin/sh"
347 #define MAIL		"mail"
348 #define UUCICO		"/usr/lib/uucp/uucico"
349 #define UUXQT		"/usr/lib/uucp/uuxqt"
350 #define UUX		"/usr/bin/uux"
351 #define UUCP		"/usr/bin/uucp"
352 
353 
354 /* system status stuff */
355 #define SS_OK			0
356 #define SS_NO_DEVICE		1
357 #define SS_TIME_WRONG		2
358 #define SS_INPROGRESS		3
359 #define SS_CONVERSATION		4
360 #define SS_SEQBAD		5
361 #define SS_LOGIN_FAILED		6
362 #define SS_DIAL_FAILED		7
363 #define SS_BAD_LOG_MCH		8
364 #define SS_LOCKED_DEVICE	9
365 #define SS_ASSERT_ERROR		10
366 #define SS_BADSYSTEM		11
367 #define SS_CANT_ACCESS_DEVICE	12
368 #define SS_DEVICE_FAILED	13	/* used for interface failure */
369 #define SS_WRONG_MCH		14
370 #define SS_CALLBACK		15
371 #define SS_RLOCKED		16
372 #define SS_RUNKNOWN		17
373 #define SS_RLOGIN		18
374 #define SS_UNKNOWN_RESPONSE	19
375 #define SS_STARTUP		20
376 #define SS_CHAT_FAILED		21
377 #define SS_CALLBACK_LOOP	22
378 
379 #define MAXPH	60	/* maximum phone string size */
380 #define	MAXC	BUFSIZ
381 
382 #define	TRUE	1
383 #define	FALSE	0
384 #define NAMEBUF	32
385 
386 /* The call structure is used by ct.c, cu.c, and dial.c.	*/
387 
388 static struct call {
389 	char *speed;		/* transmission baud rate */
390 	char *line;		/* device name for outgoing line */
391 	char *telno;		/* ptr to tel-no digit string */
392 	char *type;		/* type of device to use for call. */
393 };
394 
395 /* structure of an Systems file line */
396 #define F_MAX	50	/* max number of fields in Systems file line */
397 #define F_NAME 0
398 #define F_TIME 1
399 #define F_TYPE 2
400 #define F_CLASS 3	/* an optional prefix and the speed */
401 #define F_PHONE 4
402 #define F_LOGIN 5
403 
404 /* structure of an Devices file line */
405 #define D_TYPE 0
406 #define D_LINE 1
407 #define D_CALLDEV 2
408 #define D_CLASS 3
409 #define D_CALLER 4
410 #define D_ARG 5
411 #define D_MAX	50	/* max number of fields in Devices file line */
412 
413 #define D_ACU 1
414 #define D_DIRECT 2
415 #define D_PROT 4
416 
417 #define GRADES "/etc/uucp/Grades"
418 
419 #define	D_QUEUE	'Z'	/* default queue */
420 
421 /* past here, local changes are not recommended */
422 #define CMDPRE		'C'
423 #define DATAPRE		'D'
424 #define XQTPRE		'X'
425 
426 /*
427  * stuff for command execution
428  */
429 #define X_RQDFILE	'F'
430 #define X_STDIN		'I'
431 #define X_STDOUT	'O'
432 #define X_STDERR	'E'
433 #define X_CMD		'C'
434 #define X_USER		'U'
435 #define X_BRINGBACK	'B'
436 #define X_MAILF		'M'
437 #define X_RETADDR	'R'
438 #define X_COMMENT	'#'
439 #define X_NONZERO	'Z'
440 #define X_SENDNOTHING	'N'
441 #define X_SENDZERO	'n'
442 #define X_JOBID		'J'
443 
444 
445 /* This structure describes call routines */
446 struct caller {
447 	char	*CA_type;
448 	int	(*CA_caller)();
449 };
450 
451 /* structure for a saved C file */
452 
453 static struct cs_struct {
454 	char	file[NAMESIZE];
455 	char	sys[NAMESIZE+5];
456 	char	sgrade[NAMESIZE];
457 	char	grade;
458 	long	jsize;
459 };
460 
461 /* This structure describes dialing routines */
462 struct dialer {
463 	char	*DI_type;
464 	int	(*DI_dialer)();
465 };
466 
467 struct nstat {
468 	pid_t	t_pid;		/* process id				*/
469 	time_t	t_start;	/* start time				*/
470 	time_t	t_scall;	/* start call to system			*/
471 	time_t	t_ecall;	/* end call to system			*/
472 	time_t	t_tacu;		/* acu time				*/
473 	time_t	t_tlog;		/* login time				*/
474 	time_t	t_sftp;		/* start file transfer protocol		*/
475 	time_t	t_sxf;		/* start xfer 				*/
476 	time_t	t_exf;		/* end xfer 				*/
477 	time_t	t_eftp;		/* end file transfer protocol		*/
478 	time_t	t_qtime;	/* time file queued			*/
479 	int	t_ndial;	/* # of dials				*/
480 	int	t_nlogs;	/* # of login trys			*/
481 	struct tms t_tbb;	/* start execution times		*/
482 	struct tms t_txfs;	/* xfer start times			*/
483 	struct tms t_txfe;	/* xfer end times 			*/
484 	struct tms t_tga;	/* garbage execution times		*/
485 };
486 
487 /* This structure describes the values from Limits file */
488 struct limits {
489 	int	totalmax;	/* overall limit */
490 	int	sitemax;	/* limit per site */
491 	char	mode[64];	/* uucico mode */
492 };
493 
494 /* external declarations */
495 
496 EXTERN ssize_t (*Read)(), (*Write)();
497 #if defined(__STDC__)
498 EXTERN int (*Ioctl)(int,int,...);
499 #else
500 EXTERN int (*Ioctl)();
501 #endif
502 EXTERN int Ifn, Ofn;
503 EXTERN int Debug, Verbose;
504 EXTERN uid_t Uid, Euid;		/* user-id and effective-uid */
505 EXTERN long Ulimit;
506 EXTERN mode_t Dev_mode;		/* save device mode here */
507 EXTERN char Wrkdir[];
508 EXTERN long Retrytime;
509 EXTERN char **Env;
510 EXTERN char Uucp[];
511 EXTERN char Pchar;
512 EXTERN struct nstat Nstat;
513 EXTERN char Dc[];			/* line name			*/
514 EXTERN int Seqn;			/* sequence #			*/
515 EXTERN int Role;
516 EXTERN int Sgrades;		/* flag for administrator defined service grades */
517 EXTERN char Grade;
518 EXTERN char Logfile[MAXFULLNAME];
519 EXTERN char Rmtname[MAXFULLNAME];
520 EXTERN char JobGrade[MAXBASENAME+1];
521 EXTERN char User[MAXFULLNAME];
522 EXTERN char Loginuser[NAMESIZE];
523 EXTERN char *Spool;
524 EXTERN char *Pubdir;
525 EXTERN char Myname[];
526 EXTERN char Progname[];
527 EXTERN char RemSpool[];
528 EXTERN char *Bnptr;		/* used when BASENAME macro is expanded */
529 EXTERN char *Shchar;		/* shell meta-charaters */
530 extern char *sys_errlist[];
531 EXTERN int SizeCheck;		/* ulimit check supported flag */
532 EXTERN long RemUlimit;		/* remote ulimit if supported */
533 EXTERN int Restart;		/* checkpoint restart supported flag */
534 
535 EXTERN char Jobid[NAMESIZE];	/* Jobid of current C. file */
536 EXTERN int Uerror;		/* global error code */
537 EXTERN char *UerrorText[];	/* text for error code */
538 
539 /*	Some globals needed for section 2 and section 3 routines */
540 extern char *optarg;	/* for getopt() */
541 extern int optind;	/* for getopt() */
542 
543 #define UERRORTEXT		UerrorText[Uerror]
544 #define UTEXT(x)		UerrorText[x]
545 
546 /* things get kind of tricky beyond this point -- please stay out */
547 
548 #ifdef ATTSV
549 #define index strchr
550 #define rindex strrchr
551 #else /*!ATTSV*/
552 #define strchr index
553 #define strrchr rindex
554 #endif /*ATTSV*/
555 
556 #ifdef BSD4_2
557 #define memcpy(s1,s2,n) bcopy(s2,s1,n)
558 extern void	bcopy();
559 #else
560 #ifndef ATTSVR4
561 #define vfork fork
562 extern char	*memcpy();
563 #endif
564 #endif
565 
566 EXTERN struct stat __s_;
567 #define F_READANY(f)	((fstat((f),&__s_)==0) && ((__s_.st_mode&(0004))!=0) )
568 #define READANY(f)	((stat((f),&__s_)==0) && ((__s_.st_mode&(0004))!=0) )
569 
570 #define WRITEANY(f)	((stat((f),&__s_)==0) && ((__s_.st_mode&(0002))!=0) )
571 #define DIRECTORY(f)	((stat((f),&__s_)==0) && ((__s_.st_mode&(S_IFMT))==S_IFDIR) )
572 #define NOTEMPTY(f)	((stat((f),&__s_)==0) && (__s_.st_size!=0) )
573 
574 /* standard functions used */
575 
576 extern char	*strcat(), *strcpy(), *strncpy(), *strrchr();
577 extern char	*strchr(), *strpbrk();
578 extern char	*index(), *rindex(), *getlogin(), *ttyname(); /*, *malloc();
579 extern char	*calloc(); */
580 extern long	lseek(), atol();
581 extern time_t	time();
582 extern int	pipe(), close(), getopt();
583 extern struct tm	*localtime();
584 extern FILE	*popen();
585 
586 /* uucp functions and subroutine */
587 EXTERN void	(*genbrk)();
588 extern int	iswrk(), gtwvec();			/* anlwrk.c */
589 extern void	findgrade();				/* grades.c */
590 extern void	chremdir(), mkremdir();			/* chremdir.c */
591 extern void	toCorrupt();				/* cpmv.c  */
592 extern int	xmv();					/* cpmv.c  */
593 
594 EXTERN int	getargs();				/* getargs.c */
595 EXTERN void	bsfix();				/* getargs.c */
596 extern char	*_uu_setlocale();			/* getargs.c */
597 extern void	_uu_resetlocale();			/* getargs.c */
598 extern char	*getprm();				/* getprm.c */
599 
600 extern char	*next_token();				/* permission.c */
601 extern char	*nextarg();				/* permission.c */
602 extern int	getuline();				/* permission.c */
603 
604 EXTERN void	logent(), usyslog(), ucloselog();	/* logent.c */
605 extern void	commandlog();				/* logent.c */
606 extern time_t	millitick();				/* logent.c */
607 
608 extern unsigned long	getfilesize();			/* statlog.c */
609 extern void 		putfilesize();			/* statlog.c */
610 
611 EXTERN char	*protoString();				/* permission.c */
612 extern		logFind(), mchFind();			/* permission.c */
613 extern		chkperm(), chkpth();			/* permission.c */
614 extern		cmdOK(), switchRole();			/* permission.c */
615 extern		callBack(), requestOK();		/* permission.c */
616 extern		noSpool();				/* permission.c */
617 extern void	myName();				/* permission.c */
618 
619 extern int	mkdirs();				/* expfile.c */
620 extern int	scanlimit();				/* limits.c */
621 extern void	systat();				/* systat.c */
622 EXTERN int	fd_mklock(), fd_cklock();		/* ulockf.c */
623 EXTERN int	fn_cklock();				/* ulockf.c */
624 EXTERN int	mklock(), cklock(), umlock();		/* ulockf.c */
625 EXTERN void	fd_rmlock(), delock(), rmlock();	/* ulockf.c */
626 extern char	*timeStamp();				/* utility.c */
627 EXTERN void	assert(), errent();			/* utility.c */
628 extern void	uucpname();				/* uucpname.c */
629 extern int	versys();				/* versys.c */
630 extern void	xuuxqt(), xuucico();			/* xqt.c */
631 EXTERN void	cleanup();				/* misc main.c */
632 
633 #define ASSERT(e, s1, s2, i1) if (!(e)) {\
634 	assert(s1, s2, i1, __FILE__, __LINE__);\
635 	cleanup(FAIL);};
636 
637 #ifdef ATTSV
638 void	setbuf();
639 #else /* !ATTSV */
640 int	setbuf(), ftime();
641 char	*mktemp();
642 #endif /*ATTSV*/
643 
644 #ifdef UNAME
645 #include <sys/utsname.h>
646 #endif /* UNAME */
647 
648 #ifndef NOUSTAT
649 #ifdef V7USTAT
650 struct  ustat {
651 	daddr_t	f_tfree;	/* total free */
652 	ino_t	f_tinode;	/* total inodes free */
653 };
654 #else /* !NOUSTAT && !V7USTAT */
655 #ifdef STATFS
656 #include <sys/vfs.h>
657 #else
658 #include <ustat.h>
659 #endif /* STATFS */
660 #endif /* V7USTAT */
661 #endif /* NOUSTAT */
662 
663 #ifdef BSD4_2
664 int	gethostname();
665 #endif /* BSD4_2 */
666 
667 /* messages */
668 EXTERN char *Ct_OPEN;
669 EXTERN char *Ct_WRITE;
670 EXTERN char *Ct_READ;
671 EXTERN char *Ct_CREATE;
672 EXTERN char *Ct_ALLOCATE;
673 EXTERN char *Ct_LOCK;
674 EXTERN char *Ct_STAT;
675 EXTERN char *Ct_CHOWN;
676 EXTERN char *Ct_CHMOD;
677 EXTERN char *Ct_LINK;
678 EXTERN char *Ct_CHDIR;
679 EXTERN char *Ct_UNLINK;
680 EXTERN char *Wr_ROLE;
681 EXTERN char *Ct_CORRUPT;
682 EXTERN char *Ct_FORK;
683 EXTERN char *Ct_CLOSE;
684 EXTERN char *Ct_BADOWN;
685 EXTERN char *Fl_EXISTS;
686 
687 #endif
688