This is an archive of the discontinued LLVM Phabricator instance.

[unittests][Support] Fix LLVM-Unit :: Support/./SupportTests/FileSystemTest.permissions on Solaris
ClosedPublic

Authored by ro on Jun 20 2019, 6:23 AM.

Details

Summary

LLVM-Unit :: Support/./SupportTests/FileSystemTest.permissions on Solaris currently
FAILs on Solaris:

FAIL: LLVM-Unit :: Support/./SupportTests/FileSystemTest.permissions (2940 of 51555)
******************** TEST 'LLVM-Unit :: Support/./SupportTests/FileSystemTest.permissions' FAILED ********************
Note: Google Test filter = FileSystemTest.permissions
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from FileSystemTest
[ RUN      ] FileSystemTest.permissions
/opt/llvm-buildbot/obj/llvm/llvm.src/unittests/Support/Path.cpp:1705: Failure
Value of: CheckPermissions(fs::sticky_bit)
  Actual: false
Expected: true
/opt/llvm-buildbot/obj/llvm/llvm.src/unittests/Support/Path.cpp:1712: Failure
Value of: CheckPermissions(fs::set_uid_on_exe | fs::set_gid_on_exe | fs::sticky_bit)
  Actual: false
Expected: true
/opt/llvm-buildbot/obj/llvm/llvm.src/unittests/Support/Path.cpp:1719: Failure
Value of: CheckPermissions(fs::all_read | fs::set_uid_on_exe | fs::set_gid_on_exe | fs::sticky_bit)
  Actual: false
Expected: true
/opt/llvm-buildbot/obj/llvm/llvm.src/unittests/Support/Path.cpp:1722: Failure
Value of: CheckPermissions(fs::all_perms)
  Actual: false
Expected: true
[  FAILED  ] FileSystemTest.permissions (0 ms)
[----------] 1 test from FileSystemTest (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (1 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] FileSystemTest.permissions

 1 FAILED TEST

Checking with truss reveals that this is the same issue as on AIX and documented in
chmod(2):

If the process is not a privileged process and the file is not a direc-
tory, mode bit 01000 (S_ISVTX, the sticky bit) is cleared.

The following patch fixes this in the same way. Tested on amd64-pc-solaris2.11.
Ok for trunk?

Diff Detail

Event Timeline

ro created this revision.Jun 20 2019, 6:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 20 2019, 6:23 AM
jsji removed a subscriber: jsji.Jun 20 2019, 6:49 AM
ro added a comment.Jun 27 2019, 11:04 PM

Ping? It's been a week and he patch is pretty obvious.

RKSimon accepted this revision.Jun 28 2019, 11:10 AM
RKSimon added a subscriber: RKSimon.

LGTM - makes sense to me.

This revision is now accepted and ready to land.Jun 28 2019, 11:10 AM
This revision was automatically updated to reflect the committed changes.