-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unconditionally creates dirs/files/links as root #390
Comments
Create directory is indeed brokenRenameRenaming a directory keeps current directory permissions. Same for copy/paste.
Root:
This seems to work? SymlinkAre created as root not as your current user |
This needs some preparation work for what I think is a reasonable fix:
Option 3 might go to far or too complicated. I say we create it as root and then let the "admin" change it via This requires us to have information about the $CWD everywhere basically we need to bring back Secondly we need tests which we can make before fixing this bug. The current tests are super naive and just run everything as "superuser" admin while this feature can also be used to give Bob access to the server without them being admin in some shared project. For us to test a normal user we need to copy the cockpit-podman test code to create an admin session. Also partly copied in cockpit tests and even bots itself. This needs to become something on either The |
Tested Interesting note, this would behave also different as the current cockpit-navigator plugin. |
When logged in as administrator we would default to creating a directory as "root" even if it was in your own home directory. So instead use superuser only when required and always mkdir / chown the correct permissions when administrative access is enabled. Related: cockpit-project#390
This was fixed by #478 |
Spotted in #385:
This is moved code, but I find the unconditional
superuser: try
here (pretty much all ofmkdir
,mv
, etc.) problematic. Won't that create root-owned directories even if you run it in e.g. your home dir? I feel like this would better work the other way round: first try as your user, and if it fails on permission-denied, retry with root?This of course becomes even more interesting if it's someone else's home directory. Even a system user, like /var/lib/postgresql/. Perhaps the default should be to run it as the user who owns the containing directory?
Originally posted by @martinpitt in #385 (comment)
The text was updated successfully, but these errors were encountered: