From owner-p4-projects Thu Dec 19 11:21:11 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B207037B401; Thu, 19 Dec 2002 11:21:08 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 483EF37B404 for ; Thu, 19 Dec 2002 11:21:08 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD10443EDC for ; Thu, 19 Dec 2002 11:21:07 -0800 (PST) (envelope-from green@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id gBJJL7mV090458 for ; Thu, 19 Dec 2002 11:21:07 -0800 (PST) (envelope-from green@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gBJJL64C090440 for perforce@freebsd.org; Thu, 19 Dec 2002 11:21:06 -0800 (PST) Date: Thu, 19 Dec 2002 11:21:06 -0800 (PST) Message-Id: <200212191921.gBJJL64C090440@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to green@freebsd.org using -f From: Brian Feldman Subject: PERFORCE change 22518 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=22518 Change 22518 by green@green_laptop_2 on 2002/12/19 11:20:52 * Make all SEBSD function prototypes live in sebsd.h. * Add get_default_context(). * Add getseccontext(). * Add the ability for get_default_user_contexts() use getseccontext() to determine the current context and prevent the program using it from needing to retrieve the subject label itself. Affected files ... .. //depot/projects/trustedbsd/mac/lib/libsebsd/Makefile#3 edit .. //depot/projects/trustedbsd/mac/lib/libsebsd/sebsd.h#3 edit .. //depot/projects/trustedbsd/mac/lib/libsebsd/sebsd_ss.h#5 edit .. //depot/projects/trustedbsd/mac/lib/libsebsd/security_get_user_contexts.c#3 edit Differences ... ==== //depot/projects/trustedbsd/mac/lib/libsebsd/Makefile#3 (text+ko) ==== @@ -10,7 +10,8 @@ CFLAGS+=-I${.CURDIR}/../../sys NOMAN= -SRCS= system.c security_get_user_contexts.c get_ordered_context_list.c +SRCS= system.c security_get_user_contexts.c get_ordered_context_list.c \ + getseccontext.c INCS= sebsd_context.h sebsd_ss.h sebsd_proc.h sebsd_fs.h sebsd.h \ sebsd_syscalls.h flask_types.h ==== //depot/projects/trustedbsd/mac/lib/libsebsd/sebsd.h#3 (text+ko) ==== @@ -47,8 +47,15 @@ #define SEBSD_ID_STRING "sebsd" -int sebsd_enabled(); -int sebsd_enforcing(); -int sebsd_avc_toggle(); +int sebsd_enabled(void); +int sebsd_enforcing(void); +int sebsd_avc_toggle(void); +char *getseccontext(void); +int security_get_user_contexts(const char *fromcontext, const char *username, + char ***retcontexts, size_t *ncontexts); +int get_ordered_context_list(const char *user_name, const char *from_context, + char ***ordered_list, size_t *length); +int get_default_context(const char *username, const char *from_context, + char **default_context); #endif /* _SEBSD_H */ ==== //depot/projects/trustedbsd/mac/lib/libsebsd/sebsd_ss.h#5 (text+ko) ==== @@ -81,17 +81,6 @@ extern int security_get_sids(security_id_t *sids, __u32 *nel); -extern int security_get_user_contexts(const char *fromcontext, - const char *username, - const char *const **retcontexts, - size_t *ncontexts); - -/* XXX: do we need its header file? */ -extern int get_ordered_context_list(const char *user_name, - const char *from_context, - char ***ordered_list, - size_t *length); - extern int security_mls(void); ==== //depot/projects/trustedbsd/mac/lib/libsebsd/security_get_user_contexts.c#3 (text+ko) ==== @@ -50,7 +50,7 @@ */ int security_get_user_contexts(const char *fromcontext, const char *username, - const char *const **retcontexts, size_t *ncontexts) + char ***retcontexts, size_t *ncontexts) { char *arguments, *contexts, *s, **contextarray; ssize_t arguments_len; @@ -116,6 +116,6 @@ n++; } *ncontexts = n; - *retcontexts = (const char *const *)contextarray; + *retcontexts = contextarray; return (0); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message