mirror of
https://github.com/Yubico/yubico-pam.git
synced 2025-02-27 06:54:15 +01:00
Use mkdtemp() instead of tempnam()
The latter function is considered insecure and deprecated on some platforms.
This commit is contained in:
parent
0f6ceabab0
commit
78c358edd0
@ -180,12 +180,10 @@ static void test_check_user_challenge_file(void) {
|
|||||||
unlink(buf);
|
unlink(buf);
|
||||||
|
|
||||||
/* create temporary directory */
|
/* create temporary directory */
|
||||||
tmpdir_path = tempnam(NULL, "pamtest");
|
char template[] = "/tmp/pamtest.XXXXXX";
|
||||||
|
tmpdir_path = mkdtemp(template);
|
||||||
assert(tmpdir_path != NULL);
|
assert(tmpdir_path != NULL);
|
||||||
|
|
||||||
ret = mkdir(tmpdir_path, 0755);
|
|
||||||
assert(ret == 0);
|
|
||||||
|
|
||||||
/* set user data */
|
/* set user data */
|
||||||
user.pw_name = "tester";
|
user.pw_name = "tester";
|
||||||
user.pw_dir = tmpdir_path;
|
user.pw_dir = tmpdir_path;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user