// Change root (unless root is /)
if (strcmp(root, "/") != 0) {
+ // Disable mount propagation on /
+ r = pakfire_disable_mount_propagation(pakfire, "/");
+ if (r)
+ return r;
+
// Mount everything
r = pakfire_mount_all(pakfire, MOUNT_IN_NEW_NS);
if (r)
MOUNT_IN_NEW_NS = (1 << 0),
};
+int pakfire_disable_mount_propagation(struct pakfire* pakfire, const char* path);
+
int pakfire_mount_list(struct pakfire* pakfire);
int pakfire_mount(struct pakfire* pakfire, const char* source, const char* target,
{ NULL },
};
+int pakfire_disable_mount_propagation(struct pakfire* pakfire, const char* path) {
+ DEBUG(pakfire, "Disabling mount propagation on %s\n", path);
+
+ int r = mount(NULL, path, NULL, MS_REC|MS_PRIVATE, NULL);
+ if (r)
+ ERROR(pakfire, "Failed to set mount propagation on %s to private: %m", path);
+
+ return r;
+}
+
/*
Easy way to iterate through all mountpoints
*/