1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-24 07:40:52 +00:00

Hide 'struct ucred' behind '#ifdef _KERNEL', this should stop userland

from attempting to use it for good.  There is a catch, kvm_proc.c needs
to '#define _KERNEL' to get at the ucred.

Requested by: rwatson
This commit is contained in:
Alfred Perlstein 2002-08-16 07:01:43 +00:00
parent b5cdbc6dae
commit aa22cbfea7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101968
2 changed files with 5 additions and 0 deletions

View File

@ -52,6 +52,9 @@ static char sccsid[] = "@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93";
*/
#include <sys/param.h>
#define _KERNEL
#include <sys/ucred.h>
#undef _KERNEL
#include <sys/user.h>
#include <sys/proc.h>
#include <sys/exec.h>

View File

@ -49,6 +49,7 @@
* Please do not inspect cr_uid directly to determine superuserness.
* Only the suser() or suser_cred() function should be used for this.
*/
#ifdef _KERNEL
struct ucred {
u_int cr_ref; /* reference count */
#define cr_startcopy cr_uid
@ -68,6 +69,7 @@ struct ucred {
};
#define NOCRED ((struct ucred *)0) /* no credential available */
#define FSCRED ((struct ucred *)-1) /* filesystem credential */
#endif /* _KERNEL */
/*
* This is the external representation of struct ucred.