i_error("unlink(%s) failed: %m", path);
}
-static bool services_have_auth_destinations(const struct master_settings *set)
+static bool
+services_has_name(const struct master_settings *set, const char *name)
{
struct service_settings *const *services;
unsigned int i, count;
services = array_get(&set->services, &count);
for (i = 0; i < count; i++) {
- if (strcmp(services[i]->type, "auth-destination") == 0)
+ if (strcmp(services[i]->name, name) == 0)
return TRUE;
}
return FALSE;
}
+static bool services_have_auth_destinations(const struct master_settings *set)
+{
+ struct service_settings *const *services;
+ unsigned int i, count;
+
+ services = array_get(&set->services, &count);
+ for (i = 0; i < count; i++) {
+ if (strcmp(services[i]->type, "auth-source") == 0) {
+ if (services_has_name(set, services[i]->auth_dest_service))
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
static bool auths_have_debug(const struct master_settings *set)
{
struct master_auth_settings *const *auths;
"Service #%d is missing name", i);
return FALSE;
}
+ if (*services[i]->type != '\0' &&
+ strcmp(services[i]->type, "log") != 0 &&
+ strcmp(services[i]->type, "config") != 0 &&
+ strcmp(services[i]->type, "auth") != 0 &&
+ strcmp(services[i]->type, "auth-source") != 0) {
+ *error_r = t_strconcat("Unknown service type: ",
+ services[i]->type, NULL);
+ return FALSE;
+ }
for (j = 0; j < i; j++) {
if (strcmp(services[i]->name, services[j]->name) == 0) {
*error_r = t_strdup_printf(