From b6295dd63a8028ae0b239859406c477d779f4d5e Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 19 Mar 2013 17:24:47 +0100 Subject: 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. --- tools/tests/test.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tools/tests/test.c') 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); -- cgit v1.1