FS#34166 - [unetbootin] Various fixes
Attached to Project:
Community Packages
Opened by Balló György (City-busz) - Wednesday, 06 March 2013, 07:01 GMT
Last edited by Alexander F. Rødseth (xyproto) - Sunday, 17 March 2013, 10:34 GMT
Opened by Balló György (City-busz) - Wednesday, 06 March 2013, 07:01 GMT
Last edited by Alexander F. Rødseth (xyproto) - Sunday, 17 March 2013, 10:34 GMT
|
Details
I would like to propose the following changes in unetbootin
packaging (see the attachment):
- Use pkexec only in the desktop file. There is no reason to modify the binary name, since command line users could able to run as root either with 'pkexec unetbootin' or 'sudo unetbootin'. - Move polkit-gnome to opdepends, since it's only needed to launch unetbootin from menu. And GNOME Shell and KDE users are don't need to install this package, since they contain an authentication agent. - Use --disable-internal-agent option on pkexec to avoid X freeze in case of no graphical authentication agent available. - Remove desktop-file-utils dependency and update-desktop-database from install file, because the unetbootin.desktop file does not contain MIME types. - Use xdg-icon-resource instead of gtk-update-icon-cache, so we can remove this dependency. - It looks for me that xorg-xmessage is not used by unetbootin, so remove it from depends. |
This task depends upon
polkit-gnome is installed.
My windowmanager is PekWM, and I'm using xfce4-panel for testing if GUI-applications starts from the menu.
I really like the intention behind these changes, so hopefully there is a way to fix this.
Upstream report: https://bugzilla.xfce.org/show_bug.cgi?id=9373
Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=690339
Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=879922
But there is an easy workaround: add the following line to the end of the package() function:
echo 'StartupNotify=true' >> "${pkgdir}/usr/share/applications/unetbootin.desktop"
- GNOME Shell: works well both from the menu and with the Alt+F2 launcher
- GNOME Panel (in fallback mode): works well both from the menu and with the Alt+F2 launcher
- Cinnamon: works well from the menu, but doesn't work with the Alt+F2 launcher
- Unity: doesn't work either from the menu or with the Alt+F2 launcher
- Xfce: works from the menu with the 'StartupNotify' workaround, but doesn't work the Alt+F2 launcher
- LXDE: doesn't work either from the menu or with the Alt+F2 launcher
File managers, which could able to launch applications from .desktop files:
- Nautilus: doesn't work
- Nemo: doesn't work
- Thunar: works with the 'StartupNotify' workaround
- PCManFM: doesn't work
I haven't tested KDE, but as shown above, you are right, the wrapper script needs to be preserved, because many app launchers unable to handle pkexec directly.
In
FS#34168, I requested to remove this wrapper script from gparted, but it was a mistake. But we need a consistent naming for these wrapper scripts. Other affected packages: gsmartcontrol, wifi-radar.I have created "ponysu" for having a consistent way of running GUI applications: https://aur.archlinux.org/packages/ponysu/
It has a sligthly silly name, but I could give it a better one and move it to [community] if several packages could use it and if you think it's a good idea.
I'll look at the new patch too.
1. polkit added as a dependency, which results that the first condition (pkexec) is always true.
2. pkexec is not always enough to run the command, because if the user launch the application from application menu or Alt+F2 launcher, and no graphical authentication agent available, then it's unable to get password, and freezes the X server. So we need these checks:
a) Am I launched from a terminal emulator? Okay, then I can use the command line authentication agent of polkit.
b) Am I launched from somewhere else? Then check if a graphical authentication agent available and run (e.g. GNOME Shell, KDE, polkit-gnome, lxpolkit). If yes, then I can use pkexec. If not, I should fall back to something else (e.g. gksudo, kdesu).
Do you think lxpolkit should be supported too, even though it's not in the repos?
- Check if a polkit authentication agent is already running first, and don't try to launch an another one in this case.
- polkit-gnome-authentication-agent-1 is too long for pgrep, check for ^polkit-gnome instead.
- We should wait some time after a polkit authentication agent started to register itself.
- Add support for LXPolkit.
- pkttyagent doesn't need to be started manually.
- gksudo is only a symlink to gksu, so don't check it.
- polkit-kde is a dependency of KDE, so kdesudo and kdesu are never used, and they are not in the official repos. Don't use it.
- Use sudo if no polkit or gksu available, but we are in terminal.
- Always exit when we start an authentication, otherwise the user gets the authentication form multiple times, when he cancel the authentication.
I added an LXPolkit package into AUR, and I would like to move it into the [community] repository in the future:
https://aur.archlinux.org/packages/lxpolkit/
Added your changes here: https://github.com/xyproto/guisu
However, I got this message when running guisu (that were running pkexec) from a terminal:
"""
Error executing command as another user: Not authorized
This incident has been reported.
"""
After changing the script to use "&& exit 0" instead of exit on a separate line, the fallbacks kicked in, so now it works for me too.
I also uploaded guisu to [community].
If everything works for you as well now, I'll change unetbootin to use guisu.
+1 for moving lxpolkit from AUR to [community].
EDIT: maybe polkitd is not running?
It's at this step:
pkexec --disable-internal-agent "$ELF" "$ARGS"
Updated the git repo to use exit 0 on separate lines again. Updated the guisu package and changed unetbootin in svn.
Would you mind testing if the newly released version of unetbootin (pkgrel 5) works for you? If it does, I'll close this bug.
Thank you.
Closing this bug. Please reopen if this should still be an issue.
[0] https://github.com/xyproto/guisu
[1] https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/guisu
[2] https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/unetbootin