llvm.org GIT mirror llvm / f740ffb
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350735 91177308-0d34-0410-b5e6-96231b3b80d8 Hubert Tong 1 year, 9 months ago
1 changed file(s) with 4 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
16641664 EXPECT_TRUE(CheckPermissions(fs::set_gid_on_exe));
16651665
16661666 // Modern BSDs require root to set the sticky bit on files.
1667 #if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
1667 // AIX without root will mask off (i.e., lose) the sticky bit on files.
1668 #if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && \
1669 !defined(_AIX)
16681670 EXPECT_EQ(fs::setPermissions(TempPath, fs::sticky_bit), NoError);
16691671 EXPECT_TRUE(CheckPermissions(fs::sticky_bit));
16701672
16841686
16851687 EXPECT_EQ(fs::setPermissions(TempPath, fs::all_perms), NoError);
16861688 EXPECT_TRUE(CheckPermissions(fs::all_perms));
1687 #endif // !FreeBSD && !NetBSD && !OpenBSD
1689 #endif // !FreeBSD && !NetBSD && !OpenBSD && !AIX
16881690
16891691 EXPECT_EQ(fs::setPermissions(TempPath, fs::all_perms & ~fs::sticky_bit),
16901692 NoError);