Declare the intention to use sudo
and other commands required to use it. The declared
programs are: sudo
, whoami
.
This function does not use mbfl_declare_program()
.
Register PERSONA as the user under which to execute the next program through sudo
;
the user will be selected using the -u
option of sudo
. This function will:
mbfl_string_is_username()
, else the
function will print an error message to stderr
and exit with
exit_because_invalid_sudo_username()
.
sudo
references an existent and
executable file; otherwise call exit_because_program_not_found()
. Preselected program pathnames.
whoami
references an existent and
executable file; otherwise call exit_because_program_not_found()
. Preselected program pathnames.
whoami
to determine the current effective user name. If an error occurs call
exit_because_failure()
.
sudo
execution and call return_success()
; otherwise set the
internal state so that the next program execution will not use sudo
, then call
return_because_failure()
.
Reset the previously requested sudo
user to a value that will cause sudo
not to
be used in the next program invocation. This is useful to abort a user request.
Print the current sudo
user. This function is for debugging purposes.
Return true if the usage of sudo
has been requested for the next command execution.
Select additional command line options to use on the next invocation of sudo
. These
values are consumed by the first use of mbfl_program_exec()
.
Clean the options previously set by mbfl_program_declare_sudo_options()
.
This document describes version 3.0.0-devel.9 of Marcos Bash Functions Library.