PERFORCE change 79597 for review
Robert Watson
rwatson at FreeBSD.org
Tue Jul 5 11:50:57 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=79597
Change 79597 by rwatson at rwatson_paprika on 2005/07/05 11:50:57
Substitute CAP_SYS_ADMIN checks for suser in hwpmc, for the
purposes of administering hwpmc availability and model.
Affected files ...
.. //depot/projects/trustedbsd/sebsd/sys/dev/hwpmc/hwpmc_mod.c#2 edit
Differences ...
==== //depot/projects/trustedbsd/sebsd/sys/dev/hwpmc/hwpmc_mod.c#2 (text+ko) ====
@@ -29,6 +29,7 @@
__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_mod.c,v 1.7 2005/05/01 14:11:48 jkoshy Exp $");
#include <sys/param.h>
+#include <sys/capability.h>
#include <sys/eventhandler.h>
#include <sys/jail.h>
#include <sys/kernel.h>
@@ -2598,7 +2599,7 @@
KASSERT(td == curthread,
("[pmc,%d] td != curthread", __LINE__));
- if (suser(td) || jailed(td->td_ucred)) {
+ if (cap_check(td, CAP_SYS_ADMIN) || jailed(td->td_ucred)) {
error = EPERM;
break;
}
@@ -2736,7 +2737,7 @@
if (PMC_IS_SYSTEM_MODE(mode)) {
if (jailed(curthread->td_ucred))
error = EPERM;
- else if (suser(curthread) &&
+ else if (cap_check(curthread, CAP_SYS_ADMIN) &&
(pmc_unprivileged_syspmcs == 0))
error = EPERM;
}
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list