capabilities: Return effective UID/GID if user did not configure anything
This commit is contained in:
parent
68b7448eab
commit
ac2ffde4ae
|
@ -208,13 +208,13 @@ METHOD(capabilities_t, keep, bool,
|
|||
METHOD(capabilities_t, get_uid, uid_t,
|
||||
private_capabilities_t *this)
|
||||
{
|
||||
return this->uid;
|
||||
return this->uid ?: geteuid();
|
||||
}
|
||||
|
||||
METHOD(capabilities_t, get_gid, gid_t,
|
||||
private_capabilities_t *this)
|
||||
{
|
||||
return this->gid;
|
||||
return this->gid ?: getegid();
|
||||
}
|
||||
|
||||
METHOD(capabilities_t, set_uid, void,
|
||||
|
|
Loading…
Reference in New Issue