From 0ad256c1b234cddc97290be761f8a0163a5c6c00 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 1 Apr 2015 12:22:40 -0700 Subject: [PATCH] Fix ftw tests when run as non-root. Root can create subdirectories inside non-writable directories, but other users can't. Change-Id: I102fe610d1bd2733aebf184b544e58612465287d --- tests/ftw_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/ftw_test.cpp b/tests/ftw_test.cpp index 6741d003e..b7e5bd514 100644 --- a/tests/ftw_test.cpp +++ b/tests/ftw_test.cpp @@ -30,11 +30,11 @@ static void MakeTree(const char* root) { char path[PATH_MAX]; snprintf(path, sizeof(path), "%s/dir", root); - ASSERT_EQ(0, mkdir(path, 0555)); + ASSERT_EQ(0, mkdir(path, 0755)) << path; snprintf(path, sizeof(path), "%s/dir/sub", root); - ASSERT_EQ(0, mkdir(path, 0555)); + ASSERT_EQ(0, mkdir(path, 0555)) << path; snprintf(path, sizeof(path), "%s/unreadable-dir", root); - ASSERT_EQ(0, mkdir(path, 0000)); + ASSERT_EQ(0, mkdir(path, 0000)) << path; snprintf(path, sizeof(path), "%s/dangler", root); ASSERT_EQ(0, symlink("/does-not-exist", path));