This is the sandbox patch
policycoreutils/sandbox/Makefile +41 -0
@@ -0,0 +1,41 @@ +# Installation directories. +PREFIX ?= ${DESTDIR}/usr +INITDIR ?= ${DESTDIR}/etc/rc.d/init.d/ +SYSCONFDIR ?= ${DESTDIR}/etc/sysconfig +BINDIR ?= $(PREFIX)/bin +SBINDIR ?= $(PREFIX)/sbin +MANDIR ?= $(PREFIX)/share/man +LOCALEDIR ?= /usr/share/locale +SHAREDIR ?= $(PREFIX)/share/sandbox +override CFLAGS += $(LDFLAGS) -I$(PREFIX)/include -DPACKAGE="\"policycoreutils\"" +LDLIBS += -lselinux -lcap-ng + +all: sandbox seunshare sandboxX.sh + +seunshare: seunshare.o $(EXTRA_OBJS) + $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) + +install: all + -mkdir -p $(BINDIR) + install -m 755 sandbox $(BINDIR) + -mkdir -p $(MANDIR)/man8 + install -m 644 sandbox.8 $(MANDIR)/man8/ + -mkdir -p $(SBINDIR) + install -m 4755 seunshare $(SBINDIR)/ + -mkdir -p $(SHAREDIR) + install -m 755 sandboxX.sh $(SHAREDIR) + -mkdir -p $(INITDIR) + install -m 755 sandbox.init $(INITDIR)/sandbox + -mkdir -p $(SYSCONFDIR) + install -m 644 sandbox.config $(SYSCONFDIR)/sandbox + +test: + @python test_sandbox.py -v + +clean: + -rm -f seunshare *.o *~ + +indent: + ../../scripts/Lindent $(wildcard *.[ch]) + +relabel:
policycoreutils/sandbox/sandbox +415 -0
415 lines not on this page · raw message
policycoreutils/sandbox/sandbox.8 +50 -0
50 lines not on this page · raw message
policycoreutils/sandbox/sandbox.config +2 -0
@@ -0,0 +1,2 @@ +# Space separate list of homedirs +HOMEDIRS="/home"
policycoreutils/sandbox/sandbox.init +67 -0
67 lines not on this page · raw message
policycoreutils/sandbox/sandboxX.sh +15 -0
@@ -0,0 +1,15 @@ +#!/bin/bash +context=`id -Z | secon -t -l -P` +export TITLE="Sandbox $context -- `grep ^#TITLE: ~/.sandboxrc | /usr/bin/cut -b8-80`" +export SCREENSIZE="1000x700" +#export SCREENSIZE=`xdpyinfo | awk '/dimensions/ { print $2 }'` +trap "exit 0" HUP + +(/usr/bin/Xephyr -title "$TITLE" -terminate -screen $SCREENSIZE -displayfd 5 5>&1 2>/dev/null) | while read D; do + export DISPLAY=:$D + python -c 'import gtk, os; os.system("%s/.sandboxrc" % os.environ["HOME"])' + export EXITCODE=$? + kill -HUP 0 + break +done +exit 0
policycoreutils/sandbox/seunshare.c +265 -0
265 lines not on this page · raw message
policycoreutils/sandbox/test_sandbox.py +98 -0
98 lines not on this page · raw message
policycoreutils/Makefile +1 -1
@@ -1,4 +1,4 @@ -SUBDIRS = setfiles semanage load_policy newrole run_init secon audit2allow audit2why scripts sestatus semodule_package semodule semodule_link semodule_expand semodule_deps setsebool po +SUBDIRS = setfiles semanage load_policy newrole run_init secon audit2allow audit2why sandbox scripts sestatus semodule_package semodule semodule_link semodule_expand semodule_deps setsebool po INOTIFYH = $(shell ls /usr/include/sys/inotify.h 2>/dev/null)