17 |
|
|
18 |
extern char logfile[PATH_MAX]; |
extern char logfile[PATH_MAX]; |
19 |
extern unsigned int options; |
extern unsigned int options; |
20 |
|
extern char charset[CHARSET_LEN]; |
21 |
extern unsigned int flags; |
extern unsigned int flags; |
22 |
extern unsigned int interval; |
extern unsigned int interval; |
23 |
extern long timeout; |
extern long timeout; |
64 |
fclose(fd); |
fclose(fd); |
65 |
|
|
66 |
#ifdef DEBUG |
#ifdef DEBUG |
67 |
printf("debug: options: %0#10x\n", options); |
printf("debug: options: %0#10x '%s'\n", options, charset); |
68 |
#endif |
#endif |
69 |
|
|
70 |
return 0; |
return 0; |
129 |
"^[[:blank:]]*JOB[[:blank:]]+([[:alnum:],_-]+)[[:blank:]]+" |
"^[[:blank:]]*JOB[[:blank:]]+([[:alnum:],_-]+)[[:blank:]]+" |
130 |
"([[:alnum:],_-]+)[[:blank:]]*\n$", |
"([[:alnum:],_-]+)[[:blank:]]*\n$", |
131 |
|
|
132 |
"^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(LOGFILE)" |
"^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(LOGFILE|CHARSET)" |
133 |
"[[:blank:]]*=[[:blank:]]*([[:print:]]+)\n$", |
"[[:blank:]]*=[[:blank:]]*(\"[[:print:]]*\"|[[:graph:]]+)" |
134 |
|
"[[:blank:]]*\n$", |
135 |
|
|
136 |
"^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(ERRORS|EXPUNGE|HEADERS|" |
"^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(ERRORS|EXPUNGE|HEADERS|" |
137 |
"NAMESPACE|SUBSCRIBE|WARNING)[[:blank:]]*=[[:blank:]]*(YES|NO)" |
"NAMESPACE|SUBSCRIBE|WARNING)[[:blank:]]*=[[:blank:]]*(YES|NO)" |
202 |
void set_options(char *line, regmatch_t * match) |
void set_options(char *line, regmatch_t * match) |
203 |
{ |
{ |
204 |
if (!strncasecmp(line + match[2].rm_so, "logfile", 7)) { |
if (!strncasecmp(line + match[2].rm_so, "logfile", 7)) { |
205 |
if (!*logfile) |
if (!*logfile) { |
206 |
strncat(logfile, line + match[3].rm_so, |
if (*(line + match[3].rm_so) == '"' && |
207 |
min((match[3].rm_eo - match[3].rm_so), PATH_MAX - 1)); |
*(line + match[3].rm_eo - 1) == '"') |
208 |
|
strncat(logfile, line + match[3].rm_so + 1, |
209 |
|
min((match[3].rm_eo - match[3].rm_so - 2), |
210 |
|
PATH_MAX - 1)); |
211 |
|
else |
212 |
|
strncat(logfile, line + match[3].rm_so, |
213 |
|
min((match[3].rm_eo - match[3].rm_so), |
214 |
|
PATH_MAX - 1)); |
215 |
|
} |
216 |
|
} else if (!strncasecmp(line + match[2].rm_so, "charset", 7)) { |
217 |
|
if (*(line + match[3].rm_so) == '"' && |
218 |
|
*(line + match[3].rm_eo - 1) == '"') |
219 |
|
strncat(charset, line + match[3].rm_so + 1, |
220 |
|
min((match[3].rm_eo - match[3].rm_so - 2), |
221 |
|
CHARSET_LEN - 1)); |
222 |
|
else |
223 |
|
strncat(charset, line + match[3].rm_so, |
224 |
|
min((match[3].rm_eo - match[3].rm_so), CHARSET_LEN - 1)); |
225 |
} else if (!strncasecmp(line + match[2].rm_so, "errors", 6)) { |
} else if (!strncasecmp(line + match[2].rm_so, "errors", 6)) { |
226 |
if (!strncasecmp(line + match[3].rm_so, "yes", 3)) |
if (!strncasecmp(line + match[3].rm_so, "yes", 3)) |
227 |
options |= OPTION_ERRORS; |
options |= OPTION_ERRORS; |