core: Prevent exception throwing when dropping privileges is not supported and not requested
The exception still be thrown, if config file requests privilege dropping. Change-Id: I856207958354410fa45da7ccc73b46b99f74d9e7 Refs: #2515
This commit is contained in:
@@ -131,7 +131,9 @@ PrivilegeHelper::initialize(const std::string& userName, const std::string& grou
|
||||
s_normalUid = passwd.pw_uid;
|
||||
}
|
||||
#else
|
||||
throw Error("Dropping and raising privileges is not supported on this platform");
|
||||
if (!userName.empty() || !groupName.empty()) {
|
||||
throw Error("Dropping and raising privileges is not supported on this platform");
|
||||
}
|
||||
#endif // HAVE_PRIVILEGE_DROP_AND_ELEVATE
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user