- Added a warning message to be logged when no global ACL file exists.
- Reordered tests in check_local_acl_file: When no listname has been given, we don't need to initialize the lexer at all.
This commit is contained in:
parent
c9eddba714
commit
c9033a31a7
11
acl.y
11
acl.y
@ -261,6 +261,7 @@ int checkACL(struct Mail * MailStruct,
|
|||||||
switch(errno) {
|
switch(errno) {
|
||||||
case ENOENT:
|
case ENOENT:
|
||||||
/* no master acl file */
|
/* no master acl file */
|
||||||
|
syslog(LOG_WARNING, "You have no global acl file (%s). This is probably not a good idea.", MasterConfig->acl_file);
|
||||||
goto check_local_acl_file;
|
goto check_local_acl_file;
|
||||||
default:
|
default:
|
||||||
syslog(LOG_ERR, "Couldn't open \"%s\" acl file: %s", MasterConfig->acl_file, strerror(errno));
|
syslog(LOG_ERR, "Couldn't open \"%s\" acl file: %s", MasterConfig->acl_file, strerror(errno));
|
||||||
@ -289,16 +290,16 @@ int checkACL(struct Mail * MailStruct,
|
|||||||
|
|
||||||
check_local_acl_file:
|
check_local_acl_file:
|
||||||
|
|
||||||
/* Set up the lex scanner. */
|
|
||||||
|
|
||||||
BEGIN(INITIAL);
|
|
||||||
lineno = 1; operation = ACL_NONE;
|
|
||||||
|
|
||||||
/* Do we have a local acl file to test? */
|
/* Do we have a local acl file to test? */
|
||||||
|
|
||||||
if (listname == NULL)
|
if (listname == NULL)
|
||||||
goto finished;
|
goto finished;
|
||||||
|
|
||||||
|
/* Set up the lex scanner. */
|
||||||
|
|
||||||
|
BEGIN(INITIAL);
|
||||||
|
lineno = 1; operation = ACL_NONE;
|
||||||
|
|
||||||
ListConfig = getListConfig(listname);
|
ListConfig = getListConfig(listname);
|
||||||
yyin = fopen(ListConfig->acl_file, "r");
|
yyin = fopen(ListConfig->acl_file, "r");
|
||||||
if (yyin == NULL) {
|
if (yyin == NULL) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user