Repository navigation
Repair gnome-keyring plaintext keyrings rejected by gnome-keyring 50 - #13014
Closed
LinuxGamerUK wants to merge 1 commit into
Closed
LinuxGamerUK wants to merge 1 commit into
LinuxGamerUK wants to merge 1 commit into
Conversation
This was referenced Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the data-loss mechanism reported in #5105.
Problem
gnome-keyring 50 writes textual secrets with
g_key_file_set_value(), which does not escape newlines. Any secret containing a raw newline (JSON with embedded PEM blocks, pretty-printed tokens) produces a plaintext keyring file the daemon cannot parse again. On the next start it logs:silently drops the collection, and creates a fresh empty default. Browsers lose Safe Storage, SSO tokens vanish, and users perceive a full password wipe. The old file stays on disk, so the data is recoverable.
generate_item()ingkm-secret-textual.cusesg_key_file_set_value()for valid-UTF-8 secrets (no escaping); hexbinary-secret=for non-UTF-8.The migration
One-shot, idempotent, offline (no D-Bus / daemon restart needed):
~/.local/share/keyrings/*.keyringfor plaintext files whose structure the daemon will reject (group-aware:[keyring],[N],[N:attributeK],[N:aclK]key sets from the writer source).~/.local/share/keyrings/backup-<timestamp>/.\n,\r,\t,\\) into single lines. The reader unescapes them, so secrets survive byte-exact.After repair, the daemon simply re-adopts the file on next start - same collection name, same items, same
defaultpointer. No re-import, no prompts.Testing
gnome-keyring-daemonre-adopts the file;secret-tool lookupround-trips both secret types byte-exact.$HOMEand already-valid files: no-op; rerun is a no-op (idempotent).Security notes
~/.local/share/keyrings/, creates a backup before touching anything, and never prints secret material.