Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] xdg-su missing from xdg-utils ebuild
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
C5ace
Apprentice
Apprentice


Joined: 23 Dec 2013
Posts: 282
Location: Brisbane, Australia

PostPosted: Sat Apr 04, 2015 2:35 pm    Post subject: [SOLVED] xdg-su missing from xdg-utils ebuild Reply with quote

I have moved from OpenSuse 13.1 to Gentoo. All works fine, except that "xdg-su" is missing from xdg-utils ebuild.

Is there a alternative to xdg-su?


Last edited by C5ace on Mon Apr 06, 2015 1:42 am; edited 1 time in total
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2642

PostPosted: Sat Apr 04, 2015 5:48 pm    Post subject: Reply with quote

Never seen xdg-su before ...
https://github.com/tarakbumba/xdg-su/blob/master/ChangeLog
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sat Apr 04, 2015 7:19 pm    Post subject: Reply with quote

Usually your DE has an alternative; eg kdesu on KDE.

Though I thought it used xdg-su (or something shared) under the surface.
Back to top
View user's profile Send private message
C5ace
Apprentice
Apprentice


Joined: 23 Dec 2013
Posts: 282
Location: Brisbane, Australia

PostPosted: Sat Apr 04, 2015 11:46 pm    Post subject: Reply with quote

My DE is Xfce.

With OpenSuse and other distributions xdg-su is part of xdg-utils and installed when installing xdg-utils.

The OpenSuse version does not work with Gentoo.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sun Apr 05, 2015 4:10 am    Post subject: Reply with quote

Have you tried just using su or installing app-admin/sudo?

Just wondering whether you actually need the xdg one; I realise that's probably annoying if you know you do. Let me off. ;)
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1699

PostPosted: Sun Apr 05, 2015 5:03 am    Post subject: Reply with quote

Ok, I was just curious as why xdg-utils from SuSe has that file, while upstream does not. According to what I have read, Upstream dropped xdg-su because it was breaking stuff and they wasn't interested to maintain it.

According to SuSe source file for information, they have some custom patches they are maintaining to add it back in

Code:
install-some-more-scripts.diff:

From: Jiri Slaby <jslaby@suse.cz>
Subject: Install some more scripts

Why are they commented in the repo?

---
 scripts/Makefile.in |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -20,11 +20,11 @@ SCRIPTS      = \
     xdg-open \
     xdg-email \
     xdg-screensaver \
-    xdg-settings
-#    xdg-su
+    xdg-settings \
+    xdg-su \
+    xdg-terminal
 #    xdg-copy \
 #    xdg-file-dialog
-#    xdg-terminal
 
 MANPAGES=   $(SCRIPTS:%=man/%.1)
 WEBPAGES=   $(SCRIPTS:%=html/%.html)

Code:

Index: xdg-utils-20120916/scripts/xdg-su.in
Patch by Simon Lees simon@simotek.net based off a earlier patch
by Tomas Cech, this patch does 2 things,
1. In both xdg-su and xdg-terminal enlightenment is detected but then
   no action is performed, this patch performs a action in these cases
2. Rather then performing the generic action specific enlightenment
   actions have been added to use terminology rather then xterm as it
   is essientially the enlightenment terminal emulator and matches the
   terminology theme
===================================================================
--- xdg-utils-20120916.orig/scripts/xdg-su.in
+++ xdg-utils-20120916/scripts/xdg-su.in
@@ -525,6 +525,27 @@
 
 [ x"$1" != x"" ] || exit_failure_syntax
 
+su_enlightenment()
+{
+# Enlightenment doesn't have any reasonably working su/sudo graphical interface
+# but terminology works as a drop in replacement for xterm and has a matching theme
+    if which terminology >/dev/null ; then
+        if [ -z "$user" ] ; then
+            terminology -g 60x5 -T "xdg-su: $cmd" -e "su -c '$cmd'"
+        else
+            terminology -g 60x5 -T "xdg-su: $cmd" -e "su -c '$cmd' '$user'"
+        fi
+
+        if [ $? -eq 0 ]; then
+            exit_success
+        else
+            exit_failure_operation_failed
+        fi
+    else
+        su_generic
+    fi
+}
+
 user=
 cmd=
 while [ $# -gt 0 ] ; do
@@ -588,6 +609,10 @@
     su_xfce
     ;;
 
+    enlightenment)
+    su_enlightenment
+    ;;
+   
     *)
     [ x"$user" = x"" ] && user=root
     exit_failure_operation_impossible "no graphical method available for invoking '$cmd' as '$user'"
Index: xdg-utils-20120916/scripts/xdg-terminal.in
===================================================================
--- xdg-utils-20120916.orig/scripts/xdg-terminal.in
+++ xdg-utils-20120916/scripts/xdg-terminal.in
@@ -563,6 +563,19 @@
     fi
 }
 
+terminal_enlightenment()
+{
+    if which terminology &>/dev/null; then
+        if [ x"$1" = x"" ]; then
+            terminology
+        else
+            terminology -e "$1"
+        fi
+    else
+        terminal_generic "$1"
+    fi
+}
+
 #[ x"$1" != x"" ] || exit_failure_syntax
 
 command=
@@ -606,6 +619,10 @@
     lxde)
     terminal_lxde "$command"
     ;;
+   
+    enlightenment)
+    terminal_enlightenment "$command"
+    ;;
 
     generic)
     terminal_generic "$command"


Copy Of SuSe's change log for xdg-utils:
Code:
-------------------------------------------------------------------
Tue Jan 20 12:14:38 UTC 2015 - jslaby@suse.com

- update to 20150119
  * xdg-open: Improve performance of get_key function
  * xdg-open: better fix for command injection vulnerability (bnc#913676)
  * xdg-screensaver: Change screensaver_freedesktop's interpretation of GetActive
  * xdg-mime: dereference symlinks when using mimetype or file
  * xdg-open: command injection vulnerability
  * xdg-screensaver should control X11's screensaver in xfce as fallback

-------------------------------------------------------------------
Sun Dec 28 08:43:50 UTC 2014 - simon@simotek.net

- add fix-enlightenment-support.patch
  * xdg-su and xdg-terminal both detected enlightenment then did nothing
  * xdg-su and xdg-terminal both use terminology rather then xterm now

-------------------------------------------------------------------
Thu Nov 27 15:41:10 UTC 2014 - jslaby@suse.com

- Update to 20141009:
  * more of plasma5
- xdg-mime-generic-do-not-return-more-than-one-default.patch (bnc#906625)
- .spec cleanup

-------------------------------------------------------------------
Tue Sep 23 16:32:40 UTC 2014 - hrvoje.senjan@gmail.com

- Update to 20140922:
  * Initial support for Plasma5
  * XFCE .desktop file created for browser selection is broken
    (fdo#56092)
  * Unnecessary filtering file:// for pcmanfm (fdo#63153)
  * fails if user sets a custom IFS environment variable
    (fdo#81386)
  * xdg-utils-common is broken, xdg-open uses bashism (fdo#83979)
  * xdg-email: do not encode - character

-------------------------------------------------------------------
Mon Jun 30 14:54:19 UTC 2014 - fcrozat@suse.com

- Update to 20140630:
  * manpage for xdg-su and xdg-terminal
  * xdg-terminal: better support for screen and rxvt variants
  * add xdg-settings tool
  * improve KDE detection
  * xdg-open: various fixes
  * xdg-screensaver: use D-Bus api to lock GNOME screensaver

-------------------------------------------------------------------
Thu Jan  9 13:51:11 UTC 2014 - jslaby@suse.com

- update to 20140109
  * xdg-mime: generic, handle filenames with colon (bnc#854777)
  * xdg-desktop-menu: improperly check for vendor prefix ...
  * xdg-screensaver: Support MATE desktop part 2
  * xdg-desktop-menu: Unquoted file name (BR69399)
  * xdg-open: Detect Enlightenment and make use of it
  * xdg-open: be more paranoid in escaping
- xdg-open-be-more-paranoid-in-escaping.patch: remove

-------------------------------------------------------------------
Wed Oct  2 15:34:42 UTC 2013 - fcrozat@suse.com

- Requires which package, otherwise most xdg scripts won't work
  properly.

-------------------------------------------------------------------
Mon May 20 11:57:03 UTC 2013 - jslaby@suse.com

- update to 20121008
  * xdg-mime does not search mimeinfo.cache (BR31629)
- xdg-open-be-more-paranoid-in-escaping.patch: xdg-open: be more
  paranoid in escaping (bnc#811959)

-------------------------------------------------------------------
Mon Sep 17 13:24:00 UTC 2012 - jslaby@suse.com

- update to snapshot from 20120916
  * mate support added
  * switch to local _service
  * fix bad date in the file name

-------------------------------------------------------------------
Mon Aug 20 16:18:37 CEST 2012 - jslaby@suse.de

- update to snapshot from 20120809
  * fix xdg-su for icewm (bnc#776202)
  * remove xfce-su.diff (merged)
  * few fixes (syntax errors in some cases and such)
  * see ChangeLog for updates

-------------------------------------------------------------------
Fri Jun 29 00:27:04 CEST 2012 - jslaby@suse.de

- update to snapshot from 20120310
  * many local patches are gone, since they were merged
  * fixes many issues (see bnc#749612, bnc#703396, bnc#752977)
  * see ChangeLog for updates
- clean the specfile a bit

-------------------------------------------------------------------
Mon May 21 10:16:02 UTC 2012 - vargusz@fazekas.hu

- Fix xdg-screensaver issues with Gnome 3 (bnc#559110)

-------------------------------------------------------------------
Sun Oct 23 23:12:02 UTC 2011 - pascal.bleser@opensuse.org

- add xdg-terminal

-------------------------------------------------------------------
Sat May 21 13:48:19 UTC 2011 - ctrippe@opensuse.org

- Fix xdg-open to probably parse the version for KDE4 (bnc#694543)

-------------------------------------------------------------------
Tue Jul 20 21:21:59 UTC 2010 - reddwarf@opensuse.org

- Fix screensaver handling in KDE4

-------------------------------------------------------------------
Sun Mar 28 17:43:15 UTC 2010 - andrea@opensuse.org

- added xdg-utils-1.0.2-bnc591714.patch to fix bnc#591714

-------------------------------------------------------------------
Thu Jan 14 18:01:21 UTC 2010 - andrea@opensuse.org

- added LXDE support

-------------------------------------------------------------------
Sun Aug 16 13:43:52 CEST 2009 - aj@suse.de

- Add some support for KDE4, taken from upstream CVS.

-------------------------------------------------------------------
Thu Feb  7 13:13:48 CET 2008 - dmueller@suse.de

- fix command injection (#bnc355061, CVE-2008-0386)

-------------------------------------------------------------------
Mon Oct 22 14:25:40 CEST 2007 - stbinner@suse.de

- update to 1.0.2:
   * SVG icons are not supported but doc still mentioned SVG
   * xdg-email can now be used without any e-mail address
   * do not use mktemp without arguments, it breaks on systems with
     certain older versions of mktemp

-------------------------------------------------------------------
Thu Sep 20 18:57:34 CEST 2007 - dmueller@suse.de

- fix xdg-su outside KDE/GNOME (#309164)

-------------------------------------------------------------------
Thu Aug 30 11:35:02 CEST 2007 - dmueller@suse.de

- fix xdg-su for XFCE (#304753)

-------------------------------------------------------------------
Tue May 22 14:25:00 CEST 2007 - dmueller@suse.de

- add xdg-su (#275937)

-------------------------------------------------------------------
Mon Nov  6 09:48:46 CET 2006 - dmueller@suse.de

- update to 1.0.1:
  * Several shell syntax issues causing failures on Ubuntu 6.10
  * Spurious output on stdout when running xdg-desktop-menu
  * Non-ascii mailto URI handling of xdg-email on non-UTF8 locales
    under KDE

-------------------------------------------------------------------
Fri Oct 27 18:04:35 CEST 2006 - dmueller@suse.de

- don't build as root

-------------------------------------------------------------------
Wed Sep 27 11:58:49 CEST 2006 - dmueller@suse.de

- update to 1.0rc1:
  * for changes, see /usr/share/doc/packages/xdg-utils/ChangeLog

-------------------------------------------------------------------
Thu Jun 22 13:27:51 CEST 2006 - dmueller@suse.de

- Initial package (TP1)
Back to top
View user's profile Send private message
C5ace
Apprentice
Apprentice


Joined: 23 Dec 2013
Posts: 282
Location: Brisbane, Australia

PostPosted: Mon Apr 06, 2015 1:51 am    Post subject: Reply with quote

Tried "su" and "sudo" to run etherape from a desktop icon as a normal user. This does not work as desired.

Solved the problem by using "ktsuss -u root sudo etherape"

[Desktop Entry]
Version=1.0
Type=Application
Name=EtherApe
Comment=Graphical Network Monitor
Exec=ktsuss -u root sudo etherape
Icon=etherape
Path=
Terminal=false
StartupNotify=false

Thanks everyone for providing ideas to reach this solution.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Mon Apr 06, 2015 4:21 am    Post subject: Reply with quote

Glad it's solved; wtf is ktsuss? ;)

Just thought I'd mention that fluxbox uses gksuexec (though you can tell it to use anything you want), in case that's useful for someone.
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1699

PostPosted: Mon Apr 06, 2015 4:29 am    Post subject: Reply with quote

I was curious as what ktsuss was, and evidently it's just a wrapper for su with a GUI.

Quote:
ktsuss stands for "keep the su simple, stupid", and as the name says, is a graphical version (frontend) of su written in C and GTK+ 2. The idea of the project is to remain simple and bug free.


https://github.com/nomius/ktsuss
Back to top
View user's profile Send private message
C5ace
Apprentice
Apprentice


Joined: 23 Dec 2013
Posts: 282
Location: Brisbane, Australia

PostPosted: Tue Apr 07, 2015 3:03 am    Post subject: Reply with quote

ct85711 wrote:
I was curious as what ktsuss was, and evidently it's just a wrapper for su with a GUI.

Quote:
ktsuss stands for "keep the su simple, stupid", and as the name says, is a graphical version (frontend) of su written in C and GTK+ 2. The idea of the project is to remain simple and bug free.


https://github.com/nomius/ktsuss


I looked at the source. ktsuss is a frontend for su and sudo. Compared to others, it's so simple that it just works.
Back to top
View user's profile Send private message
ct85711
Veteran
Veteran


Joined: 27 Sep 2005
Posts: 1699

PostPosted: Tue Apr 07, 2015 3:22 am    Post subject: Reply with quote

*scratches his head* I never thought su was that difficult that you needed a frontend for. Sudo I can almost see, as it you have to set that up, before it's really easy (sometime I never done, as it is easier to just type my root password and be done with it than constantly keep typing sudo).
Back to top
View user's profile Send private message
C5ace
Apprentice
Apprentice


Joined: 23 Dec 2013
Posts: 282
Location: Brisbane, Australia

PostPosted: Tue Apr 07, 2015 4:44 am    Post subject: Reply with quote

ct85711 wrote:
*scratches his head* I never thought su was that difficult that you needed a frontend for. Sudo I can almost see, as it you have to set that up, before it's really easy (sometime I never done, as it is easier to just type my root password and be done with it than constantly keep typing sudo).


I personally use "su" or "sudo" most of the time from a terminal window. I.e. open Xfce-Terminal, type sum type root password, type the command line, view error messages. If I don't know the command line, search the man pages and net. With frequently used commands like EtherApe, etc. live is much easier and simple for my users and myself to just click on an icon and enter the root password.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum