Attempt to marginally de-obfuscate sections of the System V IPC access

control logic.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
This commit is contained in:
Robert Watson 2003-05-31 23:17:30 +00:00
parent 395aac85f8
commit a0ccd3f6ad

View File

@ -91,6 +91,11 @@ ipcperm(td, perm, mode)
if (mode & IPC_M)
return (0);
return ((mode & perm->mode) == mode ||
suser(td) == 0 ? 0 : EACCES);
if ((mode & perm->mode) != mode) {
if (suser(td) != 0)
return (EACCES);
}
return (0);
}