[libcxx-commits] [PATCH] D140183: [libc++][Android] Disable test_no_resolve_symlink_on_symlink on Android

Ryan Prichard via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 15 18:21:24 PST 2022


rprichard created this revision.
rprichard added a reviewer: danalbert.
Herald added subscribers: danielkiss, krytarowski.
Herald added a project: All.
rprichard requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

The test is intended to ensure a particular behavior, but different
versions of Android (even just L and up) have multiple possible
behaviors.

Starting with Android M, fchmodat appears to successfully modify the
permissions of a symlink on an ext4 filesystem (but not f2fs). With
Android R, fchmodat then fails with operation_not_supported, but still
modifies the symlink's permissions. This issue is tracked internally at
http://b/262631136.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140183

Files:
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp


Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
===================================================================
--- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
+++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
@@ -138,10 +138,23 @@
     }
 }
 
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__ANDROID__)
 // This test isn't currently meaningful on Windows; the Windows file
 // permissions visible via std::filesystem doesn't show any difference
 // between owner/group/others.
+//
+// Skip the test on Android because the behavior varies widely. A device
+// may do one of these things:
+//  - Ignore nofollow and modify the target (e.g. L emulator).
+//  - Refuse to let the shell user create a symlink (e.g. physical L device,
+//    volantis or Nexus 7 2013).
+//  - Change the symlink's permissions successfully (e.g. emulators from
+//    Android M to Q, ext4 filesystem).
+//  - Change the symlink's permissions, then fail with operation_not_supported
+//    anyway (e.g. R emulator and later, ext4 filesystem, see Google internal
+//    bug http://b/262631136).
+//  - Do nothing and fail with operation_not_supported (e.g. devices using f2fs
+//    for /data/local/tmp).
 TEST_CASE(test_no_resolve_symlink_on_symlink)
 {
     scoped_test_env env;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140183.483405.patch
Type: text/x-patch
Size: 1408 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221216/0ac8a738/attachment.bin>


More information about the libcxx-commits mailing list