mirror of
https://github.com/flatpak/flatpak.git
synced 2026-09-22 21:25:48 -04:00
document-portal: Fail fd validation if we can't open directory
We need to check if the open succeeded.
This commit is contained in:
1 parent
f48e863f4b
commit
786f87fb9c
1 file changed
+2
-1
@@ -387,7 +387,8 @@ validate_parent_dir (const char *path,
|
||||
name = g_path_get_basename (path);
|
||||
dir_fd = open (dirname, O_CLOEXEC | O_PATH);
|
||||
|
||||
if (fstat (dir_fd, real_parent_st_buf) < 0 ||
|
||||
if (dir_fd < 0 ||
|
||||
fstat (dir_fd, real_parent_st_buf) < 0 ||
|
||||
fstatat (dir_fd, name, &real_st_buf, AT_SYMLINK_NOFOLLOW) < 0 ||
|
||||
st_buf->st_dev != real_st_buf.st_dev ||
|
||||
st_buf->st_ino != real_st_buf.st_ino)
|
||||
|
||||
Reference in new issue
Block a user