Skip to content

Commit e4021af

Browse files
author
Kristan Kenney
authored
Merge pull request hestiacp#1298 from hestiacp/fix/2020-10-unlink_temp_file
Unlink hashed temp file
2 parents 808770f + b94caac commit e4021af

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

web/reset/index.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,15 @@
2020
$data = json_decode(implode('', $output), true);
2121
if($email == $data[$user]['CONTACT']){
2222
//genrate new rkey
23-
$rkey = substr( password_hash( 'hestiacp', PASSWORD_DEFAULT ), 5, 12 );
23+
$rkey = substr( password_hash( rand(0,10), PASSWORD_DEFAULT ), 5, 12 );
2424
$hash = password_hash($rkey, PASSWORD_DEFAULT);
2525
$v_rkey = tempnam("/tmp","vst");
2626
$fp = fopen($v_rkey, "w");
2727
fwrite($fp, $hash."\n");
2828
fclose($fp);
2929
exec ("/usr/bin/sudo /usr/local/hestia/bin/v-change-user-rkey ".$v_user." ".$v_rkey."", $output, $return_var);
3030
unset($output);
31-
exec ($cmd." ".$v_user." json", $output, $return_var);
32-
$data = json_decode(implode('', $output), true);
31+
unlink($v_rkey);
3332
$name = $data[$user]['NAME'];
3433
$contact = $data[$user]['CONTACT'];
3534
$to = $data[$user]['CONTACT'];

0 commit comments

Comments
 (0)