Merge pull request #33475 from poettering/name-to-handle-at-fid

teach inode_same() the concept of name_to_handle_at() FIDs to properly detect inode identities
This commit is contained in:
Lennart Poettering
2024-07-01 18:53:14 +02:00
committed by GitHub
7 changed files with 227 additions and 34 deletions
+10
View File
@@ -1815,3 +1815,13 @@ int make_fsmount(
return TAKE_FD(mnt_fd);
}
char* umount_and_unlink_and_free(char *p) {
if (!p)
return NULL;
PROTECT_ERRNO;
(void) umount2(p, 0);
(void) unlink(p);
return mfree(p);
}
+3
View File
@@ -100,6 +100,9 @@ static inline char *umount_and_free(char *p) {
}
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, umount_and_free);
char* umount_and_unlink_and_free(char *p);
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, umount_and_unlink_and_free);
int bind_mount_in_namespace(PidRef *target, const char *propagate_path, const char *incoming_path, const char *src, const char *dest, bool read_only, bool make_file_or_directory);
int mount_image_in_namespace(PidRef *target, const char *propagate_path, const char *incoming_path, const char *src, const char *dest, bool read_only, bool make_file_or_directory, const MountOptions *options, const ImagePolicy *image_policy);