From: <ssm...@us...> - 2007-08-01 18:49:37
|
Revision: 2503 http://selinux.svn.sourceforge.net/selinux/?rev=2503&view=rev Author: ssmalley Date: 2007-08-01 11:49:34 -0700 (Wed, 01 Aug 2007) Log Message: ----------- Author: Yuichi Nakamura Email: yn...@hi... Subject: Update for libselinux embedded build support Date: Mon, 30 Jul 2007 10:22:54 +0900 On Wed, 25 Jul 2007 08:47:40 -0400 Stephen Smalley wrote: > On Wed, 2007-07-25 at 12:10 +0900, Yuichi Nakamura wrote: ... > > Index: libselinux/src/compute_create.c > > =================================================================== > > --- libselinux/src/compute_create.c (revision 2500) > > +++ libselinux/src/compute_create.c (working copy) > > @@ -36,7 +36,12 @@ > > ret = -1; > > goto out; > > } > > + > > +#ifdef DISABLE_AVC > > + snprintf(buf, size, "%s %s %hu", scon, tcon, tclass); > > +#else > > snprintf(buf, size, "%s %s %hu", scon, tcon, unmap_class(tclass)); > > +#endif > > As with the kernel, we don't want #ifdef's sprinkled through the code. > Instead, just #define unmap_class(x) x and #define unmap_perm(x,y) y in > mapping.h #ifdef DISABLE_AVC. Fixed, below is updated patch. Acked-by: Stephen Smalley <sd...@ty...> Revision Links: -------------- http://selinux.svn.sourceforge.net/selinux/?rev=2500&view=rev Modified Paths: -------------- trunk/libselinux/Makefile trunk/libselinux/src/Makefile trunk/libselinux/src/mapping.h Modified: trunk/libselinux/Makefile =================================================================== --- trunk/libselinux/Makefile 2007-07-25 14:25:44 UTC (rev 2502) +++ trunk/libselinux/Makefile 2007-08-01 18:49:34 UTC (rev 2503) @@ -8,6 +8,9 @@ override DISABLE_RPM=y override DISABLE_BOOL=y endif +ifeq ($(DISABLE_AVC),y) + EMFLAGS+= -DDISABLE_AVC +endif ifeq ($(DISABLE_BOOL),y) EMFLAGS+= -DDISABLE_BOOL endif Modified: trunk/libselinux/src/Makefile =================================================================== --- trunk/libselinux/src/Makefile 2007-07-25 14:25:44 UTC (rev 2502) +++ trunk/libselinux/src/Makefile 2007-08-01 18:49:34 UTC (rev 2503) @@ -20,7 +20,7 @@ LIBSO=$(TARGET).$(LIBVERSION) ifeq ($(DISABLE_AVC),y) - UNUSED_SRCS+=avc.c avc_internal.c avc_sidtab.c + UNUSED_SRCS+=avc.c avc_internal.c avc_sidtab.c mapping.c stringrep.c checkAccess.c endif ifeq ($(DISABLE_BOOL),y) UNUSED_SRCS+=booleans.c Modified: trunk/libselinux/src/mapping.h =================================================================== --- trunk/libselinux/src/mapping.h 2007-07-25 14:25:44 UTC (rev 2502) +++ trunk/libselinux/src/mapping.h 2007-08-01 18:49:34 UTC (rev 2503) @@ -31,4 +31,11 @@ extern void map_decision(security_class_t tclass, struct av_decision *avd); +/*mapping is not used for embedded build*/ +#ifdef DISABLE_AVC +#define unmap_perm(x,y) y +#define unmap_class(x) x +#define map_decision(x,y) +#endif + #endif /* _SELINUX_MAPPING_H_ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |