From 2623110256c183f88b616451a8258fcb6e8b06ad Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Mon, 26 Sep 2016 12:50:29 -0700 Subject: Add chmod() after make_{dir,file} in test suites This is the same change that 38b3f516df865e2dffd0a1bbc9feb923ab2efc38 made to libarchive/test/main.c , but now applied to: cat/test/main.c cpio/test/main.c tar/test/main.c Sponsored by: Tarsnap Backup Inc. --- cat/test/main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'cat') diff --git a/cat/test/main.c b/cat/test/main.c index 24071baf..29f7b14b 100644 --- a/cat/test/main.c +++ b/cat/test/main.c @@ -1604,8 +1604,10 @@ assertion_make_dir(const char *file, int line, const char *dirname, int mode) return (1); #else if (0 == mkdir(dirname, mode)) { - assertion_file_mode(file, line, dirname, mode); - return (1); + if (0 == chmod(dirname, mode)) { + assertion_file_mode(file, line, dirname, mode); + return (1); + } } #endif failure_start(file, line, "Could not create directory %s", dirname); @@ -1655,6 +1657,11 @@ assertion_make_file(const char *file, int line, failure_finish(NULL); return (0); } + if (0 != chmod(path, mode)) { + failure_start(file, line, "Could not chmod %s", path); + failure_finish(NULL); + return (0); + } if (contents != NULL) { ssize_t wsize; -- cgit v1.2.1