<!--
SPDX-FileCopyrightText: (c) 2025-2026 run0edit authors <https://github.com/HastD/run0edit>

SPDX-License-Identifier: Apache-2.0 OR MIT
-->

# Changelog

## [v0.6.1] - 2026-08-23

- Grant the privileged inner script the additional capabilities `CAP_SYS_NICE`
  and `CAP_SYS_RESOURCE` to avoid permission errors if `pam_limits` needs to set
  resource limits in the `runuser` call.
  ([#108](https://github.com/HastD/run0edit/pull/108))

## [v0.6.0] - 2026-08-22

This version contains two significant changes to run0edit's execution model.
([#106](https://github.com/HastD/run0edit/pull/106))

First, the privileged inner script is now executed by replacing the main
process, rather than spawning it as a subprocess. This means the parent process
of the process that triggers the Polkit authorization check will be the user's
shell, allowing run0edit to work properly with Polkit's authentication caching
mechanism (`AUTH_KEEP`).

Second, the editor is now executed from within the privileged script using
`runuser` instead of a second call to `run0`. This has several implications:

- The privileged script now sets the UID and GID for the editor process itself,
  rather than delegating to systemd via DBus. In particular, the privileged
  script no longer needs DBus access at all, so we can block that sandbox escape
  route entirely.
- The systemd sandboxing options now apply to the editor session as well, not
  just to the portion of the script that runs as root. This requires various
  changes to the systemd sandboxing options.
- A small visual difference: The editor's default background color will now
  match the dark red background used by `run0` as the default for root.

## [v0.5.10] - 2026-07-05

### User-facing changes

- Add man page.
  ([#96](https://github.com/HastD/run0edit/pull/96))
- Ignore comment lines and empty lines in `/etc/run0edit/editor.conf`.
  ([#93](https://github.com/HastD/run0edit/pull/93))

### Build/CI changes

- Switch to using Meson build system.
  ([#94](https://github.com/HastD/run0edit/pull/94))
- Simplify integration test setup by running the tests directly on the Ubuntu
  runner rather than starting up a new VM.
  ([#87](https://github.com/HastD/run0edit/pull/87))
- Update runners to Ubuntu 26.04.
  ([#86](https://github.com/HastD/run0edit/pull/86))

## [v0.5.9] - 2026-05-06

- Make the configuration file at `/etc/run0edit/editor.conf` higher priority
  than the environment variables `VISUAL` and `EDITOR` for editor selection.
  ([#82](https://github.com/HastD/run0edit/pull/82))

## [v0.5.8] - 2026-03-12

- Make temporary file have same base filename as original file.
  ([#68](https://github.com/HastD/run0edit/pull/68))
- Allow non-absolute editor specifications in `VISUAL` or `EDITOR` environment
  variables and `--editor` argument.
  ([#69](https://github.com/HastD/run0edit/pull/69))

## [v0.5.7] - 2026-02-11

- Allow specifying editor using `VISUAL` or `EDITOR` environment variables.
  ([#64](https://github.com/HastD/run0edit/pull/64))
- Make repository compliant with
  [REUSE Specification, Version 3.3](https://reuse.software/spec-3.3/).
  ([#62](https://github.com/HastD/run0edit/pull/62))
- Use BLAKE2 hash instead of SHA-256 for inner script checksum.
  ([#54](https://github.com/HastD/run0edit/pull/54))

## [v0.5.6] - 2025-12-22

- Add `/etc/run0edit/editor.conf` to RPM spec as a config file. This ensures the
  config file will be created with the expected permissions if not already
  present. The file will be empty by default, which is ignored by `run0edit`
  when selecting which editor to use.
  ([#52](https://github.com/HastD/run0edit/pull/52))

## [v0.5.5] - 2025-10-28

- Add `--background` option to set or disable the background color. This behaves
  the same as the `--background` option of `run0`, and is implemented by passing
  through the option to the inner call to `run0`.
  ([#38](https://github.com/HastD/run0edit/pull/38))

## [v0.5.4] - 2025-10-15

- Drop support for Python 3.9, which is end-of-life and no longer receiving
  security updates. If you are using Python 3.9, you should update to a newer
  Python version as soon as possible.
  ([#28](https://github.com/HastD/run0edit/pull/28))
- Make error messages more informative in a couple cases.
  ([#26](https://github.com/HastD/run0edit/pull/26),
  [#33](https://github.com/HastD/run0edit/pull/33))
- Various minor CI improvements.
  ([#24](https://github.com/HastD/run0edit/pull/24),
  [#27](https://github.com/HastD/run0edit/pull/27),
  [#30](https://github.com/HastD/run0edit/pull/30),
  [#32](https://github.com/HastD/run0edit/pull/32))

## [v0.5.3] - 2025-08-18

- If `/etc/run0edit/editor.conf` exists but is unreadable due to a permission
  error, exit with an error informing the user of the issue. Previously this was
  silently ignored and `run0edit` would just use a fallback editor, which was
  confusing behavior. ([#17](https://github.com/HastD/run0edit/pull/17))
- fix: `casefold()` instead of `lower()` for case-insensitive equality.
  ([#14](https://github.com/HastD/run0edit/pull/14))
- build: use remote source in RPM spec. This simplifies Copr builds since they
  can use the spec file directly instead of an SRPM.
  ([#13](https://github.com/HastD/run0edit/pull/13))

## [v0.5.2] - 2025-06-21

- Fixed sandbox bug that was preventing creating new files directly in `/root`
  or `/home` on systems where those directories are not symlinks.
  ([#11](https://github.com/HastD/run0edit/pull/11))
- Fixed issue with SELinux denying certain custom editors set via `--editor`.
  ([#9](https://github.com/HastD/run0edit/pull/9))
- Added integration tests. ([#8](https://github.com/HastD/run0edit/pull/8))

## [v0.5.1] - 2025-06-17

- Warn about likely incorrect usage when the user passes multiple positional
  arguments with the first looking like a command. (For example, if a user runs
  `run0edit vim /path/to/file`, they are likely _not_ intending to edit a file
  at `./vim` and then a second file; it's likely intended to be
  `run0edit --editor /usr/bin/vim /path/to/file` or just
  `run0edit /path/to/file`.) ([#6](https://github.com/HastD/run0edit/pull/6))

## [v0.5.0] - 2025-06-16

Rewrote script in Python. ([#1](https://github.com/HastD/run0edit/pull/1))

### Added

- Added an `--editor` option to allow the user to choose a different text
  editor. This must be an absolute path to an executable file, and the filename
  will be passed as the first argument to it.
- Added a `--no-prompt` option to skip the prompt asking the user to confirm
  whether they want to remove the immutable attribute from a file to edit it.
- Allow the user to pass multiple file paths to `run0edit`, which will be edited
  one after the other (like if you pass multiple paths to `sudoedit`).

### Changed

- Fail _before_ asking for a password if it can be determined that the parent
  directory of the file path definitely does not exist or is not valid.
- Switched to using a separate file for the inner script, which will now be
  installed at `/usr/libexec/run0edit/run0edit_inner.py`. This path will be
  passed to the `run0` invocation rather than embedding the entire inner script
  contents in an argument to `run0`. As an extra check, the SHA-256 hash of this
  file is compared against the expected value.
- Only use `/etc/run0edit/editor.conf` as a configuration file, as the secondary
  configuration path at `/usr/etc/run0edit/editor.conf` was pretty much
  redundant.
- Fail with an error message if the config file is nonempty and contains an
  invalid path. Previously this was silently ignored, defaulting to a fallback
  editor.
- Minor changes to the wording of error messages and the `--help` text.
- Stricter seccomp filters for the inner script.

### Testing and CI

- Added unit tests with 100% test coverage.
- Added GitHub workflows that automatically run Ruff (including Flake8, Pylint,
  McCabe complexity checker, and Bandit lints) for all Python versions 3.9
  through 3.13, mypy, the unit tests, and a unit test coverage check on every
  pushed commit.

## [v0.4.4] - 2025-05-22

- Fixed bug in immutable flag parsing.
- Added RPM spec.
- Added CI workflow to build `.rpm` and `.deb` packages.

## [v0.4.3] - 2025-05-17

- Refactored to reduce code duplication and make control flow clearer.
- Separated out the main script and outer script to separate files, with a
  Python build script to reassemble them for installation.
- Improved message text.

## [v0.4.1] - 2025-05-15

- Support immutable flag on directory as well.

## [v0.4.0] - 2025-05-14

- Added support for editing files with the immutable flag set by temporarily
  removing the flag and reapplying it afterward.
- Parse arguments according to shell utility conventions, including `--help` and
  `--version` arguments with `-h` and `-v` short forms.

## [v0.3.3] - 2025-03-17

- Refactored inner script for clarity.
- Improved sandboxing logic.
- Bail out early if target file is read-only.
- Style fixes to pass ShellCheck linter.

## [v0.3.1] - 2025-03-16

- Fixed handling of files in locations not readable by the user.
- Reset `PATH` to default value for security.
- Improved error messages and handling of editor selection.

## [v0.2.0] - 2025-03-13

- Switched to config files instead of environment variable for text editor
  selection.
- Added systemd sandboxing to inner privileged script.

## [v0.1.1] - 2025-03-10

- Improved error messages, added `--help` command.

## [v0.1.0] - 2025-02-21

- Initial release.

[v0.6.0]: https://github.com/HastD/run0edit/compare/v0.5.10...v0.6.0
[v0.5.10]: https://github.com/HastD/run0edit/compare/v0.5.9...v0.5.10
[v0.5.9]: https://github.com/HastD/run0edit/compare/v0.5.8...v0.5.9
[v0.5.8]: https://github.com/HastD/run0edit/compare/v0.5.7...v0.5.8
[v0.5.7]: https://github.com/HastD/run0edit/compare/v0.5.6...v0.5.7
[v0.5.6]: https://github.com/HastD/run0edit/compare/v0.5.5...v0.5.6
[v0.5.5]: https://github.com/HastD/run0edit/compare/v0.5.4...v0.5.5
[v0.5.4]: https://github.com/HastD/run0edit/compare/v0.5.3...v0.5.4
[v0.5.3]: https://github.com/HastD/run0edit/compare/v0.5.2...v0.5.3
[v0.5.2]: https://github.com/HastD/run0edit/compare/v0.5.1...v0.5.2
[v0.5.1]: https://github.com/HastD/run0edit/compare/v0.5.0...v0.5.1
[v0.5.0]: https://github.com/HastD/run0edit/compare/v0.4.4...v0.5.0
[v0.4.4]: https://github.com/HastD/run0edit/compare/v0.4.3...v0.4.4
[v0.4.3]: https://github.com/HastD/run0edit/compare/v0.4.1...v0.4.3
[v0.4.1]: https://github.com/HastD/run0edit/compare/v0.4.0...v0.4.1
[v0.4.0]: https://github.com/HastD/run0edit/compare/v0.3.3...v0.4.0
[v0.3.3]: https://github.com/HastD/run0edit/compare/v0.3.1...v0.3.3
[v0.3.1]: https://github.com/HastD/run0edit/compare/v0.2.0...v0.3.1
[v0.2.0]: https://github.com/HastD/run0edit/compare/v0.1.1...v0.2.0
[v0.1.1]: https://github.com/HastD/run0edit/compare/v0.1.0...v0.1.1
[v0.1.0]: https://github.com/HastD/run0edit/releases/tag/v0.1.0
