[ostree] checkout: Always do chmod even in _MODE_USER



commit 7bd00e30050b516e11b945358999845fa7e8387d
Author: Colin Walters <walters verbum org>
Date:   Tue Apr 1 13:07:17 2014 -0400

    checkout: Always do chmod even in _MODE_USER
    
    The previous commit here changed things so that we do mkdir(x, 0700),
    then fchmod later only if we created the directory.
    
    However the logic was incorrect; we still need to chmod even in
    MODE_USER if we created the directory.

 src/libostree/ostree-repo-checkout.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/libostree/ostree-repo-checkout.c b/src/libostree/ostree-repo-checkout.c
index e965980..126545d 100644
--- a/src/libostree/ostree-repo-checkout.c
+++ b/src/libostree/ostree-repo-checkout.c
@@ -630,7 +630,7 @@ checkout_tree_at (OstreeRepo                        *self,
   /* We do fchmod/fchown last so that no one else could access the
    * partially created directory and change content we're laying out.
    */
-  if (!did_exist && mode != OSTREE_REPO_CHECKOUT_MODE_USER)
+  if (!did_exist)
     {
       do
         res = fchmod (destination_dfd,
@@ -641,7 +641,10 @@ checkout_tree_at (OstreeRepo                        *self,
           ot_util_set_error_from_errno (error, errno);
           goto out;
         }
+    }
 
+  if (!did_exist && mode != OSTREE_REPO_CHECKOUT_MODE_USER)
+    {
       do
         res = fchown (destination_dfd,
                       g_file_info_get_attribute_uint32 (source_info, "unix::uid"),


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