[Portland] xdg-tools: xdg-su

Petr Vanek petr at scribus.info
Fri Feb 25 13:00:28 PST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi all,

is there any reason why is this script disabled in current git,
please? I know it's used in my system (xdg-tools 1.0.2 rpm).

I have potential patch for more su-like GUI - see below.

thanks,
petr

diff --git a/scripts/xdg-su.in b/scripts/xdg-su.in
index 5985e8a..60416ad 100644
- --- a/scripts/xdg-su.in
+++ b/scripts/xdg-su.in
@@ -80,6 +80,21 @@ su_gnome()

 su_generic()
 {
+    if [ -n "$DISPLAY" ]; then
+
+        if [ -z "$user" ] ; then
+            $XSU -c "$cmd"
+        else
+            $XSU -c "$cmd" -u "$user"
+        fi
+
+        if [ $? -eq 0 ]; then
+            exit_success
+        else
+            exit_failure_operation_failed
+        fi
+    fi
+
     if [ -z "$user" ] ; then
         xterm -geom 60x5 -T "xdg-su: $cmd" -e su -c "$cmd"
     else
@@ -135,9 +150,14 @@ fi
 detectDE

 if [ x"$DE" = x"" ]; then
- -    XSU=`which xsu 2>/dev/null`
+    XSU=`which razor-su 2>/dev/null`
     if [ $? -eq 0 ] ; then
         DE=generic
+    else
+        XSU=`which xsu 2>/dev/null`
+        if [ $? -eq 0 ] ; then
+            DE=generic
+        fi
     fi
 fi

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNaBhsAAoJEC8yRjM4uE2tlXIH/221Ak66U9jb85t3hzJGq0sF
RuUiWWvUypfxh5zNUH8DLVohOVRqbDnRWoH9nPoswN3RwI3ETwGyPYIDbekjxggL
4z2mx+hiVzvIi9kqaWU8GEdc6gu5/aAyvZRPSo4mWkvxp7vk65KuIZgOzu2Thh3L
RHNK5qFXbUbE9uEiWLwvEqIxEZdBpvvD1g37Gm4ldHpT+tLMakFvP6yShi3cWrls
hvEtBFFHqpsG3jMHCPSg9q/THNafJsxhc0lwnnlaYSw+dZdRQGmxaaxuycywvmU4
rxf8+BCm+Oa75/rOY4eKM6FgJ4KKIivW0JCzAvY5C4bUxyoSlVA6BrL3nWTU414=
=4KZv
-----END PGP SIGNATURE-----



More information about the Portland mailing list