-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Can't create a new file after first run as root #202
Comments
I have built
The directory structure has these permissions:
(This is from clean When I added the write permissions ( I don't understand the cause - maybe some installation script? |
Does "clean" elementary OS install mean you did not copy the home directory from another installation? |
Can you also do a ls -al /home/martin/.local/share? Perhaps first time when you ran Code it was run as root or something and the directory in there was created as root, which is why the permissions did not allow you to write to it. |
Correct, I have not copied the home directory from another installation. (Only post-installation I copied some data like photos etc., but no dotfiles / directories.)
I have also started on 0.4.1 Loki but then added the |
Well, as you can see on the |
Is it a good idea to show some kind of message to the user? ("Can't open a new file, click this button to fix this - might want sudo permissions" or something similar) |
It's a bug caused by an edge case. We definetely can't cover all posibilities. I consider that the error message "Permission denied" is descriptive enough. |
If the saved file was saved as root, and it cannot be read by Scratch, it should just ignore it and create a new one. Also: even if Scratch is opened as root, the file should be saved with right permissions and not with root permissions. |
Well I don't think it's because the file was saved as root, it's that the directory was created as root so you can't create a new file in there. |
Just want to add that the error Permission denied can't be seen anywhere in the app. With some developer effort the user can run the app from terminal and see it, but still... |
You don't need to compile the app from scratch to run from the command line, just run |
Yes, I didn't mean to say the user has to compile the app (although I did). But there still probably will be some developer guidance needed to tell the user to run the app in the terminal. (Seeing as the elementary OS targets non-tech-savvy people too, I think a hint in the app could help, although that's up for discussion.) |
You're right, it should handle this more gracefully. |
The proper solution is probably to completely disallow running with sudo as we’ve done in files and only allow running with pkexec so that this can’t happen again |
Relevant files commit here: elementary/files@f0e4a44 |
Sorry to quote reply such an old comment but I found it relevant as I filed issue #546. How do I modify locked files then if the proper solution is to have Code be unable to run under sudo all together? It's something that people do from time to time on Linux, BSD and macOS right? To me, as the end user I would much rather use Code over whipping out nano, nvim, ed or any other cli editor for editing locked files - for whatever reason I see fit to edit whichever file I want to edit. |
When I try to create a new file from the main window ("new file / open file / new from clipboard"), the app doesn't initialize the text editor window and starts looking like this (still responsive, but I can't write):
When I try to create a new file from an opened file (by clicking on the
+
sign in the tab list), similar story (but I can still edit the previously open file) - the plus sign stays "focused", but nothing else happens:Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: