Check capabilities instead of the root
This commit is contained in:
parent
4b97da93e0
commit
7b212a6a25
|
|
@ -254,9 +254,7 @@ impl AuxiliaryData {
|
|||
warn!("UNIX sockets in SCM_RIGHTS messages can leak kernel resource");
|
||||
|
||||
let credentials = current_thread!().as_posix_thread().unwrap().credentials();
|
||||
if !credentials.euid().is_root()
|
||||
&& !credentials.effective_capset().contains(CapSet::SYS_ADMIN)
|
||||
{
|
||||
if !credentials.effective_capset().contains(CapSet::SYS_ADMIN) {
|
||||
return_errno_with_message!(
|
||||
Errno::EPERM,
|
||||
"UNIX sockets in SCM_RIGHTS messages can leak kernel resource"
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ fn check_current_privileged() -> Result<()> {
|
|||
posix_thread.credentials()
|
||||
};
|
||||
|
||||
if credentials.euid().is_root() || credentials.effective_capset().contains(CapSet::NET_ADMIN) {
|
||||
if credentials.effective_capset().contains(CapSet::NET_ADMIN) {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue