Fix ftw tests when run as non-root.

Root can create subdirectories inside non-writable directories, but
other users can't.

Change-Id: I102fe610d1bd2733aebf184b544e58612465287d
This commit is contained in:
Elliott Hughes 2015-04-01 12:22:40 -07:00
parent d227d57d50
commit 0ad256c1b2
1 changed files with 3 additions and 3 deletions

View File

@ -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));