#include "ostream.h"
#include "istream-dot.h"
#include "safe-mkstemp.h"
+#include "restrict-access.h"
#include "master-service.h"
#include "rfc822-parser.h"
#include "message-date.h"
lose e.g. config connection and need to reconnect to it. */
if (seteuid(0) < 0)
i_fatal("seteuid(0) failed: %m");
+ /* enable core dumping again. we need to chdir also to
+ root-owned directory to get core dumps. */
+ restrict_access_allow_coredumps(TRUE);
+ (void)chdir(base_dir);
}
}
#define IS_STANDALONE() \
(getenv(MASTER_IS_PARENT_ENV) == NULL)
-const char *dns_client_socket_path;
+const char *dns_client_socket_path, *base_dir;
struct mail_storage_service_ctx *storage_service;
static void client_connected(struct master_service_connection *conn)
}
}
+ if (t_get_current_dir(&base_dir) < 0)
+ i_fatal("getcwd() failed: %m");
drop_privileges();
master_service_init_finish(master_service);
master_service_init_log(master_service,
#ifndef MAIN_H
#define MAIN_H
-extern const char *dns_client_socket_path;
+extern const char *dns_client_socket_path, *base_dir;
extern struct mail_storage_service_ctx *storage_service;
void listener_client_destroyed(void);