mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
- Switch order of setting real uid and gid. If we set uid first, then we
don't have enough privileges to set gid. This looks like a long standing bug, just recently revealed by r241852. Approved by: cognet
This commit is contained in:
parent
8f99bb74a3
commit
b9e6237dab
1 changed files with 1 additions and 1 deletions
|
|
@ -99,8 +99,8 @@ gid_t real_gid, effective_gid;
|
|||
PRIV_START \
|
||||
effective_uid = (a); \
|
||||
effective_gid = (b); \
|
||||
if (setreuid((uid_t)-1, effective_uid) != 0) err(1, "setreuid failed"); \
|
||||
if (setregid((gid_t)-1, effective_gid) != 0) err(1, "setregid failed"); \
|
||||
if (setreuid((uid_t)-1, effective_uid) != 0) err(1, "setreuid failed"); \
|
||||
PRIV_END \
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue