Tests: Create files with mode 0666, not 0777 (bug 33171)

Mode 0777 should be used for directories only because it results
in executable entries (after typical umasks are applied).

Reviewed-by: Arjun Shankar <arjun@redhat.com>
This commit is contained in:
Florian Weimer
2025-09-01 15:05:16 +02:00
parent 576976eacc
commit 54bd776f99
6 changed files with 12 additions and 13 deletions

View File

@@ -265,7 +265,7 @@ writer_thread_proc (void *closure)
debug;
if (td->fname)
td->fd = xopen (td->fname, O_WRONLY, 0777);
td->fd = xopen (td->fname, O_WRONLY, 0666);
fd = td->fd;
while (1)
@@ -292,7 +292,7 @@ reader_thread_proc (void *closure)
debug;
if (td->fname)
td->fd = xopen (td->fname, O_RDONLY, 0777);
td->fd = xopen (td->fname, O_RDONLY, 0666);
fd = td->fd;
while (1)
@@ -538,7 +538,7 @@ open_test_stream (enum test_source_case f, enum test_stream_case s)
break;
case test_stream_fdopen_w:
fd = xopen (fname, O_WRONLY|O_CREAT|O_TRUNC, 0777);
fd = xopen (fname, O_WRONLY|O_CREAT|O_TRUNC, 0666);
fp = fdopen (fd, "w");
break;
@@ -1030,4 +1030,3 @@ do_test (void)
# include <support/test-driver.c>
#endif