Commit | Line | Data |
---|---|---|
70c98dc6 KB |
1 | /* |
2 | * Copyright (c) 1986 Regents of the University of California. | |
3 | * All rights reserved. The Berkeley software License Agreement | |
4 | * specifies the terms and conditions for redistribution. | |
5 | * | |
6 | * @(#)bug.h 1.1 (Berkeley) 11/25/86 | |
7 | */ | |
8 | ||
9 | #define BUGS_HOME "owner-bugs@ucbvax.BERKELEY.EDU" | |
10 | #define BUGS_ID "bugs" | |
11 | #define MAIL_CMD "/usr/lib/sendmail -i -t -F \"Bugs Bunny\" -f owner-bugs@ucbvax.BERKELEY.EDU" | |
12 | ||
13 | /* | |
14 | * the METOO definition has the bugfiler exit with an error (-1) status | |
15 | * if there's a problem. Sendmail then mails off a copy of the problem | |
16 | * mail to "owner-bugs". This is great if you would have otherwise lost | |
17 | * the bug report. It's not so great if you get a whole bunch of mail | |
18 | * that you really don't want. | |
19 | */ | |
20 | #define METOO | |
21 | ||
22 | #include <sys/file.h> | |
23 | #define GET_LOCK { \ | |
24 | if (flock(lfd,LOCK_EX)) { \ | |
25 | perror(LOCK_FILE); \ | |
26 | exit(ERR); \ | |
27 | } \ | |
28 | } | |
29 | ||
30 | #define REL_LOCK { \ | |
31 | if (flock(lfd,LOCK_UN)) { \ | |
32 | perror(LOCK_FILE); \ | |
33 | exit(ERR); \ | |
34 | } \ | |
35 | } | |
36 | ||
37 | /* files */ | |
38 | #define ACK_FILE ".ack" /* acknowledge file */ | |
39 | #define DEF_DIR "mail" /* top-level directory */ | |
40 | #define DIST_FILE ".redist" /* redistribution file */ | |
41 | #define ERROR_FILE "log" /* error file */ | |
42 | #define LOCK_FILE "bug:lock" /* lock file name */ | |
43 | #define SUMMARY_FILE "summary" /* summary file */ | |
44 | #define TMP_BUG "errors/BUG_XXXXXX" /* tmp bug report */ | |
45 | #define TMP_FILE "/tmp/BUG_XXXXXX" /* tmp file name */ | |
46 | ||
47 | /* permissions */ | |
48 | #define DIR_MODE 0750 /* directory creation mode */ | |
49 | #define FILE_MODE 0644 /* file creation mode */ | |
50 | ||
51 | #define CHN (char *)NULL /* null arg string */ | |
52 | #define COMMENT '#' /* comment in redist file */ | |
53 | #define EOS (char)NULL /* end of string */ | |
54 | #define ERR -1 /* error return */ | |
55 | #define MAXLINELEN 200 /* max line length in message */ | |
56 | #define NO 0 /* no/false */ | |
57 | #define OK 0 /* okay return */ | |
58 | #define YES 1 /* yes/true */ | |
59 | ||
60 | typedef struct { | |
61 | short found, /* line number if found */ | |
62 | redist; /* if part of redist headers */ | |
63 | int (*valid)(); /* validation routine */ | |
64 | short len; /* length of tag */ | |
65 | char *tag, /* leading tag */ | |
66 | *line; /* actual line */ | |
67 | } HEADER; | |
68 | ||
69 | #define DATE_TAG 0 /* "Date:" offset */ | |
70 | #define FROM_TAG 1 /* "From " offset */ | |
71 | #define CFROM_TAG 2 /* "From:" offset */ | |
72 | #define INDX_TAG 3 /* "Index:" offset */ | |
73 | #define MSG_TAG 4 /* "Message-Id:" offset */ | |
74 | #define RPLY_TAG 5 /* "Reply-To:" offset */ | |
75 | #define RET_TAG 6 /* "Return-Path:" offset */ | |
76 | #define SUBJ_TAG 7 /* "Subject:" offset */ | |
77 | #define TO_TAG 8 /* "To:" offset */ | |
78 | ||
79 | /* so sizeof doesn't return 0 */ | |
80 | #include <sys/param.h> | |
81 | extern char bfr[MAXBSIZE]; /* general I/O buffer */ |