[ostree] repo: Ensure all stored files are readable



commit 8f6f3623c3cdc5bb79ba70187e9a0127247fb478
Author: Colin Walters <walters verbum org>
Date:   Sun Aug 26 16:35:44 2012 -0400

    repo: Ensure all stored files are readable
    
    We really don't have a sane story for private files.  This is a
    defensive step ensuring that with old versions of gnome-ostree,
    components that mistakenly have un-world-readable files don't break
    pulls.

 src/libostree/ostree-repo.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index b7d6976..c74c095 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -943,6 +943,11 @@ stage_object_internal (OstreeRepo         *self,
                */
               src_mode = g_file_info_get_attribute_uint32 (file_info, "unix::mode");
               target_mode = src_mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_IFMT);
+              /* However, do ensure that archive mode files are
+               * readable by all users.  This is important for serving
+               * files via HTTP.
+               */
+              target_mode |= (S_IRUSR | S_IRGRP | S_IROTH);
               
               if (chmod (ot_gfile_get_path_cached (raw_temp_file), target_mode) < 0)
                 {



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