policycoreutils: sandbox: Makefile: new man pages

we have man pages which aren't being instelled with make install.  We
also do not include -Werror -Wall -Wextra in the build like we do with
other packages, so include those.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
Eric Paris 2011-08-15 13:56:02 -04:00
parent baf4d59407
commit 3c5abbc341
5 changed files with 99 additions and 2 deletions

View File

@ -10,7 +10,7 @@ SHAREDIR ?= $(PREFIX)/share/sandbox
override CFLAGS += $(LDFLAGS) -I$(PREFIX)/include -DPACKAGE="\"policycoreutils\""
LDLIBS += -lselinux -lcap-ng
all: sandbox seunshare sandboxX.sh
all: sandbox seunshare sandboxX.sh start
seunshare: seunshare.o $(EXTRA_OBJS)
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
@ -20,14 +20,18 @@ install: all
install -m 755 sandbox $(BINDIR)
-mkdir -p $(MANDIR)/man8
install -m 644 sandbox.8 $(MANDIR)/man8/
install -m 644 seunshare.8 $(MANDIR)/man8/
-mkdir -p $(MANDIR)/man5
install -m 644 sandbox.conf.5 $(MANDIR)/man5/
-mkdir -p $(SBINDIR)
install -m 4755 seunshare $(SBINDIR)/
-mkdir -p $(SHAREDIR)
install -m 755 sandboxX.sh $(SHAREDIR)
install -m 755 start $(SHAREDIR)
-mkdir -p $(INITDIR)
install -m 755 sandbox.init $(INITDIR)/sandbox
-mkdir -p $(SYSCONFDIR)
install -m 644 sandbox.config $(SYSCONFDIR)/sandbox
install -m 644 sandbox.conf $(SYSCONFDIR)/sandbox
test:
@python test_sandbox.py -v

View File

@ -0,0 +1,7 @@
# Space separate list of homedirs
HOMEDIRS="/home"
# Control group configuration
NAME=sandbox
CPUAFFINITY=ALL
MEMUSAGE=80%
CPUUSAGE=80%

View File

@ -0,0 +1,40 @@
.TH sandbox.conf "5" "June 2010" "sandbox.conf" "Linux System Administration"
.SH NAME
sandbox.conf \- user config file for the SELinux sandbox
.SH DESCRIPTION
.PP
When running sandbox with the -C argument, it will be confined using control groups and a system administrator can specify how the sandbox is confined.
.PP
Everything after "#" is ignored, as are empty lines. All arguments should be separated by and equals sign ("=").
.PP
These keywords are allowed.
.RS
.TP
.B NAME
The name of the sandbox control group. Default is "sandbox".
.TP
.B CPUAFFINITY
Which cpus to assign sandbox to. The default is ALL, but users can specify a comma-separated list with dashes ("-") to represent ranges. Ex: 0-2,5
.TP
.B MEMUSAGE
How much memory to allow sandbox to use. The default is 80%. Users can specify either a percentage or a value in the form of a number followed by one of the suffixes K, M, G to denote kilobytes, megabytes or gigabytes respectively. Ex: 50% or 100M
.TP
.B CPUUSAGE
Percentage of cpu sandbox should be allowed to use. The default is 80%. Specify a value followed by a percent sign ("%"). Ex: 50%
.SH "SEE ALSO"
.TP
sandbox(8)
.PP
.SH AUTHOR
This manual page was written by
.I Thomas Liu <tliu@fedoraproject.org>

View File

@ -0,0 +1,37 @@
.TH SEUNSHARE "8" "May 2010" "seunshare" "User Commands"
.SH NAME
seunshare \- Run cmd with alternate homedir, tmpdir and/or SELinux context
.SH SYNOPSIS
.B seunshare
[ -v ] [ -c ] [ -t tmpdir ] [ -h homedir ] [ -Z context ] -- executable [args]
.br
.SH DESCRIPTION
.PP
Run the
.I executable
within the specified context, using the alternate home directory and /tmp directory. The seunshare command unshares from the default namespace, then mounts the specified homedir and tmpdir over the default homedir and /tmp. Finally it tells the kernel to execute the application under the specified SELinux context.
.TP
\fB\-h homedir\fR
Alternate homedir to be used by the application. Homedir must be owned by the user.
.TP
\fB\-t\ tmpdir
Use alternate temporary directory to mount on /tmp. tmpdir must be owned by the user.
.TP
\fB\-c --cgroups\fR
Use cgroups to control this copy of seunshare. Specify parameters in /etc/sysconfig/sandbox. Max memory usage and cpu usage are to be specified in percent. You can specify which CPUs to use by numbering them 0,1,2... etc.
.TP
\fB\-Z\ context
Use alternate SELinux context while runing the executable.
.TP
\fB\-v\fR
Verbose output
.SH "SEE ALSO"
.TP
runcon(1), sandbox(8), selinux(8)
.PP
.SH AUTHOR
This manual page was written by
.I Dan Walsh <dwalsh@redhat.com>
and
.I Thomas Liu <tliu@fedoraproject.org>

View File

@ -0,0 +1,9 @@
#! /usr/bin/python -Es
import gtk, commands, sys
rc = [-1,'']
try:
rc=commands.getstatusoutput(sys.argv[1])
except:
pass
if rc[0] == 0:
print rc[1]