mount-util: add helper that ensures something is a mount point

This commit is contained in:
Lennart Poettering
2021-05-07 22:43:29 +02:00
parent 6c045a9998
commit 14a25e1fae
3 changed files with 25 additions and 5 deletions
+3 -5
View File
@@ -3688,11 +3688,9 @@ static int outer_child(
return r;
/* Make sure we always have a mount that we can move to root later on. */
if (!path_is_mount_point(directory, NULL, 0)) {
r = mount_nofollow_verbose(LOG_ERR, directory, directory, NULL, MS_BIND|MS_REC, NULL);
if (r < 0)
return r;
}
r = make_mount_point(directory);
if (r < 0)
return r;
if (dissected_image) {
/* Now we know the uid shift, let's now mount everything else that might be in the image. */