Skip to content
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

[BUG] Cosmic Edit Fails to Run as sudo #249

Open
iamkartiknayak opened this issue Oct 5, 2024 · 4 comments
Open

[BUG] Cosmic Edit Fails to Run as sudo #249

iamkartiknayak opened this issue Oct 5, 2024 · 4 comments

Comments

@iamkartiknayak
Copy link
Contributor

Cosmic-edit version:

cosmic-edit:
  Installed: 0.1.0~1728000336~24.04~e5a4b46

Issue/Bug description:
Cosmic Edit does not launch when attempted to be run with sudo. This is problematic when trying to edit files that require root privileges, such as system configuration files.

Steps to reproduce:
N/A

Expected behavior:
Cosmic Edit should be able to run with elevated privileges using sudo, allowing users to edit files that require root access.

Other notes:

@LethalManBoob
Copy link

can i add on to this lets have it also auto request sudo permissions when needed?

@iamkartiknayak
Copy link
Contributor Author

Why would it be needed when I sudo cosmic-text from terminal

@LethalManBoob
Copy link

Because not everybody wants to type in a terminal command every time they want to make a tweak to a setting that requires admin privileges. Kwrite already has this in place so I don't see why. Cosmic can't do it too

silverhadch added a commit to silverhadch/cosmic-edit that referenced this issue Jan 20, 2025
This update addresses the issue where users couldn't open Cosmic Edit as root. It allows users to save read-only or root files using pkexec for privilege escalation, all within the graphical interface of Cosmic Edit, eliminating the need to open the terminal.

Changes:

    Implemented pkexec functionality for saving read-only/root files.
    Added a confirmation dialog for file modifications.

This feature resolves issue pop-os#249 and streamlines the process, ensuring a smoother experience for users managing protected files directly within Cosmic Edit.
@silverhadch
Copy link

@LethalManBoob @iamkartiknayak
I opened a PR that will fix this by prompting the user for their password via pkexec when saving a read-only or root file, so you won't have to run Cosmic-Edit as root. It will ask for privileges only when needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants