Bug 12364 - gurpmi.addmedia don't work in LXDE
Summary: gurpmi.addmedia don't work in LXDE
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-20 09:21 CET by Alex Loginov
Modified: 2014-01-25 19:49 CET (History)
4 users (show)

See Also:
Source RPM: pcmanfm-1.1.2-3.mga4.src.rpm
CVE:
Status comment:


Attachments
Picture with problem (LXDE) (19.20 KB, image/png)
2014-01-21 08:47 CET, Alex Loginov
Details
Mate with gurpmi (115.46 KB, image/png)
2014-01-22 18:36 CET, Atilla ÖNTAŞ
Details
LXDE screen with gurpmi (169.88 KB, image/png)
2014-01-22 19:21 CET, Atilla ÖNTAŞ
Details
LXDE screen with gurpmi.addmedia (152.22 KB, image/png)
2014-01-22 19:47 CET, Atilla ÖNTAŞ
Details
LXDE screenshot with medias added. (132.87 KB, image/png)
2014-01-22 19:49 CET, Atilla ÖNTAŞ
Details

Description Alex Loginov 2014-01-20 09:21:21 CET
Description of problem:
if to press http://urpmi.mageia.tk/?language=en any button for adding media then nothing happens. I tested opera and firefox. If to download file *.urpmi.media and open in gurpmi.addmedia, then media don't add.


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


How reproducible: always


Steps to Reproduce:
1. http://urpmi.mageia.tk/?language=en to press any button for adding media and choose open
2. nothing happens

or

1. http://urpmi.mageia.tk/?language=en to press any button for adding media and choose save
2. to open saved file *.urpmi.media
3. to enter root password
4. media don't add if to see /etc/urpmi/urpmi.cfg


Reproducible: 

Steps to Reproduce:
Alex Loginov 2014-01-20 09:41:34 CET

Summary: gurpmi.addmedia don't work in MATE => gurpmi.addmedia don't work in MATE, LXDE

Comment 1 Daniel Napora 2014-01-21 00:32:32 CET
It affects also .urpmi file - used to install rpm package, for example on Mageia App DB website ( http://mageia.madb.org/package/show/release/cauldron/arch/x86_64/name/abe )

CC: (none) => napcok

Comment 2 Manuel Hiebel 2014-01-21 00:35:55 CET
any message if you run gurpmi.* from terminal ?
Comment 3 Alex Loginov 2014-01-21 08:47:43 CET
Created attachment 4832 [details]
Picture with problem (LXDE)

I made printscreen from terminal.
Sander Lepik 2014-01-21 08:57:53 CET

CC: (none) => mageia, thierry.vignaud

Daniel Napora 2014-01-22 11:40:37 CET

CC: (none) => tarakbumba

Comment 4 Daniel Napora 2014-01-22 11:55:53 CET
In case of installing rpm from *.urpmi file eg from http://mageia.madb.org/, 
the problem is mate-polkit-agent window not showing up.
Comment 5 Atilla ÖNTAŞ 2014-01-22 12:13:09 CET
When you click on *.urpmi file to add media, do you see a gurpmi window? If you see a gurpmi window asking it will add medias and it does not ask for root password then it may be a double forking issue and then this report becomes a duplicate of bug#11184

If not, i mean you do not see any gurpmi window then it should be fixed in gurpmi and mimetype hanling. May be gurpmi.desktop should be modified.

I' ll look at this when i go home tonight.
Comment 6 Atilla ÖNTAŞ 2014-01-22 12:14:53 CET
(In reply to Atilla ÃNTAÅ from comment #5)
Also, i really think that it should not be a mate-polkit or double forking problem because gurpmi installs rpms without an issue...
Comment 7 Alex Loginov 2014-01-22 13:45:47 CET
LXDE and MATE from web-browser: nothing nappens.
LXDE from file *.urpmi.media: nothing nappens.
MATE from file *.urpmi.media: gurpmi.addmedia starts, but with error like on picture.
LXDE from console: gurpmi.addmedia starts, but with error like on picture.
That's why it's double problem for polkit and gurpmi.addmedia.
Comment 8 Atilla ÖNTAŞ 2014-01-22 15:08:46 CET
(In reply to Alex Loginov from comment #7)
It seems to me that (if all like as seen in your attached image) *.urpmi-media file is either corrupted or misconfigured. Gurpmi does not throw an error but it reports media is successfully added which it not.

Looking into rpmdrake source, there is no polkit integration for gurpmi.addmedia.

http://gitweb.mageia.org/software/rpmdrake/tree/polkit/org.mageia.drakrpm-addmedia.policy.in

Also (notice that i do not know a bit about Perl but...) it seems to me that gurpmi.addmedia parses *.urpmi-media file and uses that as urpmi.addmedia parameters. So, it may be directly related to rpmdrake package.

http://gitweb.mageia.org/software/rpmdrake/tree/gurpmi.addmedia


Also, please attach "journalctl -b" output and your .xsession-errors

Can you verify if this behaviour is also present/not present with another desktop like KDE or GNOME?

Keywords: (none) => NEEDINFO

Comment 9 Atilla ÖNTAŞ 2014-01-22 15:15:41 CET
(In reply to Daniel Napora from comment #1)
Daniel and Alex, when it comes to web browsers it is related with web browsers mimetype handling and executing gurpmi.addmedia or gurpmi2. Thus, i don' t think it is related with mate-polkit or double forking...
Comment 10 Daniel Napora 2014-01-22 15:45:14 CET
I done tests with several DE.

On KDE this works as expected. Shows polkit-agent window to authorization - then install rpm or add media.

On MATE, Cinnamon and RazorQt this doesn't work. Probably all of those DE are using mate-polkit for authorisation.
Comment 11 Daniel Napora 2014-01-22 15:52:28 CET
I done my tests with Firefox and Chromium Browser.
Comment 12 Alex Loginov 2014-01-22 16:12:38 CET
Daniel, I confirm. KDE works well, it's DE specific bug.
Thierry Vignaud 2014-01-22 18:01:35 CET

CC: thierry.vignaud => mageia

Comment 13 Atilla ÖNTAŞ 2014-01-22 18:35:41 CET
I finally get home and tried to reproduce these on my Cauldron MATE install. I confirm that from Firefox either with urpmi-addmedia or .urpmi files, nothing happens. But if i download these and try to run from there gurpmi works as intended. So, for MATE which of course uses mate-polkit, i think it is invalid.

Will try to reproduce with LXDE...
Comment 14 Atilla ÖNTAŞ 2014-01-22 18:36:04 CET
Created attachment 4849 [details]
Mate with gurpmi
Comment 15 Atilla ÖNTAŞ 2014-01-22 18:39:30 CET
For web browser issue, it is a double forking problem with web browser, in my case this is Firefox:

WARNING **: Can't load fallback CSS resource: Failed to import: The resource at '/org/gnome/adwaita/gtk-fallback.css' does not exist at /usr/lib/perl5/vendor_perl/5.18.1/Gtk3.pm line 324.
WARNING **: Can't load fallback CSS resource: Failed to import: The resource at '/org/gnome/adwaita/gtk-fallback.css' does not exist at /usr/lib/perl5/vendor_perl/5.18.1/Gtk3.pm line 324.
Refusing to render service to dead parents.
Comment 16 Colin Guthrie 2014-01-22 18:46:16 CET
Yup! Firefox is doing a double fork sadly :(
Comment 17 Atilla ÖNTAŞ 2014-01-22 19:13:26 CET
Installed LXDE. I also confirm that under LXDE neither from web browser nor from downloaded files gurpmi does not ask for password. I can not find a clue either from journalctl or .xsession-errors. 

When i opened download directory with caja instead of pcmanfm; gurpmi installs *.urpmi files or add medias with *.urpmi-media files. So mate-polkit also works right in LXDE too... 

Colin, is that a double forking issue with pcmanfm?
Comment 18 Atilla ÖNTAŞ 2014-01-22 19:21:29 CET
Created attachment 4850 [details]
LXDE screen with gurpmi

Attached screenshot is what my LXDE installation looks like. As you can see, i opened download directory with Caja and clicled on abe-1.1-12.mga4.x86_64.rpm.urpmi Gurpmi works as intended.
Comment 19 Atilla ÖNTAŞ 2014-01-22 19:28:07 CET
(In reply to Atilla ÃNTAÅ from comment #17)
Yep. PcManFm double forks:

[atilla@localhost ~]$ less /home/atilla/.cache/lxsession/LXDE/run.log
.
.
.
.
Refusing to render service to dead parents.
Comment 20 Atilla ÖNTAŞ 2014-01-22 19:32:58 CET
As i wrote in  comment #5 it is double forking issue for both pcmanfm and firefox. So it is duplicate of bug#11184

*** This bug has been marked as a duplicate of bug 11184 ***

Keywords: NEEDINFO => (none)
Status: NEW => RESOLVED
Hardware: i586 => All
Resolution: (none) => DUPLICATE
Summary: gurpmi.addmedia don't work in MATE, LXDE => gurpmi.addmedia don't work in LXDE
Source RPM: (none) => pcmanfm-1.1.2-3.mga4.src.rpm

Comment 21 Alex Loginov 2014-01-22 19:41:26 CET
Atilla, no effect in /etc/urpmi/urpmi.cfg in real, you saw only window for root's password. Please confirm.
Comment 22 Atilla ÖNTAŞ 2014-01-22 19:46:09 CET
(In reply to Alex Loginov from comment #21)
No, it immediately starts downloading hdlist.cz files and correctly adds to medias.
Comment 23 Atilla ÖNTAŞ 2014-01-22 19:47:39 CET
Created attachment 4851 [details]
LXDE screen with gurpmi.addmedia

Attched screenshot shows that gurpmi.addmedia downloads hdlist.cz files from source on LXDE using easyurpmi.urpmi-media
Comment 24 Atilla ÖNTAŞ 2014-01-22 19:49:25 CET
Created attachment 4852 [details]
LXDE screenshot with medias added.

Attached screenshot shows that easyurpmi medias correctly added to urpmi database.
Comment 25 Atilla ÖNTAŞ 2014-01-22 19:50:22 CET
And, please either re-open this bug report if you do think it is not duplicate or contiune at bug#11184
Comment 26 Daniel Napora 2014-01-22 19:56:41 CET
I made a short movie how it works on MGA4 KDE...
http://youtu.be/O8JqW48j69A
Please watch.
It always works like that on every DE I use (openbox, lxde, kde, icewm), before MGA4 polkit migration.
I'm using this feature since mandriva 2010 and it works also in every Mageia release prior to Mageia4.

So I think this is side effect of Mageia 4 migration to polkit... still works normal with KDE.
Daniel Napora 2014-01-22 19:56:56 CET

Status: RESOLVED => REOPENED
Resolution: DUPLICATE => (none)

Comment 27 Alex Loginov 2014-01-22 20:19:47 CET
Daniel, thank you for your video. I agree with you.
Atilla, I can not comfirm, than MATE works good like KDE. MATE don't work on my installation.
Comment 28 Colin Guthrie 2014-01-22 20:35:12 CET
There are a lot of comments here, but basically:

 1. Firefox double forks and thus can't run anything with pkexec
 2. Other browsers? Chromium, Epiphany, Konq etc - perhaps they are affected too?
 3. pcmanfm also double forks.

Now this could be several bugs to fix :( I certainly don't fancy digging into firefox code, but I'm struggling to think of a way that it could work otherwise...

For media management stuff it would be relatively simply to create a dbus-activated privileged process that does the real work and then pass the arguments as to which media to add over dbus. This allows polkit to work without pkexec and thus not give us any problems, but if firefox is indeed double forking, then it would presumably do the same with an .rpm file when trying to open it in gurpmi? Now doing proper separation on gurpmi would be much harder :(

I'm going to speak with Colin Walters (polkit upstream) and see if he has any bright ideas/shortcuts.
Comment 29 Atilla ÖNTAŞ 2014-01-22 22:14:17 CET
(In reply to Colin Guthrie from comment #28)
(In reply to Daniel Napora from comment #26)
Thanks all of you. I re-install RC from stracth in VM and while i can reproduce this problem with Firefox, can not reproduce with Caja on MATE. Then, it is something that double forks with Firefox on *MATE* desktop which seems to me weird.
Comment 30 Colin Guthrie 2014-01-22 23:24:47 CET
I'm getting it happening in Firefox under GNOME too.

I've also got a nice global fix too. It's actually crazy simple but took speaking with Colin Walters to appreciate it. Will do a round of updates to the tools.
Comment 31 Mageia Robot 2014-01-23 00:22:37 CET
commit 9546268bf1c85d5ddef8204bdfb7e40f55f8b9e3
Author: Colin Guthrie <colin@...>
Date:   Wed Jan 22 23:00:31 2014 +0000

    Do not exec pkexec but run it so it has a parent process to fix double fork issues mga#11184 mga#12364
---
 Commit Link:
   http://gitweb.mageia.org/software/rpmdrake/commit/?id=9546268bf1c85d5ddef8204bdfb7e40f55f8b9e3

 Bug links:
   Mageia
      https://bugs.mageia.org/show_bug.cgi?id=11184
      https://bugs.mageia.org/show_bug.cgi?id=12364
Comment 32 Colin Guthrie 2014-01-23 00:26:11 CET
OK, so this particular issue is fixed in rpmdrake and I have commits for our other polkit tools too. Tested here in firefox on gnome - was broken, now is working.
Comment 33 Mageia Robot 2014-01-23 00:27:18 CET
commit f40d4ecae66a6166ef858770d3863729c78dfb64
Author: Colin Guthrie <colin@...>
Date:   Wed Jan 22 23:00:31 2014 +0000

    Do not exec pkexec but run it so it has a parent process to fix double fork issues mga#11184 mga#12364
---
 Commit Link:
   http://gitweb.mageia.org/software/drakx-net/commit/?id=f40d4ecae66a6166ef858770d3863729c78dfb64

 Bug links:
   Mageia
      https://bugs.mageia.org/show_bug.cgi?id=11184
      https://bugs.mageia.org/show_bug.cgi?id=12364
Comment 34 Mageia Robot 2014-01-23 00:27:23 CET
commit ea927d73e6c1218a44d18efae45dbb5ac8a06821
Author: Colin Guthrie <colin@...>
Date:   Wed Jan 22 23:00:32 2014 +0000

    Do not exec pkexec but run it so it has a parent process to fix double fork issues mga#11184 mga#12364
---
 Commit Link:
   http://gitweb.mageia.org/software/rpm/urpmi/commit/?id=ea927d73e6c1218a44d18efae45dbb5ac8a06821

 Bug links:
   Mageia
      https://bugs.mageia.org/show_bug.cgi?id=11184
      https://bugs.mageia.org/show_bug.cgi?id=12364
Comment 35 Mageia Robot 2014-01-23 00:27:27 CET
commit 6acf16149d317f830e3f2576a68205a450ef5b6f
Author: Colin Guthrie <colin@...>
Date:   Wed Jan 22 23:00:32 2014 +0000

    Do not exec pkexec but run it so it has a parent process to fix double fork issues mga#11184 mga#12364
---
 Commit Link:
   http://gitweb.mageia.org/software/drakx/commit/?id=6acf16149d317f830e3f2576a68205a450ef5b6f

 Bug links:
   Mageia
      https://bugs.mageia.org/show_bug.cgi?id=11184
      https://bugs.mageia.org/show_bug.cgi?id=12364
Comment 36 Mageia Robot 2014-01-23 00:27:32 CET
commit b5c5b3e9c21edeb407ae4060d1ec54b9f542faa3
Author: Colin Guthrie <colin@...>
Date:   Wed Jan 22 23:00:32 2014 +0000

    Do not exec pkexec but run it so it has a parent process to fix double fork issues mga#11184 mga#12364
---
 Commit Link:
   http://gitweb.mageia.org/software/control-center/commit/?id=b5c5b3e9c21edeb407ae4060d1ec54b9f542faa3

 Bug links:
   Mageia
      https://bugs.mageia.org/show_bug.cgi?id=11184
      https://bugs.mageia.org/show_bug.cgi?id=12364
Comment 37 Mageia Robot 2014-01-23 00:27:37 CET
commit 86df91fdd1bae8c5c055de70060902094dc09ba0
Author: Colin Guthrie <colin@...>
Date:   Wed Jan 22 23:00:32 2014 +0000

    Do not exec pkexec but run it so it has a parent process to fix double fork issues mga#11184 mga#12364
---
 Commit Link:
   http://gitweb.mageia.org/software/drakx-kbd-mouse-x11/commit/?id=86df91fdd1bae8c5c055de70060902094dc09ba0

 Bug links:
   Mageia
      https://bugs.mageia.org/show_bug.cgi?id=11184
      https://bugs.mageia.org/show_bug.cgi?id=12364
Comment 38 Mageia Robot 2014-01-23 00:27:41 CET
commit 33b0066a1e912425c7d69f831077d27fa3129082
Author: Colin Guthrie <colin@...>
Date:   Wed Jan 22 23:00:32 2014 +0000

    Do not exec pkexec but run it so it has a parent process to fix double fork issues mga#11184 mga#12364
---
 Commit Link:
   http://gitweb.mageia.org/software/userdrake/commit/?id=33b0066a1e912425c7d69f831077d27fa3129082

 Bug links:
   Mageia
      https://bugs.mageia.org/show_bug.cgi?id=11184
      https://bugs.mageia.org/show_bug.cgi?id=12364
Comment 39 Mageia Robot 2014-01-23 00:27:47 CET
commit 97f71b4dedbea63f0309c9cbf537e63002142855
Author: Colin Guthrie <colin@...>
Date:   Wed Jan 22 23:00:32 2014 +0000

    Do not exec pkexec but run it so it has a parent process to fix double fork issues mga#11184 mga#12364
---
 Commit Link:
   http://gitweb.mageia.org/software/drak3d/commit/?id=97f71b4dedbea63f0309c9cbf537e63002142855

 Bug links:
   Mageia
      https://bugs.mageia.org/show_bug.cgi?id=11184
      https://bugs.mageia.org/show_bug.cgi?id=12364
Comment 40 Mageia Robot 2014-01-23 00:27:52 CET
commit 5d2b909dcdbfd7c44931b153d4e9ea94916e31b1
Author: Colin Guthrie <colin@...>
Date:   Wed Jan 22 23:00:32 2014 +0000

    Do not exec pkexec but run it so it has a parent process to fix double fork issues mga#11184 mga#12364
---
 Commit Link:
   http://gitweb.mageia.org/software/mgaonline/commit/?id=5d2b909dcdbfd7c44931b153d4e9ea94916e31b1

 Bug links:
   Mageia
      https://bugs.mageia.org/show_bug.cgi?id=11184
      https://bugs.mageia.org/show_bug.cgi?id=12364
Comment 41 Alex Loginov 2014-01-23 15:54:53 CET
Now it's OK in MATE, LXDE for browsers, I tested firefox, opera. But not OK for pcmanfm.
Comment 42 Colin Guthrie 2014-01-25 19:49:23 CET
I think the pcmanfm issue must be different. As such can you open a new bug for that as it's less globally problematic!!

Status: REOPENED => RESOLVED
Resolution: (none) => FIXED


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