Running sudo early in order to get the possible password prompt

master
Thomas Schmitt 3 years ago
parent 099d24f740
commit 9ffb3ff2d5
  1. 14
      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

Loading…
Cancel
Save