[fix] Not enough random file name

This commit is contained in:
ljf 2021-07-29 16:34:56 +02:00
parent ecaecddac5
commit c34d9fd74d

View file

@ -713,8 +713,7 @@ end
-- Read result of a command after given it securely the password
function secure_cmd_password(cmd, password, start)
-- Check password validity
math.randomseed( os.time() )
local tmp_file = "/tmp/ssowat_"..math.random()
local tmp_file = os.tmpname()
local w_pwd = io.popen("("..cmd..") | tee -a "..tmp_file, 'w')
w_pwd:write(password)
-- This second write is just to validate the password question