{ "Type", config_parse_string, &u->mount.parameters_fragment.fstype, "Mount" },
{ "TimeoutSec", config_parse_usec, &u->mount.timeout_usec, "Mount" },
{ "KillMode", config_parse_kill_mode, &u->mount.kill_mode, "Mount" },
+ { "DirectoryMode", config_parse_mode, &u->mount.directory_mode, "Mount" },
EXEC_CONTEXT_CONFIG_ITEMS(u->mount.exec_context, "Mount"),
{ "Where", config_parse_path, &u->automount.where, "Automount" },
m->timeout_usec = DEFAULT_TIMEOUT_USEC;
exec_context_init(&m->exec_context);
+ m->directory_mode = 0755;
+
/* We need to make sure that /bin/mount is always called in
* the same process group as us, so that the autofs kernel
* side doesn't send us another mount request while we are
"%sFrom /etc/fstab: %s\n"
"%sFrom /proc/self/mountinfo: %s\n"
"%sFrom fragment: %s\n"
- "%sKillMode: %s\n",
+ "%sKillMode: %s\n"
+ "%sDirectoryMode: %04o\n",
prefix, mount_state_to_string(m->state),
prefix, m->where,
prefix, strna(p->what),
prefix, yes_no(m->from_etc_fstab),
prefix, yes_no(m->from_proc_self_mountinfo),
prefix, yes_no(m->from_fragment),
- prefix, kill_mode_to_string(m->kill_mode));
+ prefix, kill_mode_to_string(m->kill_mode),
+ prefix, m->directory_mode);
if (m->control_pid > 0)
fprintf(f,
m->control_command_id = MOUNT_EXEC_MOUNT;
m->control_command = m->exec_command + MOUNT_EXEC_MOUNT;
+ mkdir_p(m->where, m->directory_mode);
+
if (m->from_fragment)
r = exec_command_set(
m->control_command,