Repository navigation
Conversation
[Medium impact] The PR reaches cleartext keyring files and the user-session keyring startup path. The migration should not merge until a failed mask stops repair. Findings
SummaryAdds a helper that folds damaged multiline keyring secrets into escaped values and replaces repaired files atomically.
|
c868200 to
9093474
Compare
9093474 to
194a121
Compare
5afa272 to
b87ef21
Compare
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
b87ef21 to
b185944
Compare
b185944 to
d86072a
Compare
d86072a to
d998a43
Compare
d998a43 to
749a021
Compare
|
The helper already reports to stderr, so |
749a021 to
9600ffc
Compare
9600ffc to
899ad69
Compare
899ad69 to
afe7197
Compare
afe7197 to
6d59055
Compare
|
Reviewed at 4786d4f against The repair works. On a worker built from the Omarchy ISO (gnome-keyring 1:51.1-1), I started from the keyring Pushed 4786d4f to fix two defects, each with a test that fails without its fix:
Still open, for the maintainer:
Dismissed after checking: a claim that trailing spaces are lost (the daemon round-trip kept them), and a suggestion that the drop-in should fail the unit (failing open is right; the daemon must start). This now waits on the maintainer: whether to take an in-place repair alongside or instead of the writer fix, and how the drop-in gets packaged. |
|
#17502 (Replace GNOME Keyring with oo7) now depends on this PR. Its migration runs Everything else #17502 needs is now on edge. oo7 0.7.1-1 is in edge's |
|
Re-read head Classification is therefore unresolved. The queue workflow stops verification at this point: the second model has only classified the change, and tests have not run on this head in this pass. The earlier revision's verification does not cover this head. This waits for the classification disagreement to be resolved before review and verification continue. |
6b7c81e to
8394642
Compare
|
Re-read head The classification remains unresolved at this head. The queue workflow requires this pass to stop here, so no class label was added and no tests or code-review second opinion ran on this revision. Earlier verification covers an older head. This waits for the classification disagreement to be resolved before verification continues. |
GNOME Keyring drops cleartext keyrings on startup when Secret Service clients store unescaped multiline values (omacom#5105, omacom#11159, omacom#12563). Supersede PR omacom#11697 by parsing and folding unescaped continuation lines into GLib keyfile escaped sequences in-place rather than deleting valid credentials. Provide an atomic Python stdlib repair CLI, a systemd user ExecStartPre drop-in, an isolated runtime-masked migration, and round-trip verification tests against GLib and live gnome-keyring-daemon.
gnome-keyring writes lock-timeout= into [keyring] whenever a lock timeout is set (gkm-secret-textual.c:418,422), and the whitelist counted it as a bare continuation line, so any such keyring was refused even when its damage was a plain multiline secret. A secret whose payload holds a line like [9] followed by item keys was split into a second, forged item and the real secret cut short, with exit 0. gnome-keyring writes an item's attribute groups straight after it (generate_item calls generate_attributes), so an attribute group that follows a different item now marks the file ambiguous and leaves it untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
Do not match keyring-level properties (lock-timeout, lock-on-idle) inside item sections so damaged secrets containing these strings fold and recover properly rather than being skipped.
Reject empty bracket lines inside secrets, remove dead keyfile regexes, simplify section parsing, guard offline systemd user buses and stale runtime masks in the migration, update the migration timestamp, and add regression tests for empty brackets, legacy ACLs, and foreign files.
Satisfy the AGENTS.md #!/bin/bash shebang requirement by executing /usr/bin/python3 -I via heredoc from bin/omarchy-keyring-repair while keeping command metadata intact, and invoke the command directly in test/shell.d/keyring-repair-test.sh.
8394642 to
91ff3e3
Compare
|
I reviewed the Bash entry point and its test updates at Verification is paused until the classification is resolved. The earlier worker results cover an older revision, and no worker tests ran on this commit. |
| if systemctl --user mask --runtime "$unit" >/dev/null 2>&1; then | ||
| masked_units+=("$unit") | ||
| fi |
There was a problem hiding this comment.
Failed masks allow credential loss
If systemctl --user mask --runtime fails, the migration still stops the units and runs repair. Stopping the daemon does not prevent an app from starting it again. The helper can then replace a keyring that the daemon has just updated, losing newly saved credentials.
Require both units to be masked successfully, or already persistently masked, before running repair.
|
The open Greptile finding (a failed mask doesn't stop the repair) holds at The patch below makes both units a precondition. The diff --git i/migrations/1795886619.sh w/migrations/1795886619.sh
index 179fcb981..22f06e041 100644
--- i/migrations/1795886619.sh
+++ w/migrations/1795886619.sh
@@ -18,17 +18,7 @@ if systemctl --user show-environment >/dev/null 2>&1; then
socket_was_active=1
fi
- # Track units not persistently masked so an interrupted run's masked-runtime
- # state still gets cleaned up on retry.
masked_units=()
- for unit in "$service" "$socket"; do
- unit_state=$(systemctl --user is-enabled "$unit" 2>/dev/null || true)
- if [[ $unit_state != "masked" ]]; then
- if systemctl --user mask --runtime "$unit" >/dev/null 2>&1; then
- masked_units+=("$unit")
- fi
- fi
- done
cleanup() {
for unit in "${masked_units[@]}"; do
@@ -49,6 +39,21 @@ if systemctl --user show-environment >/dev/null 2>&1; then
trap 'exit 1' INT TERM
trap cleanup EXIT
+ # Stopping alone doesn't keep an app from activating the daemon again, and the
+ # repair would then overwrite what it saves, so both units must be masked.
+ # Track units not persistently masked so an interrupted run's masked-runtime
+ # state still gets cleaned up on retry.
+ for unit in "$service" "$socket"; do
+ unit_state=$(systemctl --user is-enabled "$unit" 2>/dev/null || true)
+ if [[ $unit_state != "masked" ]]; then
+ if ! systemctl --user mask --runtime "$unit" >/dev/null 2>&1; then
+ echo "Failed to mask $unit before keyring repair" >&2
+ exit 1
+ fi
+ masked_units+=("$unit")
+ fi
+ done
+
if ! systemctl --user stop "$service" "$socket"; then
echo "Failed to stop $service or $socket before keyring repair" >&2
exit 1Checked with the same stub: either mask failing now exits 1 without running the repair and undoes any mask it made; with both masks succeeding, or both units already masked, the repair runs as before. 🤖 Generated with Claude Code |
Fixes #5105, #11159, #12563. Supersedes #11697.
Summary
GNOME Keyring drops cleartext keyrings on boot when clients store unescaped multiline secrets (e.g. Proton VPN SSO, OAuth tokens). PR #11697 proposed deleting the file; this PR repairs it in-place instead:
bin/omarchy-keyring-repairrunning on daemon startup viagnome-keyring-daemon.service.d/10-keyring-repair.conf.migrations/1792900000.shmasks daemon with--runtime(in/run), stops daemon, runs repair, halts with code 1 if helper is unavailable, and restarts.Evidence
test/shell.d/keyring-repair-test.sh:Merge Danger
Door: two-way (unmodified files left byte-for-byte identical; binary keyrings skipped; ambiguous boundaries reject without file modifications).
Blast Radius: bounded (
~/.local/share/keyrings/*.keyring).