[ostree] core: Add context when we fail to chmod()/chown()



commit a310eb861b983f437d584eda424011aeaf41ecb0
Author: Colin Walters <walters verbum org>
Date:   Thu Jul 19 11:01:39 2012 -0400

    core: Add context when we fail to chmod()/chown()
    
    This helps make things less confusing when we try to create a file not
    owned by our uid, such as running ostree-pull as non-root on a
    repository owned by root.

 src/libostree/ostree-core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/libostree/ostree-core.c b/src/libostree/ostree-core.c
index 2d61b18..39a6531 100644
--- a/src/libostree/ostree-core.c
+++ b/src/libostree/ostree-core.c
@@ -1145,6 +1145,7 @@ ostree_create_file_from_input (GFile            *dest_file,
       if (lchown (dest_path, uid, gid) < 0)
         {
           ot_util_set_error_from_errno (error, errno);
+          g_prefix_error (error, "lchown(%u, %u) failed: ", uid, gid);
           goto out;
         }
     }
@@ -1154,6 +1155,7 @@ ostree_create_file_from_input (GFile            *dest_file,
       if (chmod (dest_path, mode) < 0)
         {
           ot_util_set_error_from_errno (error, errno);
+          g_prefix_error (error, "chmod(%u) failed: ", mode);
           goto out;
         }
     }



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