[nautilus] file: Ability to change file-owner in admin:/// backend



commit df969e9491d7b02b0bd122d721e7080a65252ed9
Author: Apoorv Sachan <apoorv 99 sachan gmail com>
Date:   Tue Jun 23 20:32:38 2020 +0530

    file: Ability to change file-owner in admin:/// backend
    
    Running nautilus as root is no longer recommended/supported.
    Priviledged operations like changing file owner, while
    running as non-root are supported by the admin backend.
    
    Closes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1534

 src/nautilus-file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 33aabf65f..ff902db12 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -6374,8 +6374,8 @@ nautilus_file_can_set_owner (NautilusFile *file)
         return FALSE;
     }
 
-    /* Only root is also allowed to set the owner. */
-    return geteuid () == 0;
+    /* Owner can be changed only in admin backend or by root */
+    return nautilus_file_is_in_admin (file) || geteuid () == 0;
 }
 
 /**


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