[PATCH] D22265: [libcxx][filesystem] Remove setgid from parent before testing permissions

Jonas Hahnfeld via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 12 05:58:15 PDT 2016


Hahnfeld created this revision.
Hahnfeld added a reviewer: EricWF.
Hahnfeld added a subscriber: cfe-commits.

man page for mkdir says: `If the parent directory has the set-group-ID bit set, then so will the newly created directory.`

http://reviews.llvm.org/D22265

Files:
  test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp

Index: test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp
===================================================================
--- test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp
+++ test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp
@@ -60,6 +60,9 @@
 TEST_CASE(create_directory_one_level)
 {
     scoped_test_env env;
+    // Remove setgid which mkdir would inherit
+    permissions(env.test_root, perms::remove_perms | perms::set_gid);
+
     const path dir = env.make_env_path("dir1");
     const path attr_dir = env.create_dir("dir2");
     permissions(attr_dir, perms::none);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22265.63672.patch
Type: text/x-patch
Size: 761 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160712/1287391b/attachment.bin>


More information about the cfe-commits mailing list