/* Copyright (c) 2014-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "ioloop.h"
#include "istream.h"
#include "strescape.h"
#include "wildcard-match.h"
#include "acl-api-private.h"
#include "acl-global-file.h"
struct acl_global_rights {
const char *vpattern;
};
struct acl_global_parse_rights {
const char *vpattern;
};
struct acl_global_file {
char *path;
unsigned int refresh_interval_secs;
bool debug;
};
struct acl_global_file *
bool debug)
{
return file;
}
{
}
const struct acl_global_parse_rights *r2)
{
}
struct acl_global_file_parse_ctx {
};
static int
{
const char *p, *vpattern;
if (*line == '"') {
line++;
*error_r = "Missing '\"'";
return -1;
}
if (line[0] != ' ') {
*error_r = "Expecting space after '\"'";
return -1;
}
line++;
} else {
if (p == NULL) {
*error_r = "Missing ACL rights";
return -1;
}
if (p == line) {
*error_r = "Empty ACL pattern";
return -1;
}
line = p + 1;
}
return -1;
return 0;
}
{
unsigned int linenum = 0;
int ret = 0;
linenum++;
continue;
T_BEGIN {
if (ret < 0) {
i_error("Global ACL file %s line %u: %s",
}
} T_END;
if (ret < 0)
break;
}
i_error("Couldn't read global ACL file %s: %s",
ret = -1;
}
if (ret == 0) {
i_error("Couldn't stat global ACL file %s: %s",
ret = -1;
} else {
}
}
/* sort all parsed rights */
/* combine identical patterns into same structs */
}
}
return ret;
}
{
return 0;
if (file->last_refresh_time != 0) {
return -1;
}
/* no change to the file */
return 0;
}
}
if (acl_global_file_read(file) < 0)
return -1;
return 0;
}
{
}
{
continue;
i_debug("Mailbox '%s' matches global ACL pattern '%s'",
}
}
}
}
{
return TRUE;
}
return FALSE;
}