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

This commit is contained in:
Tobias Brunner
2013-06-25 17:16:33 +02:00
parent 68b7448eab
commit ac2ffde4ae
+2 -2
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,