File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,9 @@ if [ "$method" = "yescrypt" ]; then
9595
9696 if [ $? -ne 0 ]; then
9797 echo " Error: password missmatch"
98- echo " $date $time $user $ip46 failed to login" >> $HESTIA /log/auth.log
98+ if [ -z " $return_hash " ]; then
99+ echo " $date $time $user $ip46 failed to login" >> $HESTIA /log/auth.log
100+ fi
99101 exit 9
100102 fi
101103else
104106 hash=$( $BIN /v-generate-password-hash " $method " " $salt " <<< " $password" )
105107 if [[ -z " $hash " ]]; then
106108 echo " Error: password missmatch"
107- echo " $date $time $user $ip46 failed to login" >> $HESTIA /log/auth.log
109+ if [ -z " $return_hash " ]; then
110+ echo " $date $time $user $ip46 failed to login" >> $HESTIA /log/auth.log
111+ fi
108112 exit 9
109113 fi
110114fi
113117result=$( grep " ^$user :$hash :" /etc/shadow 2> /dev/null)
114118if [[ -z " $result " ]]; then
115119 echo " Error: password missmatch"
116- echo " $date $time $user $ip46 failed to login" >> $HESTIA /log/auth.log
120+ if [ -z " $return_hash " ]; then
121+ echo " $date $time $user $ip46 failed to login" >> $HESTIA /log/auth.log
122+ fi
117123 exit 9
118124fi
119125
123129
124130if [ -n " $return_hash " ]; then
125131 echo $hash
132+ else
133+ # If return_hash is pressent it will log a second time
134+ echo " $date $time $user $ip46 successfully logged in" >> $HESTIA /log/auth.log
126135fi
127- # Logging
128- echo " $date $time $user $ip46 successfully logged in" >> $HESTIA /log/auth.log
129136
130137exit
You can’t perform that action at this time.
0 commit comments