summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2002-08-28 20:39:48 +0000
committeralfred <alfred@FreeBSD.org>2002-08-28 20:39:48 +0000
commit30d3848aeed001f8ddbdbb924730123fe8b91127 (patch)
tree45105cfdfcfacd8deb57256365968aee456b4682
parent6d2baaab2db0e5dee44565ae0ea8c970ddda52e4 (diff)
downloadFreeBSD-src-30d3848aeed001f8ddbdbb924730123fe8b91127.zip
FreeBSD-src-30d3848aeed001f8ddbdbb924730123fe8b91127.tar.gz
Allow one to grab the definition of struct ucred by defining _WANT_UCRED
instead of forcing _KERNEL. Move the include of sys/_label.h in ucred.h under the _KERNEL || _WANT_UCRED case.
-rw-r--r--lib/libkvm/kvm_proc.c3
-rw-r--r--sys/sys/ucred.h12
2 files changed, 5 insertions, 10 deletions
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c
index bacc3a4..8bf205b 100644
--- a/lib/libkvm/kvm_proc.c
+++ b/lib/libkvm/kvm_proc.c
@@ -52,9 +52,8 @@ static char sccsid[] = "@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93";
*/
#include <sys/param.h>
-#define _KERNEL
+#define _WANT_UCRED /* make ucred.h give us 'struct ucred' */
#include <sys/ucred.h>
-#undef _KERNEL
#include <sys/user.h>
#include <sys/proc.h>
#include <sys/exec.h>
diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h
index 60b5bd6..3f970de 100644
--- a/sys/sys/ucred.h
+++ b/sys/sys/ucred.h
@@ -38,18 +38,14 @@
#define _SYS_UCRED_H_
/*
- * XXXMAC: this recursive include could be #ifdef _KERNEL if struct
- * ucred could also be #ifdef _KERNEL.
- */
-#include <sys/_label.h>
-
-/*
* Credentials.
*
* Please do not inspect cr_uid directly to determine superuserness.
* Only the suser() or suser_cred() function should be used for this.
*/
-#ifdef _KERNEL
+#if defined(_KERNEL) || defined(_WANT_UCRED)
+#include <sys/_label.h>
+
struct ucred {
u_int cr_ref; /* reference count */
#define cr_startcopy cr_uid
@@ -69,7 +65,7 @@ struct ucred {
};
#define NOCRED ((struct ucred *)0) /* no credential available */
#define FSCRED ((struct ucred *)-1) /* filesystem credential */
-#endif /* _KERNEL */
+#endif /* _KERNEL || _WANT_UCRED */
/*
* This is the external representation of struct ucred.
OpenPOWER on IntegriCloud