Skip to content

ChangeWithPrompt on a pending v0 migration does not migrate; new password fails after reboot #696

Closed

Description

@drshields

Summary

On Fedora 45, changing the default Login keyring password from Seahorse (ChangeWithPrompt) while a legacy v0 keyring is awaiting migration appears to operate on the empty migration placeholder instead of completing the migration. The v1 keyring is not written at password-change time; it is only created later when another app writes an item. After reboot, the keyring cannot be unlocked with the newly set password, and pam_oo7 also fails to unlock it with the account login password.

This looks like the ChangeWithPrompt counterpart of #689. PR #693 fixed UnlockWithMasterPassword and ChangeWithMasterPassword, but the prompt path in server/src/gnome/internal.rs::change_with_prompt still calls change_secret() directly on the collection's keyring.

Environment

  • Fedora 45 Workstation
  • oo7-daemon-0.7.0~beta^1.e91b98a-1.fc45.x86_64 (also oo7-portal and pam_oo7 of the same build)
  • GDM 51.1.1, GNOME Shell 51
  • systemd 262
  • Keyring originated from gnome-keyring (legacy v0 format)
  • Seahorse used for the password change

Sequence

  1. The account password had been changed out-of-band (GRUB/rescue), so the legacy Login keyring was still encrypted with the old password. Apps prompted for the old password.
  2. The legacy Login keyring was manually unlocked using the old password.
  3. Seahorse changed the Login keyring password via ChangeWithPrompt. oo7 reported success at 10:04:57.
  4. At that point no ~/.local/share/keyrings/v1/login.keyring existed. The v1 file's birth time is 14:23:27, when gh auth refresh created two items. The password change therefore did not create/write the v1 file.
  5. After reboot, pam_oo7 delivered the current account password and oo7 rejected it. The password set in step 3 also did not unlock the keyring (user-confirmed).
  6. Workaround: stop oo7-daemon, move ~/.local/share/keyrings aside, log in with the account password. oo7 then created a fresh default Login collection with the PAM secret and everything worked.

Relevant logs

Password change (success reported):

oo7-daemon: INFO oo7_daemon::gnome::internal: Created password change prompt for collection `/org/freedesktop/secrets/collection/login`
oo7-daemon: INFO oo7_daemon::gnome::internal: Collection `/org/freedesktop/secrets/collection/login` password changed via prompt
oo7-daemon: INFO oo7_daemon::prompt: ChangePassword action completed successfully

Next login:

oo7-daemon: INFO oo7_daemon: Connected to login helper at /run/user/.../oo7-daemon-login.sock
oo7-daemon: INFO oo7_daemon: Received login secret from helper
oo7-daemon: ERROR oo7::file::locked_keyring: Keyring cannot be decrypted. Invalid secret.
oo7-daemon: WARN oo7_daemon::service: Failed to unlock keyring 'login' with provided secret: Incorrect secret. Keeping it locked.

Question

Should change_with_prompt go through the pending-migration path (similar to Service::unlock_collection() / the #693 changes) instead of calling change_secret() on the collection's current keyring? If so, this would still affect the Seahorse path on current main, since change_with_prompt does not consult pending_migrations.

I still have the old encrypted keyring backed up and can test a patched build or run oo7-cli against it if that would help, but I would not upload it since it contains personal secrets.

Activity

  1. bilelmoussaoui commented on Nov 19, 2026

    @bilelmoussaoui
    Collaborator

    You can use oo7-cli migrate -k $HOME/.local/share/keyrings/$your-keyring-file.keyring --secret $thesecret. That will migrate it, you can then remove the previous file (after keeping a backup of it).

  2. drshields commented on Nov 19, 2026

    @drshields
    Author

    Thanks. Unless I'm missing something, oo7-cli migrate only handles a legacy v0 file (MigrateFormat::V0) and writes to v1/<name>.keyring. In this case the v1 file already existed by the time the problem surfaced: oo7 created it at 14:23 when a gh item was written, two hours after ChangeWithPrompt reported success. The password set at 10:04 does not open that v1 file. Migrating the legacy login.keyring would recover the legacy items but would target the same v1 path, not unlock the existing v1 contents.

    So the question remains: should ChangeWithPrompt route through the pending-migration path (as #693 did for ChangeWithMasterPassword), or at minimum fail instead of reporting success while a v0 migration is still pending? I can test a patched build against the backup if useful.

  3. bilelmoussaoui commented on Nov 19, 2026

    @bilelmoussaoui
    Collaborator

    I will provide a patch in a bit.

  4. bilelmoussaoui commented on Nov 19, 2026

    @bilelmoussaoui
    Collaborator

    Please check #697

  5. drshields commented on Nov 19, 2026

    @drshields
    Author

    Checked #697. That looks like the right fix: routing the change-password prompt's old-secret unlock through Service::unlock_collection() completes the pending v0 migration before the new secret is applied, and test_change_with_prompt_pending_migration exercises exactly the Seahorse path from this report. The create/delete-item and PAM-path fixes are a welcome bonus. LGTM from the reporter side; happy to test a patched build against the backup if useful, though the new test already matches the observed failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingserver

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions