[libglnx] fdio: Canonicalize dfd for replace contents API



commit 20fc302df59ea7ca928756b8221faede31bcbab4
Author: Colin Walters <walters verbum org>
Date:   Mon Apr 13 13:35:32 2015 -0400

    fdio: Canonicalize dfd for replace contents API
    
    Just noticed while inspecting the code.

 glnx-fdio.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/glnx-fdio.c b/glnx-fdio.c
index b45b927..db214dd 100644
--- a/glnx-fdio.c
+++ b/glnx-fdio.c
@@ -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);
   glnx_fd_close int fd = -1;
 
+  dfd = glnx_dirfd_canonicalize (dfd);
+
   if ((fd = mkostemp (tmppath, O_CLOEXEC)) == -1)
     {
       glnx_set_error_from_errno (error);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]