[libcxx] r275760 - [libcxx][filesystem] Remove setgid from parent before testing permissions

Jonas Hahnfeld via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 17 23:06:50 PDT 2016


Author: hahnfeld
Date: Mon Jul 18 01:06:50 2016
New Revision: 275760

URL: http://llvm.org/viewvc/llvm-project?rev=275760&view=rev
Log:
[libcxx][filesystem] Remove setgid from parent before testing permissions

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

Differential Revision: https://reviews.llvm.org/D22265

Modified:
    libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp

Modified: libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp?rev=275760&r1=275759&r2=275760&view=diff
==============================================================================
--- libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp (original)
+++ libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp Mon Jul 18 01:06:50 2016
@@ -60,6 +60,9 @@ TEST_CASE(create_existing_directory)
 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);




More information about the cfe-commits mailing list