Skip to content

Commit

Permalink
use geteuid syscall as well
Browse files Browse the repository at this point in the history
  • Loading branch information
trapexit committed Jun 23, 2014
1 parent f385f02 commit 3b6c748
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ugid_linux.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ namespace mergerfs
SetResetGuard(const uid_t _newuid,
const gid_t _newgid)
{
olduid = ::geteuid();
oldgid = ::getegid();
newuid = _newuid;
newgid = _newgid;
olduid = ::syscall(SYS_geteuid);
oldgid = ::syscall(SYS_getegid);
newuid = _newuid;
newgid = _newgid;

if(newgid != oldgid)
::syscall(SYS_setregid,-1,newgid);
Expand Down

0 comments on commit 3b6c748

Please sign in to comment.