No description
Find a file
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
.github Add issue template 2024-08-27 16:07:34 -06:00
debian fix(debian): add libxkbcommon-dev 2024-05-18 01:59:07 +02:00
i18n i18n(nl): update and improve Dutch translation (#303) 2025-01-22 08:40:16 -07:00
res Mark as COSMIC application 2024-09-30 09:49:31 -06:00
src Enable saving read-only/root files via pkexec (Fixes #249) (#304) 2025-01-23 13:47:16 -07:00
.gitattributes Add metainfo 2024-03-13 09:53:10 -06:00
.gitignore Fix gitignore of debian build directory 2023-11-08 08:48:44 -07:00
build.rs Shorten hash in UI 2024-02-28 13:38:34 -07:00
Cargo.lock Update dependencies 2025-01-14 08:58:48 -07:00
Cargo.toml Update dependencies 2024-10-29 14:33:29 -06:00
flake.lock Add flake files 2023-11-02 13:10:20 -06:00
flake.nix build(nix): remove gtk dependency 2024-01-26 17:16:37 +01:00
i18n.toml Add translation support 2023-10-30 09:34:36 -06:00
justfile support CARGO_TARGET_DIR 2024-07-15 08:03:01 -06:00
LICENSE Initial commit 2023-02-07 12:23:07 -07:00
README.md Add metainfo 2024-03-13 09:53:10 -06:00
redoxer.sh Add redoxer script 2023-11-15 09:13:46 -07:00

COSMIC Text Editor

Text editor for the COSMIC desktop

Screenshot

Currently an incomplete pre-alpha, this project is a work in progress - issues are expected.

Testing

You can test by installing a current version of Rust and then building with cargo.

git clone https://github.com/pop-os/cosmic-edit
cd cosmic-edit
cargo build

You can get more detailed errors by using the RUST_LOG environment variables, that you can invoke for just that one command like this: RUST_LOG=debug cargo run. This will give you more detail about the application state. You can go even further with RUST_LOG=trace cargo run, that shows all logging details about the application.

Clippy Lints

PRs are welcome, as it builds a better product for everyone. It is recommended that you check your code with Clippy Lints turned on. You can find more about Configuring Clippy here.