1 #include "../../../tests/catch2/catch.hpp"
4 #include "../thSetuid.hpp"
28 SCENARIO(
"Setting per-thread setuid privileges",
"[libMagAOX::sys]" )
34 getresuid(&euidReal, &euidCalled, &suid);
36 if(euidReal == suid) {
37 std::cerr <<
"Can't test setuid as root, moving on\n";
38 SUCCEED(
"Can't test setuid as root, moving on");
40 GIVEN(
"A process with setuid bit set")
46 bool is_setuid = ((euidReal != euidCalled) && (euidReal != suid));
51 getresuid(&er, &ec, &suid);
62 getresuid(&er, &ec, &suid);
int th_seteuid(uid_t euid)
Sets the effective user id of the calling thread, rather than the whole process.
SCENARIO("Setting per-thread setuid privileges", "[libMagAOX::sys]")