[rtems-libbsd commit] Add parts of the UCRED(9) implementation
Sebastian Huber
sebh at rtems.org
Wed Apr 18 11:58:53 UTC 2012
Module: rtems-libbsd
Branch: master
Commit: e3501b5996372f85ac8ee2be1d0097a77f521dea
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=e3501b5996372f85ac8ee2be1d0097a77f521dea
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed Apr 18 14:00:54 2012 +0200
Add parts of the UCRED(9) implementation
---
freebsd/kern/kern_mib.c | 2 ++
freebsd/kern/kern_prot.c | 10 ++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/freebsd/kern/kern_mib.c b/freebsd/kern/kern_mib.c
index 03d4e9f..0acf89e 100644
--- a/freebsd/kern/kern_mib.c
+++ b/freebsd/kern/kern_mib.c
@@ -95,8 +95,10 @@ SYSCTL_NODE(, CTL_P1003_1B, p1003_1b, CTLFLAG_RW, 0,
SYSCTL_NODE(, OID_AUTO, compat, CTLFLAG_RW, 0,
"Compatibility code");
+#endif /* __rtems__ */
SYSCTL_NODE(, OID_AUTO, security, CTLFLAG_RW, 0,
"Security");
+#ifndef __rtems__
#ifdef REGRESSION
SYSCTL_NODE(, OID_AUTO, regression, CTLFLAG_RW, 0,
"Regression test MIB");
diff --git a/freebsd/kern/kern_prot.c b/freebsd/kern/kern_prot.c
index ff892b6..90eca69 100644
--- a/freebsd/kern/kern_prot.c
+++ b/freebsd/kern/kern_prot.c
@@ -83,12 +83,12 @@ __FBSDID("$FreeBSD$");
#include <freebsd/security/audit/audit.h>
#include <freebsd/security/mac/mac_framework.h>
-#ifndef __rtems__
static MALLOC_DEFINE(M_CRED, "cred", "credentials");
SYSCTL_NODE(_security, OID_AUTO, bsd, CTLFLAG_RW, 0, "BSD security policy");
static void crextend(struct ucred *cr, int n);
+#ifndef __rtems__
static void crsetgroups_locked(struct ucred *cr, int ngrp,
gid_t *groups);
@@ -1710,6 +1710,7 @@ p_candebug(struct thread *td, struct proc *p)
return (0);
}
+#endif /* __rtems__ */
/*-
* Determine whether the subject represented by cred can "see" a socket.
@@ -1735,7 +1736,6 @@ cr_canseesocket(struct ucred *cred, struct socket *so)
return (0);
}
-#endif /* __rtems__ */
#if defined(INET) || defined(INET6)
/*-
@@ -1796,6 +1796,7 @@ p_canwait(struct thread *td, struct proc *p)
return (0);
}
+#endif /* __rtems__ */
/*
* Allocate a zeroed cred structure.
@@ -1863,6 +1864,7 @@ crfree(struct ucred *cr)
}
}
+#ifndef __rtems__
/*
* Check to see if this ucred is shared.
*/
@@ -1908,6 +1910,7 @@ crdup(struct ucred *cr)
crcopy(newcr, cr);
return (newcr);
}
+#endif /* __rtems__ */
/*
* Fill in a struct xucred based on a struct ucred.
@@ -1927,6 +1930,7 @@ cru2x(struct ucred *cr, struct xucred *xcr)
ngroups * sizeof(*cr->cr_groups));
}
+#ifndef __rtems__
/*
* small routine to swap a thread's current ucred for the correct one taken
* from the process.
@@ -1966,6 +1970,7 @@ crcopysafe(struct proc *p, struct ucred *cr)
return (oldcred);
}
+#endif /* __rtems__ */
/*
* Extend the passed in credential to hold n items.
@@ -2007,6 +2012,7 @@ crextend(struct ucred *cr, int n)
cr->cr_agroups = cnt;
}
+#ifndef __rtems__
/*
* Copy groups in to a credential, preserving any necessary invariants.
* Currently this includes the sorting of all supplemental gids.
More information about the vc
mailing list