Bug 361860

Summary: pam unlock does not work when using a kwallet name other than “kdewallet”
Product: [Frameworks and Libraries] frameworks-kwallet Reporter: Florian Jacob <accounts+bugs.kde>
Component: generalAssignee: Valentin Rusu <valir>
Status: RESOLVED WORKSFORME    
Severity: normal CC: kdelibs-bugs-null
Priority: NOR    
Version First Reported In: 5.20.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Florian Jacob 2016-04-16 15:43:35 UTC
I tried to setup automatic unlock on login, but the unlock always failed.

As soon as I renamed my wallet to “kdewallet”, the unlock worked.

Reproducible: Always

Steps to Reproduce:
1. Set up automatic unlock e.g. after this guide: https://wiki.archlinux.org/index.php/KDE_Wallet#Unlock_KDE_Wallet_automatically_on_login
2. create a new wallet with blowfish backend, using e.g. “kwallet” as the name.
3. delete the default “kdewallet”
4. or explicitly choose the new wallet as default wallet in the settings menu

Actual Results:  
The unlock fails:

kwalletd5: Wallet failed to get opened by PAM, error code is -9
kwalletd5: fsize:  2765156783  encrypted.size():  53520  blksz:  8
kwalletd5: Wallet new enough, using new hash
kwalletd5: kwalletd5 started

Expected Results:  
The unlock succeeds.

I looked around in the kwallet code to find out what the error code -9 actually means, it seems to come from here:
https://github.com/KDE/kwallet/blob/master/src/runtime/kwalletd/backend/backendpersisthandler.cpp#L414

I'm reporting this because the code seemed like it would actually support encrypting whatever wallet is currently set as default wallet, in contrary to this statement found in the arch wiki:

Note: Currently, pam_kwallet-git / kwallet-pam has at least two limitations: first, it's not compatible with GnuPG keys, so KDE Wallet must use the standard blowfish encryption. Also, the wallet name must be "kdewallet" (that's the default name). If, for some reason, you create a new wallet, you need to use this name (so you will probably need to rename the old wallet too).
Comment 1 Justin Zobel 2022-10-20 23:54:34 UTC
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "CONFIRMED" when replying. Thank you!
Comment 2 Bug Janitor Service 2022-11-04 05:07:16 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Bug Janitor Service 2022-11-19 05:14:43 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!