diff options
author | Stef Walter <stefw@gnome.org> | 2013-03-19 17:24:47 +0100 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2013-03-19 19:14:16 +0100 |
commit | b6295dd63a8028ae0b239859406c477d779f4d5e (patch) | |
tree | d4a2d33cb2e390ddc7dfc027dc23899d143e1de7 /tools/tests/test.c | |
parent | 7c27e9fbbe86b3268065f248eab2d6964983a715 (diff) |
extract: Make extracted output directories read-only
This is not a security feature or anything like that, but a hint
that the files are managed by the extract tool and should not be
modified manually.
Diffstat (limited to 'tools/tests/test.c')
-rw-r--r-- | tools/tests/test.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/tests/test.c b/tools/tests/test.c index 56e65cd..9407817 100644 --- a/tools/tests/test.c +++ b/tools/tests/test.c @@ -116,7 +116,7 @@ test_check_data_msg (CuTest *tc, if (filelen != reflen || memcmp (filedata, refdata, reflen) != 0) CuFail_Line (tc, file, line, "File contents not as expected", filename); - unlink (filename); + CuAssert_Line (tc, file, line, "couldn't remove file", unlink (filename) >= 0); free (filename); free (filedata); } @@ -142,7 +142,7 @@ test_check_symlink_msg (CuTest *tc, CuAssertStrEquals_LineMsg (tc, file, line, "symlink contents wrong", destination, buf); - unlink (filename); + CuAssert_Line (tc, file, line, "couldn't remove symlink", unlink (filename) >= 0); free (filename); } @@ -197,6 +197,10 @@ test_check_directory_msg (CuTest *tc, closedir (dir); +#if OS_UNIX + CuAssert_Line (tc, file, line, "couldn't chown directory", chmod (directory, S_IRWXU) >= 0); +#endif + p11_dict_iterate (files, &iter); while (p11_dict_next (&iter, (void **)&name, NULL)) CuFail_Line (tc, file, line, "Couldn't find file in directory", name); |