Bug 1285342 - copy/pasting passwords from keepass (xwayland) to wayland apps doesn't work
copy/pasting passwords from keepass (xwayland) to wayland apps doesn't work
Status: NEW
Product: Fedora
Classification: Fedora
Component: keepass (Show other bugs)
Unspecified Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Peter Oliver
Fedora Extras Quality Assurance
: 1321454 (view as bug list)
Depends On:
Blocks: WaylandRelated
  Show dependency treegraph
Reported: 2015-11-25 07:30 EST by madstitz
Modified: 2018-03-01 05:07 EST (History)
18 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description madstitz 2015-11-25 07:30:29 EST
Description of problem:
when trying to copy/paste a password from keepass to e.g epiphany (or any other gtk3/wayland apps) under a gnome-wayland session, nothing gets pasted.
copying to other xwayland apps like spotify works as expected.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. open entry in keepass running under xwayland (gnome-wayland-session)
2. select/unmask password entry, mark text and hit ctrl+c/rightclick-copy
3. try to paste password in a gtk3/wayland app (using keyboard or mouse)

Actual results:
password doesn't get pasted

Expected results:
password does get pasted

Additional info:
Comment 1 Frank Ansari 2016-01-05 13:51:07 EST
I can confirm these. And even worse keepass is hanging. All entries are suddenly in grey. You cannot even close the application.

Also opening the entry and copying it does not work if you try to copy it into a shell console. You can although copy it e.g. into the Atom editor (but only if you open the entry first). Ctrl-C from to a closed entry does not work and makes everything hang as mentioned above.

Keepass is an important application and should work with Wayland.
Comment 2 Frank Ansari 2016-01-23 08:06:08 EST
When will this be fixed? Ctrl-C on KeePass still leads to a hanging program.
All entries and menues become white. Closing of program is not possible. So I have to do "killall mono" to stop the program.

Why does KeePass behave so strange running in a Wayland environment?
Comment 3 Peter Oliver 2016-01-25 14:50:16 EST
(In reply to Frank Ansari from comment #2)
> When will this be fixed?

Maybe never.  KeePass relies on Mono's WinForms, which is no-longer being actively developed (see, e.g., http://forums.dotnetfoundation.org/t/anyone-porting-winforms-mono-to-net-core/898/2).  If it turns out that this is where the bug lies, we could be out of luck.

Still, there are things we can look in to.  What can you tell us about the circumstances in which this happens?  I'm not able to reproduce it in a virtual machine.

My recollection is that KeePass (sometimes?) use xdotool for interacting with the clipboard.  Could you try "sudo rpm -e xdotool --nodeps" and see if that makes any difference?
Comment 4 Frank Ansari 2016-01-26 13:58:17 EST
If this is true then there are two choices: either to forget about KeePass or about Wayland. But regarding Wayland I don't know whether I have a chance. As far as I understood it Wayland will replace Xorg in the near future in Fedora. So I thought the best stragey is to inform you here so this can be fixed.

I have removed xdotool and have the same effect.

What I use is a pyhsical PC where I have Fedora 23 installed (updated from Fedora 22).

I already guessed that it might have something todo with Mono since other programs do not have such symtoms. I mean there are smaller effects like the cursor is sometimes not available in the gnome terminal and I have to click with the mouse several times until I can use it (cusrsor is an empty block first and I have to click until it becomes a filled block).

What I can do in KeePass is to open the entry and I can copy the password from there. But even then I cannot paste it into a gnome terminal. But I could open an editor like atom and paste it there. From there I can copy & paste it into the gnome terminal. This is very unconvient.
Comment 5 Frank Ansari 2016-02-28 11:38:32 EST
Today I tested the behaviour of keepassx. This application does not use mono. But also with keepassx copy & paste into the gnome terminal is not possible. The only advantage is that the application is not hanging when I try to copy something.

Also here I have to use some xwayland application like the atom editor and paste the password in and then copy it from there and then copy it into the gnome terminal.
Comment 6 Frank Ansari 2016-03-23 06:01:02 EDT
Any updates on this? As far as I understood only keepass does use mono and Winforms but not keepassx. So why does even keepassx not work with Wayland?
Comment 7 Peter Oliver 2016-03-26 09:18:09 EDT
(In reply to Frank Ansari from comment #6)
> Any updates on this? As far as I understood only keepass does use mono and
> Winforms but not keepassx. So why does even keepassx not work with Wayland?

As you say, keepassx is an entirely separate piece of software.  If you're having trouble with that, you'll need to log a separate bug.
Comment 8 Frank Ansari 2016-06-25 07:13:16 EDT
Good news is that in fc24 KeePass is no longer freezing wehn I try to copy the password.

But apart from this the behaviour is as before.

After starting my computer most oftime times I can paste the password into a Gnmome shell when I do this direcly after startup. Lateron I have to do the workaround to put the password into some editor first and copy from there into the Gnome shell.

This is a strange effect. Why does it sometimes work and sometimes not?
Comment 9 Michael Monreal 2016-06-26 09:13:29 EDT
This bug is currently preventing me from using Wayland on F24. I absolutely rely on KeePass...
Comment 10 Frank Ansari 2016-06-28 13:51:19 EDT
I have to correct myself. The freezing issue is not solved. Just now I had again to do "killall mono" in order to close KeePass.

For some reason everything works fine after I started my Gnome session. But some minutes later the situation is changing an KeePass becomes unusuable.
Comment 11 Chris Smart 2016-09-01 20:39:53 EDT
*** Bug 1321454 has been marked as a duplicate of this bug. ***
Comment 12 Gareth Williams 2016-10-10 12:21:31 EDT
Just to add that this is also present in Fedora 25 Alpha.  If I run it with a --debug option (I guessed it as it's not listed in the man page), I get:

Created new window in existing browser session.

at which point both Keepass and my browser (Chrome) freeze until I kill Keepass, which causes the browser to spring to life again.  While frozen, Keepass displays the same grey list of items as Frank reported.

It works fine under an Xorg session.
Comment 13 Frank Ansari 2016-11-03 16:08:16 EDT
I can confirm this. KeePass became practically unusable since the introduction of Wayland.
Comment 14 Fedora End Of Life 2016-11-24 08:43:52 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 15 Michael Monreal 2016-11-24 11:45:47 EST
Still valid in F24 so please bump the version.
Comment 16 Frank Ansari 2016-12-24 11:44:05 EST
This issue appears also on a fresh installation of Fedora 25.

Copy and paste works after booting the PC. I then closed the applicatio and tried again some time later (about 30 min perhaps). I could not copy and paste anymore.
Comment 17 Jonas Thiem 2017-02-20 16:09:59 EST
I just filed an upstream bug here: https://bugzilla.gnome.org/show_bug.cgi?id=778979 (GNOME bugtracker)
Comment 18 Jonas Thiem 2017-02-20 16:17:52 EST
Sorry, I guess not upstream but potentially related other application (since I filed it for GNOME 3 and not keepass itself). However, since there seem other tickets about clipboard oddities, this might also be a general GNOME 3 or XWayland issue I guess... so let's hope the GNOME devs have an idea what might be the culprit and whether there's something that can be fixed to make this work.

Anyway, wouldn't XWayland apps also potentially not get the security benefit of preventing event spying/injection and other stuff from other X11 apps which Wayland now gives (as far as I'm informed)? If that is the case, it would be somewhat unfortunate if especially for a sensitive password manager app there wasn't some sort of long-term plan to potentially migrate keepass to native Wayland status..
Comment 19 Frank Ansari 2017-03-04 14:58:51 EST
It is really even worse than a copy problem or keepass freeze. The behaviour affects other applications like Chrome.

Today I noticed that moneyplex was hanging when I wanted to send money.

Opeing and closing moneyplex did not help.

Then I had the idea to close keepassx directly after I entered my password into moneyplex and this helped.

I really would appreciate if someone could fix either keepass or keepassx or both.
Comment 20 Jonas Thiem 2017-03-04 15:32:28 EST
For what it's worth, I made a separate ticket for keepass making GNOME Wayland hang here: https://bugzilla.gnome.org/show_bug.cgi?id=778275
Comment 21 Gwendal 2017-06-09 08:30:11 EDT
I also encounter the problems mentionned here, with F26 alpha.
Comment 22 Michael Monreal 2017-07-16 16:02:11 EDT
FWIW the latest KeePass release has a workaround for this bug. Install xsel and xdotool to make it work.
Comment 23 barsnick 2017-07-22 14:03:59 EDT
(In reply to Michael Monreal from comment #22)
> FWIW the latest KeePass release has a workaround for this bug.

Unfortunately, latest keepass isn't provided for F24..F26:
(F24: 2.32-2, F25: 2.34-4, F26: 2.35-3, F27: 2.36-1).
It builds fine though (and actually works), I have builds in copr.

>  Install xsel and xdotool to make it work.

I was told xdotool doesn't work with Wayland? I don't know the difference to XWayland though, and whether the latter is relevant to keepass.
Comment 24 Folkert M. 2017-10-11 17:31:51 EDT
I have analyzed the problem under Fedora 24 and came to the following result:
It is not clear whether the problem is with Fedora or the KeePass package.

The steps of the analysis:
1) Open a terminal
2) Start vi in ​​the terminal
3) Click the [i] key to insert
4) Open KeePass
5) Open the database
6) Using the "Copy Password" function of KeePass
7) Paste the copied password into vi
8) Analyze the string in vi

The inserted string looks like this in the vi: "<feff>fSpRy0ExCk7H6Quz57dC"
There is an error message when you enter it in the corresponding user account.
The password is accepted by entering the string without this <feff>.
Comment 25 Peter Oliver 2017-10-12 07:14:41 EDT
Folkert M.: It sounds like you're experiencing a different problem, since other users report not being able to paste at all.

In any case, does this problem still happen if you start KeePass from a terminal in the following way?

    eval `locale`
    export LC_CTYPE=`echo "$LC_CTYPE" | cut -f1 -d.`
Comment 26 Folkert M. 2017-10-12 15:11:33 EDT
Hello Oliver,
here what I did.

[folkertm@wurzel ~]$ eval 'locale'

[folkertm@wurzel ~]$ export LC_CTYPE='echo "$LC_CTYPE" | cut -f1 -d.'
bash: Warnung: setlocale: LC_CTYPE: Kann nicht die Locale ändern (echo "$LC_CTYPE" | cut -f1 -d.): No such file or directory
bash: Warnung: setlocale: LC_CTYPE: Kann nicht die Locale ändern (echo "$LC_CTYPE" | cut -f1 -d.): No such file or directory

Something went wrong.
Comment 27 barsnick 2017-10-12 17:49:10 EDT
(In reply to Folkert M. from comment #26)
> [folkertm@wurzel ~]$ eval 'locale'

You need to use backticks:
$ eval `locale`
Comment 28 Luca 2017-11-25 05:16:01 EST
(In reply to Peter Oliver from comment #25)
> Folkert M.: It sounds like you're experiencing a different problem, since
> other users report not being able to paste at all.
> In any case, does this problem still happen if you start KeePass from a
> terminal in the following way?
>     eval `locale`
>     export LC_CTYPE=`echo "$LC_CTYPE" | cut -f1 -d.`
>     keepass

this fixed my problem!
Comment 29 Folkert M. 2018-01-29 08:21:46 EST
(In reply to barsnick from comment #27)
> (In reply to Folkert M. from comment #26)
> > [folkertm@wurzel ~]$ eval 'locale'
> You need to use backticks:
> $ eval `locale`

Yes, that is possible. But it's unclear what I'm doing there: 'locale' or `locale`. Anyway I don't use Fedora 24 anymore. From my point of view close it, otherwise I will receive your reminder email for longer periods.

Best regards Folkert

Note You need to log in before you can comment on or make changes to this bug.