1
0
mirror of https://github.com/Yubico/yubico-pam.git synced 2025-02-20 21:54:16 +01:00

set file permissions when creating a new challenge file

This commit is contained in:
Klas Lindfors 2016-03-31 10:11:44 +02:00
parent 155b485ba7
commit 7639f4684a

View File

@ -240,6 +240,11 @@ do_add_hmac_chalresp(YK_KEY *yk, uint8_t slot, bool verbose, char *output_dir, u
if (! write_chalresp_state (f, &state))
goto out;
if (! chmod (fn, S_IRUSR | S_IWUSR)) {
fprintf (stderr, "Failed setting permissions on new challenge file %s.\n", fn);
goto out;
}
printf ("Stored initial challenge and expected response in '%s'.\n", fn);
*exit_code = 0;