cosmic-edit/src
Hadi Chokr 8e7c6bcf68
Enable saving read-only/root files via pkexec (Fixes #249) (#304)
* Enable saving read-only/root files via pkexec (Fixes #249)

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 #249 and streamlines the process, ensuring a smoother experience for users managing protected files directly within Cosmic Edit.

* Secure pkexec handling with piped stdin and escape safety

Enhanced permission handling by using `pkexec` with `tee` and piped stdin. This implementation avoids shell injection risks and ensures proper handling of special escape characters in the input. The approach securely writes text content to files with elevated privileges while maintaining robustness against potentially malicious inputs.

* Update tab.rs

* Log Errors but dont crash

* Update tab.rs

* Update tab.rs

* Clean up after child (sounds weird...)
2025-01-23 13:47:16 -07:00
..
config.rs Added wrap around feature to find menu 2024-10-06 09:00:38 -06:00
git.rs Allow for staging and unstaging in git management view 2024-05-14 11:45:39 -06:00
icon_cache.rs Simple replace implementation 2024-01-09 13:37:10 -07:00
key_bind.rs refactor(menu): update menu declaration. 2024-03-18 03:02:33 -07:00
line_number.rs Update libcosmic/iced 2024-10-22 11:55:58 -06:00
localize.rs Replace lexical-sort with icu 2024-07-09 06:08:22 -06:00
main.rs Fix closing projects when open project button is shown, fixes #41 2025-01-17 10:10:14 -07:00
menu.rs Implement revert all changes, fixes #128 2025-01-17 09:43:46 -07:00
project.rs Replace lexical-sort with icu 2024-07-09 06:08:22 -06:00
search.rs Fixed **many** clippy lints, and one bug. 2023-12-26 10:17:32 -07:00
tab.rs Enable saving read-only/root files via pkexec (Fixes #249) (#304) 2025-01-23 13:47:16 -07:00
text_box.rs Don't capture ctrl+tab in text box, fixes #123 2025-01-17 09:49:30 -07:00