/[imapfilter]/imapfilter/parse.c
ViewVC logotype

Diff of /imapfilter/parse.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by lefcha, Sun Nov 23 22:47:27 2003 UTC revision 1.8 by lefcha, Sat Feb 7 23:54:16 2004 UTC
# Line 52  read_config(char *cfg) Line 52  read_config(char *cfg)
52  #ifdef DEBUG  #ifdef DEBUG
53          fprintf(stderr, "debug: configuration file: '%s'\n", cfg);          fprintf(stderr, "debug: configuration file: '%s'\n", cfg);
54  #endif  #endif
55  #ifdef CHECK_PERMISSIONS  
         check_file_perms(cfg, S_IRUSR | S_IWUSR);  
 #endif  
56          fd = fopen(cfg, "r");          fd = fopen(cfg, "r");
57          if (fd == NULL)          if (fd == NULL)
58                  fatal(ERROR_FILE_OPEN, "opening config file %s; %s\n", cfg,                  fatal(ERROR_FILE_OPEN, "opening config file %s; %s\n", cfg,
# Line 69  read_config(char *cfg) Line 67  read_config(char *cfg)
67    
68          fclose(fd);          fclose(fd);
69    
70            check_file_perms(cfg, S_IRUSR | S_IWUSR);
71    
72  #ifdef DEBUG  #ifdef DEBUG
73          fprintf(stderr, "debug: options: %0#10x '%s'\n", options, charset);          fprintf(stderr, "debug: options: %0#10x '%s'\n", options, charset);
74  #endif  #endif
# Line 142  parse_config(FILE * fd) Line 142  parse_config(FILE * fd)
142                  "[[:blank:]]*\n$",                  "[[:blank:]]*\n$",
143    
144                  "^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(ERRORS|EXPUNGE|"                  "^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(ERRORS|EXPUNGE|"
145                  "HEADERS|NAMESPACE|PEEK|SUBSCRIBE)[[:blank:]]*=[[:blank:]]*"                  "HEADERS|NAMESPACE|PEEK|PERMISSIONS|PROTOCOL|SUBSCRIBE)"
146                  "(YES|NO)[[:blank:]]*\n$",                  "[[:blank:]]*=[[:blank:]]*(YES|NO)[[:blank:]]*\n$",
147    
148                  "^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(DAEMON|TIMEOUT)"                  "^[[:blank:]]*(SET[[:blank:]])?[[:blank:]]*(DAEMON|TIMEOUT)"
149                  "[[:blank:]]*=[[:blank:]]*([[:digit:]]+)\n$"                  "[[:blank:]]*=[[:blank:]]*([[:digit:]]+)\n$"
# Line 275  set_options(char *line, regmatch_t * m) Line 275  set_options(char *line, regmatch_t * m)
275                          options |= OPTION_PEEK;                          options |= OPTION_PEEK;
276                  else                  else
277                          options &= ~(OPTION_PEEK);                          options &= ~(OPTION_PEEK);
278            } else if (!strncasecmp(line + m[2].rm_so, "permissions", 8)) {
279                    if (!strncasecmp(line + m[3].rm_so, "yes", 3))
280                            options |= OPTION_PERMISSIONS;
281                    else
282                            options &= ~(OPTION_PERMISSIONS);
283          } else if (!strncasecmp(line + m[2].rm_so, "subscribe", 9)) {          } else if (!strncasecmp(line + m[2].rm_so, "subscribe", 9)) {
284                  if (!strncasecmp(line + m[3].rm_so, "yes", 3))                  if (!strncasecmp(line + m[3].rm_so, "yes", 3))
285                          options |= OPTION_SUBSCRIBE;                          options |= OPTION_SUBSCRIBE;
# Line 321  read_passwords(void) Line 326  read_passwords(void)
326          if (!exists_file(pwfile))          if (!exists_file(pwfile))
327                  return ERROR_FILE_OPEN;                  return ERROR_FILE_OPEN;
328    
 #ifdef CHECK_PERMISSIONS  
329          check_file_perms(pwfile, S_IRUSR | S_IWUSR);          check_file_perms(pwfile, S_IRUSR | S_IWUSR);
 #endif  
330    
331          fd = fopen(pwfile, "r");          fd = fopen(pwfile, "r");
332          if (fd == NULL)          if (fd == NULL)

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26