mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-26 14:56:33 +00:00
check_priv: 3 attempts, error if wrong password
This commit is contained in:
parent
957e820c29
commit
18febabbe5
10
src/tomb
10
src/tomb
@ -33,6 +33,9 @@ STEGHIDE=1
|
|||||||
MKTEMP=1
|
MKTEMP=1
|
||||||
MOUNTOPTS="rw,noatime,nodev"
|
MOUNTOPTS="rw,noatime,nodev"
|
||||||
|
|
||||||
|
#declare global variables
|
||||||
|
QUIET=0
|
||||||
|
DEBUG=0
|
||||||
typeset -A global_opts
|
typeset -A global_opts
|
||||||
typeset -A opts
|
typeset -A opts
|
||||||
typeset -h username
|
typeset -h username
|
||||||
@ -292,6 +295,7 @@ check_priv() {
|
|||||||
sudok=false
|
sudok=false
|
||||||
sudo -n ${TOMBEXEC} &> /dev/null
|
sudo -n ${TOMBEXEC} &> /dev/null
|
||||||
if [ $? != 0 ]; then # if not then ask a password
|
if [ $? != 0 ]; then # if not then ask a password
|
||||||
|
for imnotused in 1 2 3; do
|
||||||
cat <<EOF | pinentry 2>/dev/null | awk '/^D / { sub(/^D /, ""); print }' | sudo -S -v
|
cat <<EOF | pinentry 2>/dev/null | awk '/^D / { sub(/^D /, ""); print }' | sudo -S -v
|
||||||
OPTION ttyname=$TTY
|
OPTION ttyname=$TTY
|
||||||
OPTION lc-ctype=$LANG
|
OPTION lc-ctype=$LANG
|
||||||
@ -300,6 +304,12 @@ SETDESC Sudo execution of Tomb ${OLDARGS[@]}
|
|||||||
SETPROMPT Insert your USER password:
|
SETPROMPT Insert your USER password:
|
||||||
GETPIN
|
GETPIN
|
||||||
EOF
|
EOF
|
||||||
|
if [[ $? == 0 ]]; then #success
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
if [[ $i == 3 ]]; then
|
||||||
|
fi
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
sudo "${TOMBEXEC}" "${(@)OLDARGS}" -U ${UID} -G ${GID}
|
sudo "${TOMBEXEC}" "${(@)OLDARGS}" -U ${UID} -G ${GID}
|
||||||
exit $?
|
exit $?
|
||||||
|
Loading…
Reference in New Issue
Block a user