[gvfs/wip/oholy/admin-ownership: 2/4] admin: Allow changing file owner



commit daf1163aba229afcfddf0f925aef7e97047e8959
Author: Ondrej Holy <oholy redhat com>
Date:   Thu May 23 10:29:08 2019 +0200

    admin: Allow changing file owner
    
    CAP_CHOWN is dropped together with other privilages and thus the backend
    can't change file owner. This might be probably e.g. in case of copy
    operation when G_FILE_COPY_ALL_METADATA is used. Let's keep CAP_CHOWN
    to fix this.

 daemon/gvfsbackendadmin.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/daemon/gvfsbackendadmin.c b/daemon/gvfsbackendadmin.c
index 23d16f16..a74d09cf 100644
--- a/daemon/gvfsbackendadmin.c
+++ b/daemon/gvfsbackendadmin.c
@@ -968,7 +968,8 @@ g_vfs_backend_admin_init (GVfsBackendAdmin *self)
 
 #define REQUIRED_CAPS (CAP_TO_MASK(CAP_FOWNER) | \
                        CAP_TO_MASK(CAP_DAC_OVERRIDE) | \
-                       CAP_TO_MASK(CAP_DAC_READ_SEARCH))
+                       CAP_TO_MASK(CAP_DAC_READ_SEARCH) | \
+                       CAP_TO_MASK(CAP_CHOWN))
 
 static void
 acquire_caps (uid_t uid)


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