From 9ffb3ff2d52dd4b8c446367289b124402e5ca630 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 30 Nov 2019 19:49:54 +0100 Subject: [PATCH] Running sudo early in order to get the possible password prompt --- xorriso-dd-target/xorriso-dd-target | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/xorriso-dd-target/xorriso-dd-target b/xorriso-dd-target/xorriso-dd-target index 88bdb21c..0dbd97ef 100755 --- a/xorriso-dd-target/xorriso-dd-target +++ b/xorriso-dd-target/xorriso-dd-target @@ -230,8 +230,17 @@ arg_interpreter() { have_su_power=y elif test -n "$with_sudo" then - sudo_cmd=sudo - have_su_power=y + echo "Testing sudo to possibly get password prompting done now:" + if sudo $lsblk_cmd -h >/dev/null + then + echo "sudo $lsblk_cmd seems ok." + echo + sudo_cmd=sudo + have_su_power=y + else + echo "FAILURE: Cannot execute program $lsblk_cmd by sudo" >&2 + exit 11 + fi fi } @@ -603,6 +612,7 @@ then if test -n "$dummy_force" -a -n "$dummy_run" -a "$num_cand" -ne 1 then # -dummy_force in a situation where the program would normally refuse + echo echo "Overriding any advice because of -dummy_force" candidates="$devs" num_cand=1