Skip to content

build: Build releases in release mode, and make the trusted-client overrides opt-in - #270

Merged
iinuwa merged 2 commits into
linux-credentials:mainfrom
kpanuragh:explicit-trust-overrides
Nov 20, 2026
Merged

iinuwa merged 2 commits into
linux-credentials:mainfrom
kpanuragh:explicit-trust-overrides

Conversation

@kpanuragh

Copy link
Copy Markdown
Contributor

Follow-up to the private report, as discussed: the profile fix, plus an explicit build option for the trusted-client overrides, like enable_core_dumps.

Release builds were debug builds. Commit 4f2a648 renamed the default profile to release, but three meson.build files still checked for default. So every build ran cargo build without --release, and installed target/debug binaries. They now check for release.

Overrides are opt-in. CREDSD_TRUSTED_CALLERS and CREDSD_TRUSTED_APP_IDS used to be read in any build with debug_assertions. Now they're only read when the daemon is built with -Denable_trusted_client_overrides=true:

  • Meson passes --features trusted-client-overrides to Cargo, and the two checks in gateway/mod.rs test that feature.
  • Meson prints a warning at configure time, and the daemon logs one at startup.
  • Without the option, the daemon logs that it's ignoring either variable if it's set. That gives a hint to anyone whose build dir was configured the old way, e.g. for .vscode/launch.json.
  • CI also runs the daemon's unit tests with the feature on, since meson test only covers the default.
  • The option defaults to false, including for profile=development. So the development instructions in BUILDING.md now set the option, and say not to use it for installed builds.

The profile option's description no longer says that development relaxes security checks.

Testing

  • Unit tests: the overrides are read only with the feature. cargo test --bins passes both with and without --features trusted-client-overrides, and cargo clippy --workspace --all-features -- -Dwarnings is clean.
  • Built the daemon with Meson in three ways, then ran it with CREDSD_TRUSTED_CALLERS=/usr/bin/python3.14 and sent CreateCredential from python3:
Build Result
default (release) "Request received from untrusted caller", SecurityError
-Dprofile=development "Ignoring CREDSD_TRUSTED_CALLERS" at startup; "Request received from untrusted caller", SecurityError
-Dprofile=development -Denable_trusted_client_overrides=true startup warning; caller accepted

One thing to check when packaging 0.5.0: Rust's lto = true from [profile.release] now applies again. With makepkg and Ubuntu's default flags, C LTO already has to be turned off for hidapi (see the PKGBUILD in #269).

4f2a648 renamed the `default` profile to `release` in meson.options,
but the Cargo builds still checked for `default`, so every build ran
`cargo build` without `--release`. Release packages then shipped debug
binaries, with the development-only CREDSD_TRUSTED_CALLERS and
CREDSD_TRUSTED_APP_IDS overrides enabled.
@kpanuragh
kpanuragh force-pushed the explicit-trust-overrides branch from 3b6ca23 to 5c0dfe9 Compare November 17, 2026 06:47

@iinuwa iinuwa left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit. Otherwise it looks fine

Comment thread .github/workflows/main.yml Outdated
# Probably has to do with forking the test processes.
run: meson test -C $BUILD_DIR --interactive

- name: Test trusted client overrides

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests and implementation are straightforward, non-default and intended for development only, so I don't think we should spend the CI time to recompile and run the entire test suite. Can you remove this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the CI step. Clippy still checks the feature since it runs with --all-features.

CREDSD_TRUSTED_CALLERS and CREDSD_TRUSTED_APP_IDS were read in any
build with debug_assertions, so a debug build was enough to let any
process in the session become a privileged client. Read them only when
built with -Denable_trusted_client_overrides=true, which turns on the
daemon's trusted-client-overrides Cargo feature, like enable_core_dumps
for the UI.

Meson warns when the option is on, and the daemon logs a warning at
startup. When it's off and either variable is set, the daemon logs that
it's ignoring it, so existing development setups get a hint.

CI also runs the daemon's unit tests with the feature on.
@kpanuragh
kpanuragh force-pushed the explicit-trust-overrides branch from 5c0dfe9 to 116349b Compare November 20, 2026 05:34

@iinuwa iinuwa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@iinuwa
iinuwa merged commit 829f52e into linux-credentials:main Nov 20, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants