tests: Apply umask before calling mkstemp()

CID: #978660

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2015-05-05 10:42:36 +02:00
parent 96882cc58c
commit e4e3b3052f
2 changed files with 8 additions and 1 deletions

View File

@@ -45,12 +45,14 @@ static void torture_sftp_read_blocking(void **state) {
ssize_t byteswritten;
int fd;
sftp_file file;
mode_t mask;
file = sftp_open(t->sftp, "/usr/bin/ssh", O_RDONLY, 0);
assert_non_null(file);
mask = umask(S_IRWXO | S_IRWXG);
fd = mkstemp(libssh_tmp_file);
umask(mask);
unlink(libssh_tmp_file);
for (;;) {