|
|
1.1 root 1: /* checkperms.h - extra defines for checkperms parser
2: * part of uucheck.
3: */
4: #include "uucheck.h"
5:
6: #ifndef EXTERN
7: # ifdef MAIN
8: # define EXTERN
9: # define EQUALS(v) = v
10: # else
11: # define EXTERN extern
12: # define EQUALS(v)
13: # endif
14: #endif EXTERN
15:
16: /* Expression to mask out all but the file mode bits. */
17: #define FMODE(statstuff) ((statstuff.st_mode)&S_IFMT)
18:
19: #define SETFAIL if(msg_type == ERROR_TOKEN) {error=TRUE;} else {warning = TRUE;}
20:
21: /* For token table used by lexer. */
22: struct token_type {
23: char *string;
24: int value;
25: };
26:
27: #define NUM_TOKENS 12 /* Size of the following table. */
28:
29: #ifdef MAIN
30: #include "y.tab.h"
31: struct token_type token_table[NUM_TOKENS] = {
32: "foreach", FOREACH,
33: "pathname", PATHNAME,
34: "error", ERROR_TOKEN,
35: "warning", WARNING_TOKEN,
36: "exist", EXIST,
37: "owner", OWNER,
38: "group", GROUP,
39: "file", FILE_TOKEN,
40: "directory", DIRECTORY,
41: "pipe", PIPE,
42: "character", CHARACTER_SPECIAL,
43: "block", BLOCK_SPECIAL
44: };
45: #else /* not MAIN */
46: extern struct token_type token_table[];
47: #endif /* MAIN */
48:
49: EXTERN char *current_path EQUALS(NULL); /* Name of the file currently being investigated. */
50: EXTERN char *current_host EQUALS(NULL); /* Loop variable for examining all hosts. */
51: EXTERN char *ret_string EQUALS(NULL); /* String for optional return messages. */
52: EXTERN char *chmod_string EQUALS(NULL); /* String for chmod descriptors. */
53: EXTERN char *id_string EQUALS(NULL); /* String for user or group names. */
54: EXTERN int major, minor; /* Major and minor numbers for special files. */
55: EXTERN int ret_number; /* Place to put value of NUMBER tokens. */
56: EXTERN struct stat current_stat; /* Stat structure from current file. */
57: EXTERN boolean it_exists; /* Set if the current file exists. */
58: EXTERN int lineno EQUALS(1); /* Approximate current line number (input file). */
59: EXTERN boolean host_looping EQUALS(FALSE);
60: EXTERN boolean last_host EQUALS(FALSE); /* Loop terminator boolean. */
61: EXTERN boolean ignore_next_indent EQUALS(FALSE); /* Used by lexer in foreach handlineg. */
62:
63: char *str_assign();
64: boolean chmod_chk();
65: boolean owner_chk();
66: boolean group_chk();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.