Bug 325427 - kwalletmanager crashes when dragging a "password pair" from one folder into another one
Summary: kwalletmanager crashes when dragging a "password pair" from one folder into a...
Status: RESOLVED WAITINGFORINFO
Alias: None
Product: kwalletmanager
Classification: Applications
Component: general (show other bugs)
Version: 1.10
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Valentin Rusu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-29 14:48 UTC by H.H.
Modified: 2021-06-21 19:10 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.12


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.H. 2013-09-29 14:48:32 UTC
My original intention was to rename a main-folder in a wallet. because that is not possible, I tried to create a new folder and drag the passwords in it.

But on dragging a password pair from one into another folder in the tree view crashes kwalletmanager.

so btw.: I have the wish to be able to rename folders in kwalletmanager. why? for example, because the thunderbird extension creates a folder named "unknown", but it is possible to change that, but then, the passwords are not moved :-(

Reproducible: Always
Comment 1 Jekyll Wu 2013-09-29 21:20:29 UTC
please always provide backtrace when reporting crashes.
Comment 2 H.H. 2013-09-30 06:44:37 UTC
I am not shure, if this helps:

Application: Dienstprogramm für digitale Brieftaschen (kwalletmanager), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[KCrash Handler]
#5  0x000000000042fb6c in _start ()


I have installed debug-symbols für kwalletmanager
Comment 3 Valentin Rusu 2013-09-30 20:37:04 UTC
I'm afraid current kwallet API won't allow implementing your wish. This is because kwallet identifies folders by name and not by ID. And applications always specify the folder's name. In this case, the thunderbird extensions should use a more specific folder name. I suggest you file a bug to that extension's developer.

Meanwhile, I confirm I get a crash when dragging folders. Working on that.
Comment 4 Valentin Rusu 2013-10-12 20:07:27 UTC
Git commit dd8865824ac708ec48baad1617663cb4c4998add by Valentin Rusu.
Committed on 30/09/2013 at 21:43.
Pushed by vrusu into branch 'master'.

Fix crash on drag&drop inside the wallet editor
FIXED-IN: 4.12

M  +2    -1    src/manager/allyourbase.cpp
M  +1    -0    src/manager/kwalleteditor.cpp

http://commits.kde.org/kwallet/dd8865824ac708ec48baad1617663cb4c4998add
Comment 5 H.H. 2016-07-12 15:53:10 UTC
Thanks for fixing the crash.

My original problem is still not solved. Explanation:

> In this case, the thunderbird extensions should use a more specific folder name. I suggest you file a bug to that extension's developer.

The problem is, that the extension can be used for thunderbird AND/OR firefox.

So the extension's developer can not know, which name to set (firefox or thunderbird), so he built a configuration option for that name. Thats fine in general.

I could add a "renameFolder" Method to the kwallet API and kwalletmanager. Would it be accepted?  I already had a look at the code, the method in the backend would look similar to

bool Backend::renameFolder(const QString &from, const QString &to)
{
    if (!_entries.contains(from)) {
        return false;
    }
    if (_entries.contains(to)) {
        return false;
    }
    EntryMap entryMap = _entries.take(from);
	_entries.insert(to, entryMap);

    QCryptographicHash fromMd5(QCryptographicHash::Md5);
    fromMd5.addData(from.toUtf8());
    QCryptographicHash toMd5(QCryptographicHash::Md5);
    toMd5.addData(to.toUtf8());

	QList<MD5Digest> hashList = _hashes.take(MD5Digest(fromMd5.result()));
	
    _hashes.insert(MD5Digest(toMd5.result()), hashList);

    return true;
}
Comment 6 H.H. 2016-10-09 20:17:29 UTC
It would be nice to get feedback about my last comment.
Comment 7 Elvis Angelaccio 2016-10-28 11:03:15 UTC
(In reply to H.H. from comment #6)
> It would be nice to get feedback about my last comment.

You will have more luck if you upload your patch here: https://git.reviewboard.kde.org/
Comment 8 H.H. 2016-10-28 13:41:28 UTC
I haven't written a fully patch yet, and also the gui part is missing completely. If you tell me, that my work will be accepted (at least after a few review-board iterations), I will prepare a patch for reviewboard.  But I have not enough time, to invest much time into this, and then get told, that such a change would not be accepted in general.
Comment 9 Elvis Angelaccio 2016-10-28 14:19:19 UTC
(In reply to H.H. from comment #8)
> I haven't written a fully patch yet, and also the gui part is missing
> completely. If you tell me, that my work will be accepted (at least after a
> few review-board iterations), I will prepare a patch for reviewboard.  But I
> have not enough time, to invest much time into this, and then get told, that
> such a change would not be accepted in general.

The main problem is that kwallet is currently unmaintained. But if your patch doesn't break anything and you convince enough people that it's something useful, I don't see why it shouldn't be accepted.
Comment 10 Justin Zobel 2021-06-20 08:40:27 UTC
(In reply to H.H. from comment #8)
> I haven't written a fully patch yet, and also the gui part is missing
> completely. If you tell me, that my work will be accepted (at least after a
> few review-board iterations), I will prepare a patch for reviewboard.  But I
> have not enough time, to invest much time into this, and then get told, that
> such a change would not be accepted in general.

Was this patch eventually added and/or merged? I believe this ticket can be closed anyway as it is about the crash which is now fixed according to comments.

This bug has been set to "NEEDSINFO/WAITINGFORINFO", if you are able to update the bug report please mark it as reported when you add the new information, thank you.
Comment 11 H.H. 2021-06-21 19:10:12 UTC
Ok, I'm closing. But renaming was not added, and seems still a good idea to add as a feature.