diff --git a/tests/sys/aio/aio_kqueue_test.c b/tests/sys/aio/aio_kqueue_test.c index e855653a2737..f3e63376eb1b 100644 --- a/tests/sys/aio/aio_kqueue_test.c +++ b/tests/sys/aio/aio_kqueue_test.c @@ -36,7 +36,6 @@ #include #include -#include #include #include #include @@ -91,7 +90,6 @@ main (int argc, char *argv[]) if (argc == 1) { strcpy(pathname, PATH_TEMPLATE); - umask(0077); fd = mkstemp(pathname); file = pathname; tmp_file = 1; diff --git a/tests/sys/aio/lio_kqueue_test.c b/tests/sys/aio/lio_kqueue_test.c index 1a7fe8b2d0bb..3226573721c6 100644 --- a/tests/sys/aio/lio_kqueue_test.c +++ b/tests/sys/aio/lio_kqueue_test.c @@ -32,7 +32,6 @@ #include #include -#include #include #include #include @@ -87,7 +86,6 @@ main(int argc, char *argv[]) if (argc == 1) { strcpy(pathname, PATH_TEMPLATE); - umask(0077); fd = mkstemp(pathname); file = pathname; tmp_file = 1; diff --git a/tests/sys/file/dup_test.c b/tests/sys/file/dup_test.c index 825f796ef273..817381889625 100644 --- a/tests/sys/file/dup_test.c +++ b/tests/sys/file/dup_test.c @@ -50,7 +50,6 @@ * open files limit work. */ -#include #include #include #include @@ -69,7 +68,6 @@ getafile(void) int fd; char temp[] = "/tmp/dup2XXXXXXXXX"; - umask(0077); if ((fd = mkstemp(temp)) < 0) err(1, "mkstemp"); remove(temp); diff --git a/tests/sys/file/flock_helper.c b/tests/sys/file/flock_helper.c index 4f2ffcea8b23..0fca15e48ef2 100644 --- a/tests/sys/file/flock_helper.c +++ b/tests/sys/file/flock_helper.c @@ -92,7 +92,6 @@ make_file(const char *pathname, off_t sz) filename = malloc(len); strcpy(filename, pathname); strcat(filename, template); - umask(0077); fd = mkstemp(filename); if (fd < 0) err(1, "mkstemp"); diff --git a/tests/sys/kern/kern_copyin.c b/tests/sys/kern/kern_copyin.c index 98d330f6adea..a8cf0422eec5 100644 --- a/tests/sys/kern/kern_copyin.c +++ b/tests/sys/kern/kern_copyin.c @@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -70,7 +69,6 @@ ATF_TC_BODY(kern_copyin, tc) atf_tc_skip("Platform is not supported."); #endif - umask(0077); scratch_file = mkstemp(template); ATF_REQUIRE(scratch_file != -1); unlink(template); diff --git a/tests/sys/kern/pipe/pipe_overcommit2_test.c b/tests/sys/kern/pipe/pipe_overcommit2_test.c index 6ee0707981ab..ee1e714d0d8a 100644 --- a/tests/sys/kern/pipe/pipe_overcommit2_test.c +++ b/tests/sys/kern/pipe/pipe_overcommit2_test.c @@ -27,7 +27,6 @@ */ #include -#include #include #include #include @@ -51,7 +50,6 @@ main(void) lastfd = -1; - umask(0077); if (mkstemp(template) == -1) err(1, "mkstemp failed"); diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c index 7773b1f26734..9589bb62922a 100644 --- a/tests/sys/kern/ptrace_test.c +++ b/tests/sys/kern/ptrace_test.c @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -3348,7 +3347,6 @@ ATF_TC_BODY(ptrace__PT_ATTACH_with_SBDRY_thread, tc) ATF_REQUIRE(pthread_barrier_init(&barrier, &battr, 2) == 0); (void)snprintf(tmpfile, sizeof(tmpfile), "./ptrace.XXXXXX"); - umask(0077); fd = mkstemp(tmpfile); ATF_REQUIRE(fd >= 0); diff --git a/tests/sys/kern/unix_passfd_test.c b/tests/sys/kern/unix_passfd_test.c index 5ca452526a66..7267fe931b43 100644 --- a/tests/sys/kern/unix_passfd_test.c +++ b/tests/sys/kern/unix_passfd_test.c @@ -87,7 +87,6 @@ tempfile(int *fdp) snprintf(path, PATH_MAX, "%s/unix_passfd.XXXXXXXXXXXXXXX", getenv("TMPDIR") == NULL ? "/tmp" : getenv("TMPDIR")); - umask(0077); fd = mkstemp(path); ATF_REQUIRE_MSG(fd != -1, "mkstemp(%s) failed", path); (void)unlink(path); diff --git a/tests/sys/posixshm/posixshm_test.c b/tests/sys/posixshm/posixshm_test.c index 32d5a898a409..05774df2b280 100644 --- a/tests/sys/posixshm/posixshm_test.c +++ b/tests/sys/posixshm/posixshm_test.c @@ -54,7 +54,6 @@ gen_test_path(void) snprintf(test_path, sizeof(test_path), "%s/tmp.XXXXXX", getenv("TMPDIR") == NULL ? "/tmp" : getenv("TMPDIR")); test_path[sizeof(test_path) - 1] = '\0'; - umask(0077); ATF_REQUIRE_MSG(mkstemp(test_path) != -1, "mkstemp failed; errno=%d", errno); ATF_REQUIRE_MSG(unlink(test_path) == 0,