From 9d6ee05660a51a4ffda52a4244f2fa3c11fb4ca3 Mon Sep 17 00:00:00 2001 From: Alexander Shaduri Date: Sat, 30 Apr 2011 18:41:36 +0000 Subject: [PATCH] Add debian/ubuntu's su-to-root support to gsmartcontrol-root. --- gsmartcontrol/TODO | 2 -- gsmartcontrol/data/gsmartcontrol-root.in | 9 +++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gsmartcontrol/TODO b/gsmartcontrol/TODO index 6db8821..9581776 100644 --- a/gsmartcontrol/TODO +++ b/gsmartcontrol/TODO @@ -41,8 +41,6 @@ Add debian/ubuntu's su-to-root support to gsmartcontrol-root. Set tooltips wherever we have "No description available". -Allow quitting when test is running (ask first). - When running smartctl on drives, run them on the driveptr-s directly, (use -i -H -c options, maybe even drive->fetch...()), so that the drive remembers it. diff --git a/gsmartcontrol/data/gsmartcontrol-root.in b/gsmartcontrol/data/gsmartcontrol-root.in index 5aa7d10..9330423 100644 --- a/gsmartcontrol/data/gsmartcontrol-root.in +++ b/gsmartcontrol/data/gsmartcontrol-root.in @@ -45,8 +45,9 @@ fi # They're basically the same, only the order is different. # sux requires xterm to ask for the password. # xdg-su is basically like this script, except worse :) -gnome_sus="gnomesu gksu kdesu beesu xdg-su sux"; -kde_sus="kdesu gnomesu gksu beesu xdg-su sux"; +# su-to-root is a debian/ubuntu official method (although gksu is available). +gnome_sus="su-to-root gnomesu gksu kdesu beesu xdg-su sux"; +kde_sus="su-to-root kdesu gnomesu gksu beesu xdg-su sux"; other_sus="$gnome_sus"; @@ -97,6 +98,7 @@ export PATH="$EXTRA_PATHS:$PATH" # gnomesu -c 'gsmartcontrol --no-scan' # kdesu -c 'gsmartcontrol --no-scan' # beesu -P 'gsmartcontrol --no-scan' +# su-to-root -X -c 'gsmartcontrol --no-scan' # xterm -e sux -c 'gsmartcontrol --no-scan' # sux asks for password in a terminal full_cmd=""; @@ -113,6 +115,9 @@ elif [ "$found_su" = "gksu" ]; then elif [ "$found_su" = "beesu" ]; then full_cmd="$found_su -P '$EXEC_BIN $@'"; +elif [ "$found_su" = "su-to-root" ]; then + full_cmd="$found_su -X -c '$EXEC_BIN $@'"; + else # gnomesu, kdesu, xdg-su full_cmd="$found_su -c '$EXEC_BIN $@'"; fi