|
@@ -130,13 +130,13 @@ function authenticate_user($user, $password, $twofa = '')
|
|
|
$hash = str_replace('$rounds=5000', '', $hash);
|
|
$hash = str_replace('$rounds=5000', '', $hash);
|
|
|
}
|
|
}
|
|
|
if ($method == 'yescrypt') {
|
|
if ($method == 'yescrypt') {
|
|
|
- $v_password = tempnam("/tmp", "vst");
|
|
|
|
|
- $fp = fopen($v_password, "w");
|
|
|
|
|
|
|
+ $fp = tmpfile();
|
|
|
|
|
+ $v_password = stream_get_meta_data($fp)['uri'];
|
|
|
fwrite($fp, $password."\n");
|
|
fwrite($fp, $password."\n");
|
|
|
- fclose($fp);
|
|
|
|
|
- exec(HESTIA_CMD . 'v-check-user-password '. $v_user.' '. $v_password. ' '.$v_ip.' yes', $output, $return_var);
|
|
|
|
|
|
|
+ exec(HESTIA_CMD . 'v-check-user-password '. $v_user.' '. quoteshellarg($v_password). ' '.$v_ip.' yes', $output, $return_var);
|
|
|
$hash = $output[0];
|
|
$hash = $output[0];
|
|
|
- unset($output);
|
|
|
|
|
|
|
+ fclose($fp);
|
|
|
|
|
+ unset($output,$fp, $v_password);
|
|
|
}
|
|
}
|
|
|
if ($method == 'des') {
|
|
if ($method == 'des') {
|
|
|
$hash = crypt($password, $salt);
|
|
$hash = crypt($password, $salt);
|