Merge pull request #190 from YunoHost/fix-randomfile

[fix] Not enough random file name
This commit is contained in:
Alexandre Aubin 2021-08-08 19:59:19 +02:00 committed by GitHub
commit 4eb92f9685
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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