[rtems-libbsd commit] Added more initialization of FIXME_ucred elements.

Jennifer Averett jennifer at rtems.org
Wed Jul 18 16:39:27 UTC 2012


Module:    rtems-libbsd
Branch:    master
Commit:    8fa929e60d5b17f41805c4efe1ad1a23b86ba70b
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=8fa929e60d5b17f41805c4efe1ad1a23b86ba70b

Author:    Jennifer Averett <jennifer.averett at oarcorp.com>
Date:      Wed Jul 18 11:43:05 2012 -0500

Added more initialization of FIXME_ucred elements.

---

 rtemsbsd/src/rtems-bsd-thread.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/rtemsbsd/src/rtems-bsd-thread.c b/rtemsbsd/src/rtems-bsd-thread.c
index 230fa8f..fc41411 100644
--- a/rtemsbsd/src/rtems-bsd-thread.c
+++ b/rtemsbsd/src/rtems-bsd-thread.c
@@ -48,6 +48,7 @@
 #include <freebsd/sys/lock.h>
 #include <freebsd/sys/mutex.h>
 #include <freebsd/sys/jail.h>
+#include <freebsd/sys/resourcevar.h>
 
 RTEMS_CHAIN_DEFINE_EMPTY(rtems_bsd_thread_chain);
 
@@ -63,6 +64,9 @@ static struct prison FIXME_prison = {
   .pr_parent = NULL
 };
 
+static struct uidinfo	FIXME_uidinfo;	/* per euid resource consumption */
+static struct uidinfo	FIXME_ruidinfo;	/* per ruid resource consumption */
+
 static struct thread *
 rtems_bsd_thread_init_note( rtems_id id )
 {
@@ -99,10 +103,14 @@ rtems_bsd_thread_init_note( rtems_id id )
 
   if (prison_init ) {
     mtx_init(&FIXME_prison.pr_mtx, "prison lock", NULL, MTX_DEF | MTX_DUPOK);
+
     prison_init = 0;
   }
 
-  FIXME_ucred.cr_prison = &FIXME_prison;     /* jail(2) */
+  FIXME_ucred.cr_prison   = &FIXME_prison;    /* jail(2) */
+  FIXME_ucred.cr_uidinfo  = uifind(0);
+  FIXME_ucred.cr_ruidinfo = uifind(0);
+  FIXME_ucred.cr_ngroups = 1;     /* group 0 */
 
 	td->td_proc->p_ucred = crhold(&FIXME_ucred);
 	mtx_init(&td->td_proc->p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK);




More information about the vc mailing list