Changed the ACL code to use the configured locations of the list's ACL
file rather than the hard-coded one.
This commit is contained in:
parent
c0d14afc86
commit
7104ded04d
8
acl.y
8
acl.y
@ -237,7 +237,7 @@ int checkACL(struct Mail * MailStruct,
|
|||||||
char ** parameter_ptr)
|
char ** parameter_ptr)
|
||||||
{
|
{
|
||||||
const struct PD_Config * MasterConfig;
|
const struct PD_Config * MasterConfig;
|
||||||
char * filename;
|
const struct List_Config * ListConfig;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
assert(MailStruct != NULL);
|
assert(MailStruct != NULL);
|
||||||
@ -245,6 +245,7 @@ int checkACL(struct Mail * MailStruct,
|
|||||||
assert(parameter_ptr != NULL);
|
assert(parameter_ptr != NULL);
|
||||||
|
|
||||||
MasterConfig = getMasterConfig();
|
MasterConfig = getMasterConfig();
|
||||||
|
ListConfig = getListConfig(listname);
|
||||||
g_MailStruct = MailStruct;
|
g_MailStruct = MailStruct;
|
||||||
g_parameter = NULL;
|
g_parameter = NULL;
|
||||||
|
|
||||||
@ -298,15 +299,14 @@ check_local_acl_file:
|
|||||||
if (listname == NULL)
|
if (listname == NULL)
|
||||||
goto finished;
|
goto finished;
|
||||||
|
|
||||||
filename = text_easy_sprintf("lists/%s/acl", listname);
|
yyin = fopen(ListConfig->acl_file, "r");
|
||||||
yyin = fopen(filename, "r");
|
|
||||||
if (yyin == NULL) {
|
if (yyin == NULL) {
|
||||||
switch(errno) {
|
switch(errno) {
|
||||||
case ENOENT:
|
case ENOENT:
|
||||||
/* no list acl file */
|
/* no list acl file */
|
||||||
goto finished;
|
goto finished;
|
||||||
default:
|
default:
|
||||||
syslog(LOG_ERR, "Couldn't open \"~petidomo/%s\" file: %m", filename);
|
syslog(LOG_ERR, "Couldn't open acl file \"%s\": %m", ListConfig->acl_file);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user