}
}
- /* if we want to allow root, then we will not drop
- root privileges */
- restrict_access(&pclient->params.restrict_set,
- (pclient->params.allow_root ?
- RESTRICT_ACCESS_FLAG_ALLOW_ROOT : 0),
- pclient->params.home);
-
exec_child(plclient->bin_path, pclient->args, &pclient->envs,
fd_in[0], fd_out[1], child_extra_fds, event);
i_unreached();
pclient->params = *params;
pclient->params.dns_client_socket_path =
p_strdup(pool, params->dns_client_socket_path);
- pclient->params.home = p_strdup(pool, params->home);
pclient->event = event_create(params->event);
}
struct program_client_parameters {
unsigned int client_connect_timeout_msecs;
unsigned int input_idle_timeout_msecs;
- /* initialize with
- restrict_access_init(&set.restrict_set);
- */
- struct restrict_access_settings restrict_set;
const char *dns_client_socket_path;
- const char *home;
/* Event to use for the program client. */
struct event *event;
- bool allow_root:1;
/* use o_stream_dot, which is mainly useful to make sure that an
unexpectedly closed connection doesn't cause the partial input to
be accepted as valid and complete program input. This is always
static struct program_client_parameters pc_params = {
.client_connect_timeout_msecs = 10000,
.input_idle_timeout_msecs = 5000,
- .restrict_set = {
- .uid = (uid_t)-1,
- .gid = (gid_t)-1,
- },
- /* we need to permit root when running make check as root */
- .allow_root = TRUE,
};
static void test_program_success(void)
pc_params.input_idle_timeout_msecs = set->submission_timeout * 1000;
pc_params.event = subm->event;
- pc_params.allow_root = TRUE;
- restrict_access_init(&pc_params.restrict_set);
-
pc = program_client_local_create
(sendmail_bin, array_front(&args), &pc_params);
};
struct program_client *pc;
- restrict_access_init(¶ms.restrict_set);
-
e_debug(root->quota->event, "Executing warning: %s (because %s)", cmd, reason);
args = t_strsplit_spaces(cmd, " ");
static void script_execute(struct mail_user *user, const char *cmd, bool wait)
{
- const char *socket_path, *home, *const *args;
-
- if (mail_user_get_home(user, &home) < 0)
- home = NULL;
+ const char *socket_path, *const *args;
struct program_client_parameters params = {
.client_connect_timeout_msecs = 1000,
.event = user->event,
- .home = home,
};
e_debug(user->event, "welcome: Executing %s (wait=%d)", cmd, wait ? 1 : 0);