core: hook up MountFlags= to the transient unit logic
This makes "systemd-run -p MountFlags=shared -t /bin/sh" work, by making MountFlags= to the list of properties that may be accessed transiently.
This commit is contained in:
@@ -689,3 +689,35 @@ int umount_verbose(const char *what) {
|
||||
return log_error_errno(errno, "Failed to unmount %s: %m", what);
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *mount_propagation_flags_to_string(unsigned long flags) {
|
||||
|
||||
switch (flags & (MS_SHARED|MS_SLAVE|MS_PRIVATE)) {
|
||||
|
||||
case MS_SHARED:
|
||||
return "shared";
|
||||
|
||||
case MS_SLAVE:
|
||||
return "slave";
|
||||
|
||||
case MS_PRIVATE:
|
||||
return "private";
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
unsigned long mount_propagation_flags_from_string(const char *name) {
|
||||
|
||||
if (isempty(name))
|
||||
return 0;
|
||||
|
||||
if (streq(name, "shared"))
|
||||
return MS_SHARED;
|
||||
if (streq(name, "slave"))
|
||||
return MS_SLAVE;
|
||||
if (streq(name, "private"))
|
||||
return MS_PRIVATE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -61,3 +61,6 @@ int mount_verbose(
|
||||
unsigned long flags,
|
||||
const char *options);
|
||||
int umount_verbose(const char *where);
|
||||
|
||||
const char *mount_propagation_flags_to_string(unsigned long flags);
|
||||
unsigned long mount_propagation_flags_from_string(const char *name);
|
||||
|
||||
Reference in New Issue
Block a user