capabilities: Return effective UID/GID if user did not configure anything

This commit is contained in:
Tobias Brunner 2013-06-25 15:03:51 +02:00
parent 68b7448eab
commit ac2ffde4ae
1 changed files with 2 additions and 2 deletions

View File

@ -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,