cockpit-navigator icon indicating copy to clipboard operation
cockpit-navigator copied to clipboard

Wrong file permission on newly created files when logged in with 'Administrative access'

Open KKoukiou opened this issue 1 year ago • 2 comments

Bug Info

Creating a new file or directory when logged in with a normal user, but having elevated permissions (Administrative access) will create files owned by root:root instead of the current user.

To Reproduce Steps to reproduce the behavior:

  1. Click on 'New file' or 'New director' icon buttons in the UI and create that
  2. See file ownership bring root:root

Expected behavior currentuser:currentuser permissions are expected, even when logged in with 'Administrative access'

Screenshots Screen Shot 2023-02-02 at 16 38 02

Screen Shot 2023-02-02 at 16 38 10

KKoukiou avatar Feb 02 '23 15:02 KKoukiou

I think the problem is that when we spawn the touch.py3 process using cockpit.spawn() we pass "superuser": "try", which tries to run the process as root (which I think it succeeds to do since the user has administrative access, not sure). When a user creates a file as root, the owner of the file will be root:root.

ahmedr2001 avatar Apr 04 '23 13:04 ahmedr2001

As an user, I have experienced this many times in Linux, where I expect my user account to be the owner when creating a file as root, however I got used to root being the owner then changing permissions as required over time,

Some might prefer the ability to modify filesystems with 'superuser', Many will have Administrative access active and still expect the filesystem modifications be done without 'superuser'.

If we use a toggle at the top bar of file manager page to edit files as "superuser" / "regular user", defaulting to "regular user", this enables a quick way to switch to and back from 'administrator mode' just for the file manager page.

ragavendaran avatar Apr 11 '23 08:04 ragavendaran