[glib: 4/6] tests: fix read-only-file test




commit 354c454c5600a53677a460080b8ba6cfb9a71a63
Author: Marc-André Lureau <marcandre lureau redhat com>
Date:   Fri Jan 21 15:37:17 2022 +0400

    tests: fix read-only-file test
    
    The test is meant to check read-only files don't get overwritten, which
    is 0400 in octal.
    
    Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>

 glib/tests/fileutils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/tests/fileutils.c b/glib/tests/fileutils.c
index b61125a91..152b7dfe5 100644
--- a/glib/tests/fileutils.c
+++ b/glib/tests/fileutils.c
@@ -1412,7 +1412,7 @@ test_set_contents_full_read_only_file (void)
   write (fd, "a", 1);
   g_assert_no_errno (g_fsync (fd));
   close (fd);
-  g_assert_no_errno (g_chmod (file_name, 0200));
+  g_assert_no_errno (g_chmod (file_name, 0400)); /* S_IREAD */
 
   if (g_test_undefined ())
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]