diff options
author | oshogbo <oshogbo@FreeBSD.org> | 2016-02-25 18:23:40 +0000 |
---|---|---|
committer | oshogbo <oshogbo@FreeBSD.org> | 2016-02-25 18:23:40 +0000 |
commit | 023f14d65b31db71d1a4e6655205dd919bfeb5fb (patch) | |
tree | faa5b7886c70249c03078cb4861e837c2d0f6582 /tools | |
parent | 85f8ae969b95a5539c68ffb09c545b5023901f4e (diff) | |
download | FreeBSD-src-023f14d65b31db71d1a4e6655205dd919bfeb5fb.zip FreeBSD-src-023f14d65b31db71d1a4e6655205dd919bfeb5fb.tar.gz |
Convert casperd(8) daemon to the libcasper.
After calling the cap_init(3) function Casper will fork from it's original
process, using pdfork(2). Forking from a process has a lot of advantages:
1. We have the same cwd as the original process.
2. The same uid, gid and groups.
3. The same MAC labels.
4. The same descriptor table.
5. The same routing table.
6. The same umask.
7. The same cpuset(1).
From now services are also in form of libraries.
We also removed libcapsicum at all and converts existing program using Casper
to new architecture.
Discussed with: pjd, jonathan, ed, drysdale@google.com, emaste
Partially reviewed by: drysdale@google.com, bdrewery
Approved by: pjd (mentor)
Differential Revision: https://reviews.freebsd.org/D4277
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/capsicum/libcasper/Makefile (renamed from tools/regression/capsicum/libcapsicum/Makefile) | 3 | ||||
-rw-r--r-- | tools/regression/capsicum/libcasper/dns.c (renamed from tools/regression/capsicum/libcapsicum/dns.c) | 6 | ||||
-rw-r--r-- | tools/regression/capsicum/libcasper/grp.c (renamed from tools/regression/capsicum/libcapsicum/grp.c) | 6 | ||||
-rw-r--r-- | tools/regression/capsicum/libcasper/pwd.c (renamed from tools/regression/capsicum/libcapsicum/pwd.c) | 6 | ||||
-rw-r--r-- | tools/regression/capsicum/libcasper/sysctl.c (renamed from tools/regression/capsicum/libcapsicum/sysctl.c) | 6 |
5 files changed, 13 insertions, 14 deletions
diff --git a/tools/regression/capsicum/libcapsicum/Makefile b/tools/regression/capsicum/libcasper/Makefile index 468fa33..b024c3b 100644 --- a/tools/regression/capsicum/libcapsicum/Makefile +++ b/tools/regression/capsicum/libcasper/Makefile @@ -12,7 +12,6 @@ CFLAGS+= -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter CFLAGS+= -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls CFLAGS+= -Wold-style-definition -Wno-pointer-sign -CFLAGS+= -I${.CURDIR}/../../../../lib/libcapsicum CFLAGS+= -ggdb SERVTEST= ${SERVICES:=.t} @@ -22,7 +21,7 @@ all: ${SERVTEST} .for SERVICE in ${SERVICES} ${SERVICE}.t: ${SERVICE}.c - ${CC} ${CFLAGS} ${@:.t=.c} -o $@ -lcapsicum -lnv + ${CC} ${CFLAGS} ${@:.t=.c} -o $@ -lnv -lcasper -lcap_${@:.t=} .endfor diff --git a/tools/regression/capsicum/libcapsicum/dns.c b/tools/regression/capsicum/libcasper/dns.c index 4426bf3..eb364da 100644 --- a/tools/regression/capsicum/libcapsicum/dns.c +++ b/tools/regression/capsicum/libcasper/dns.c @@ -44,9 +44,9 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <unistd.h> -#include <libcapsicum.h> -#include <libcapsicum_dns.h> -#include <libcapsicum_service.h> +#include <libcasper.h> + +#include <casper/cap_dns.h> static int ntest = 1; diff --git a/tools/regression/capsicum/libcapsicum/grp.c b/tools/regression/capsicum/libcasper/grp.c index dbffeaf..7b8ada5 100644 --- a/tools/regression/capsicum/libcapsicum/grp.c +++ b/tools/regression/capsicum/libcasper/grp.c @@ -41,9 +41,9 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <unistd.h> -#include <libcapsicum.h> -#include <libcapsicum_grp.h> -#include <libcapsicum_service.h> +#include <libcasper.h> + +#include <casper/cap_grp.h> static int ntest = 1; diff --git a/tools/regression/capsicum/libcapsicum/pwd.c b/tools/regression/capsicum/libcasper/pwd.c index 23e81a3..b102700 100644 --- a/tools/regression/capsicum/libcapsicum/pwd.c +++ b/tools/regression/capsicum/libcasper/pwd.c @@ -41,9 +41,9 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <unistd.h> -#include <libcapsicum.h> -#include <libcapsicum_pwd.h> -#include <libcapsicum_service.h> +#include <libcasper.h> + +#include <casper/cap_pwd.h> static int ntest = 1; diff --git a/tools/regression/capsicum/libcapsicum/sysctl.c b/tools/regression/capsicum/libcasper/sysctl.c index f3ae307..f326820 100644 --- a/tools/regression/capsicum/libcapsicum/sysctl.c +++ b/tools/regression/capsicum/libcasper/sysctl.c @@ -44,9 +44,9 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <unistd.h> -#include <libcapsicum.h> -#include <libcapsicum_service.h> -#include <libcapsicum_sysctl.h> +#include <libcasper.h> + +#include <casper/cap_sysctl.h> /* * We need some sysctls to perform the tests on. |