diff options
author | Hubert Tong <hubert.reinterpretcast@gmail.com> | 2019-01-09 16:00:39 +0000 |
---|---|---|
committer | Hubert Tong <hubert.reinterpretcast@gmail.com> | 2019-01-09 16:00:39 +0000 |
commit | ea2ce500e9ab0e46cb520ab541bbf50593e8b190 (patch) | |
tree | d62ec983a10da9cc3b8fce2bdcb0175790204cc3 /llvm/unittests/Support/Path.cpp | |
parent | 7e6803e07b98d6189c6f07da0f7a2e0c813e98af (diff) | |
download | bcm5719-llvm-ea2ce500e9ab0e46cb520ab541bbf50593e8b190.tar.gz bcm5719-llvm-ea2ce500e9ab0e46cb520ab541bbf50593e8b190.zip |
[unittests][Support] AIX: Skip sticky bit file tests
On AIX, attempting (without root) to set the sticky bit on a file with
the `chmod` utility will give:
```
chmod: not all requested changes were made to <file>
```
The same occurs when modifying other permission bits on a file with the
sticky bit already set.
It seems that the `chmod` function will report success despite failing
to set the sticky bit.
llvm-svn: 350735
Diffstat (limited to 'llvm/unittests/Support/Path.cpp')
-rw-r--r-- | llvm/unittests/Support/Path.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/unittests/Support/Path.cpp b/llvm/unittests/Support/Path.cpp index 40faa669f87..21a6aab73af 100644 --- a/llvm/unittests/Support/Path.cpp +++ b/llvm/unittests/Support/Path.cpp @@ -1665,7 +1665,9 @@ TEST_F(FileSystemTest, permissions) { EXPECT_TRUE(CheckPermissions(fs::set_gid_on_exe)); // Modern BSDs require root to set the sticky bit on files. -#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) + // AIX without root will mask off (i.e., lose) the sticky bit on files. +#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && \ + !defined(_AIX) EXPECT_EQ(fs::setPermissions(TempPath, fs::sticky_bit), NoError); EXPECT_TRUE(CheckPermissions(fs::sticky_bit)); @@ -1685,7 +1687,7 @@ TEST_F(FileSystemTest, permissions) { EXPECT_EQ(fs::setPermissions(TempPath, fs::all_perms), NoError); EXPECT_TRUE(CheckPermissions(fs::all_perms)); -#endif // !FreeBSD && !NetBSD && !OpenBSD +#endif // !FreeBSD && !NetBSD && !OpenBSD && !AIX EXPECT_EQ(fs::setPermissions(TempPath, fs::all_perms & ~fs::sticky_bit), NoError); |