diff --git a/src/mountfsd/mountwork.c b/src/mountfsd/mountwork.c index fb1d8ebcb4..4f37bbd081 100644 --- a/src/mountfsd/mountwork.c +++ b/src/mountfsd/mountwork.c @@ -659,7 +659,7 @@ static DirectoryOwnership validate_directory_fd(int fd, uid_t peer_uid) { if (r < 0) return r; - fl = fd_verify_safe_flags_full(fd, O_DIRECTORY); + fl = fd_verify_safe_flags_full(fd, O_DIRECTORY|O_PATH); if (fl < 0) return log_debug_errno(fl, "Directory file descriptor has unsafe flags set: %m"); diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 672c6a65cd..0bc750bafe 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -4750,7 +4750,7 @@ int mountfsd_mount_directory( if (r < 0) return log_error_errno(r, "Failed to enable varlink fd passing for write: %m"); - _cleanup_close_ int directory_fd = open(path, O_DIRECTORY|O_RDONLY|O_CLOEXEC); + _cleanup_close_ int directory_fd = open(path, O_DIRECTORY|O_RDONLY|O_CLOEXEC|O_PATH); if (directory_fd < 0) return log_error_errno(errno, "Failed to open '%s': %m", path);