1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-12 11:12:06 +00:00

Clarify useless pop-up risk on RasPiOS like Mint, due to sudo -n

This commit is contained in:
A Holt 2022-10-18 19:02:19 -04:00 committed by GitHub
parent 98e66a4838
commit 1ca77cdf86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,7 +28,8 @@ check_user_pwd() {
# This also helps avoid parsing the (NEW) 4th sub-field in $y$j9T$SALT$HASH
# 2022-09-21 #3368: Sets field2 to "" if sudo -n fails to read /etc/shadow
# 2022-10-18 #3404: Redirect stderr to /dev/null, to avoid Mint pop-up
# 2022-10-18 #3404: Redirect stderr to /dev/null, as RasPiOS might one day
# force an annoying pop-up, as Mint did (due to sshpwd-profile-iiab.sh.j2)
field2=$(sudo -n grep "^$1:" /etc/shadow 2>/dev/null | cut -d: -f2)
[[ $(perl -e "print crypt('$2', '$field2')") == $field2 ]]