Bug 1285342

Summary: copy/pasting passwords from keepass (xwayland) to wayland apps doesn't work
Product: [Fedora] Fedora Reporter: madstitz
Component: xselAssignee: Tomas 'Sheldon' Radej <tradej>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: afinkelsrc, alexey.brodkin, alexus_m, barsnick, el, ezwen-redhatbugzilla, folkert.meeuw, gareth, harmathy, hcamp, jusansa1, lucachess, madstitz, mail, mavit, michael.monreal, mizdebsk, msrb, pschiffe, rakesh.pandit, tadej.j, thomas, tradej
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-29 11:56:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1277927    

Description madstitz 2015-11-25 12:30:29 UTC
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):
2.30

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 18:51:07 UTC
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 13:06:08 UTC
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 19:50:16 UTC
(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 18:58:17 UTC
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 16:38:32 UTC
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 10:01:02 UTC
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 13:18:09 UTC
(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 11:13:16 UTC
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 13:13:29 UTC
This bug is currently preventing me from using Wayland on F24. I absolutely rely on KeePass...

Comment 10 Frank Ansari 2016-06-28 17:51:19 UTC
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-02 00:39:53 UTC
*** Bug 1321454 has been marked as a duplicate of this bug. ***

Comment 12 Gareth Williams 2016-10-10 16:21:31 UTC
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 20:08:16 UTC
I can confirm this. KeePass became practically unusable since the introduction of Wayland.

Comment 14 Fedora End Of Life 2016-11-24 13:43:52 UTC
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 16:45:47 UTC
Still valid in F24 so please bump the version.

Comment 16 Frank Ansari 2016-12-24 16:44:05 UTC
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 ell1e 2017-02-20 21:09:59 UTC
I just filed an upstream bug here: https://bugzilla.gnome.org/show_bug.cgi?id=778979 (GNOME bugtracker)

Comment 18 ell1e 2017-02-20 21:17:52 UTC
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 19:58:51 UTC
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 ell1e 2017-03-04 20:32:28 UTC
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 12:30:11 UTC
I also encounter the problems mentionned here, with F26 alpha.

Comment 22 Michael Monreal 2017-07-16 20:02:11 UTC
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 18:03:59 UTC
(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:
https://apps.fedoraproject.org/packages/keepass/
(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 21:31:51 UTC
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 11:14:41 UTC
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

Comment 26 Folkert M. 2017-10-12 19:11:33 UTC
Hello Oliver,
here what I did.

[folkertm@wurzel ~]$ eval 'locale'
LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=

[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 21:49:10 UTC
(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 10:16:01 UTC
(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 13:21:46 UTC
(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

Comment 30 Peter Schiffer 2018-04-25 14:19:43 UTC
I see this problem, sometimes when trying to copy password from keepass, keepass freezes, but for me it is enough to 'killall xsel' to unfreeze keepass.

Comment 31 Peter Oliver 2018-04-25 16:04:40 UTC
Assigning to xsel to seek its maintainer's input.

Do we know whether xsel generally works well under Wayland?  Could it be the source of this problem?

Comment 32 Fedora End Of Life 2018-05-03 08:45:55 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. 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 '26'.

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 26 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 33 Tomas 'Sheldon' Radej 2018-05-03 10:08:04 UTC
I don't use Wayland so I don't know, but I'll spin up a VM with a flavourless Fedora in the coming few days.

Comment 34 Fedora End Of Life 2018-05-29 11:56:42 UTC
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
is no longer maintained, which means that it will not receive any
further security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.