diff --git a/README b/README index ca4375d2..87e28e03 100644 --- a/README +++ b/README @@ -270,20 +270,18 @@ system. These commands include: {filemanager} - used in attempt data rescue to display discovered file systems. (e.g., nautilus, pcmanfm) hal-lock - used to prevent automounting of file systems - gksudo - used to acquire root privileges in .desktop file, - but only if available when gparted source is - configured. + gksudo - used to acquire root privileges in gparted shell + script wrapper, but only if available when gparted + source is configured gksu - alternatively used to acquire root privileges in - .desktop file if gksu not available, but only if - available when gparted source is configured. + gparted shell script wrapper, second choice if + available when gparted source is configured kdesudo - alternatively used to acquire root privileges in - .desktop file if gksudo and gksu not available, but - only if available when gparted source is - configured. + gparted shell script wrapper, third choice if + available when gparted source is configured xdg-su - alternatively used to acquire root privileges in - .desktop file if gksudo, gksu, and kdesudo are not - available, but only if available when gparted - source is configured. + gparted shell script wrapper, last choice if + available when gparted source is configured udevinfo - used in dmraid to query udev name udevadm - used in dmraid to query udev name yelp - used to display help manual diff --git a/gparted.desktop.in.in b/gparted.desktop.in.in index 4b41fe4c..394eda68 100644 --- a/gparted.desktop.in.in +++ b/gparted.desktop.in.in @@ -3,7 +3,7 @@ _Name=GParted _GenericName=Partition Editor _X-GNOME-FullName=GParted Partition Editor _Comment=Create, reorganize, and delete partitions -Exec=@gksuprog@ @installdir@/gparted %f +Exec=@installdir@/gparted %f Icon=gparted Terminal=false Type=Application diff --git a/gparted.in b/gparted.in index c435baca..68902cb3 100755 --- a/gparted.in +++ b/gparted.in @@ -36,6 +36,30 @@ if test "z`ps -e | grep gpartedbin`" != "z"; then exit 1 fi +# +# Define base command for executing GParted +# +BASE_CMD="@installdir@/gpartedbin $*" + +# +# For non-root users try to get authorisation to run GParted as root. +# +if test "x`id -u`" != "x0"; then + # + # If there is no configured SU program run gpartedbin as + # non-root to display the graphical error about needing root + # privileges. + # + if test "x@gksuprog@" = "x"; then + echo "Root privileges are required for running gparted." + $BASE_CMD + exit 1 + fi + + @gksuprog@ '@installdir@/gparted' "$@" + exit $? +fi + # # Search PATH to determine if systemctl program can be found # and if appropriate daemon is running. @@ -104,24 +128,6 @@ for k in '' `echo "$PATH" | sed 's,:, ,g'`; do fi done -# -# Define base command for executing GParted -# -BASE_CMD="@installdir@/gpartedbin $*" - -# -# If no root privileges, then invoke gpartedbin directly -# so that a graphical warning is displayed. -# Otherwise udisks, devkit-disks, or hal-lock in the later -# invocation may prevent gpartedbin from starting and hence -# the user will not see a graphical warning. -# -if test "x`id -u`" != "x0"; then - echo "Root privileges are required for running gparted." - $BASE_CMD - exit 1 -fi - # # Use systemctl to prevent automount by masking currently unmasked mount points #