Skip to content
Snippets Groups Projects
Commit 20fc302d authored by Colin Walters's avatar Colin Walters
Browse files

fdio: Canonicalize dfd for replace contents API

Just noticed while inspecting the code.
parent 376219a9
No related branches found
No related tags found
No related merge requests found
...@@ -649,6 +649,8 @@ glnx_file_replace_contents_with_perms_at (int dfd, ...@@ -649,6 +649,8 @@ glnx_file_replace_contents_with_perms_at (int dfd,
g_autofree char *tmppath = g_strdup_printf ("/proc/self/fd/%d/.tmpXXXXXX", dfd); g_autofree char *tmppath = g_strdup_printf ("/proc/self/fd/%d/.tmpXXXXXX", dfd);
glnx_fd_close int fd = -1; glnx_fd_close int fd = -1;
dfd = glnx_dirfd_canonicalize (dfd);
if ((fd = mkostemp (tmppath, O_CLOEXEC)) == -1) if ((fd = mkostemp (tmppath, O_CLOEXEC)) == -1)
{ {
glnx_set_error_from_errno (error); glnx_set_error_from_errno (error);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment