diff options
| author | Philipp Stephani | 2020-12-17 11:20:55 +0100 |
|---|---|---|
| committer | Philipp Stephani | 2021-01-17 17:45:02 +0100 |
| commit | ea51edc2a58b6d44fdb9cff160834d9e8312cf9e (patch) | |
| tree | 1398b5fcb4b32172ac402a06a2a3a3877810cf06 /lib-src/Makefile.in | |
| parent | 6dec7327ab002903ac4791be33fec3669e6082c2 (diff) | |
| download | emacs-scratch/seccomp-no-gnulib.tar.gz emacs-scratch/seccomp-no-gnulib.zip | |
Add a helper binary to create a basic Secure Computing filter.scratch/seccomp-no-gnulib
The binary uses the 'seccomp' helper library. The library isn't
needed to load the generated Secure Computing filter.
* configure.ac: Check for 'seccomp' header and library.
* lib-src/seccomp-filter.c: New helper binary to generate a generic
Secure Computing filter for GNU/Linux.
* lib-src/Makefile.in (DONT_INSTALL): Add 'seccomp-filter' helper
binary if possible.
(all): Add Secure Computing filter file if possible.
(seccomp-filter$(EXEEXT)): Compile helper binary.
(seccomp-filter.bpf seccomp-filter.pfc): Generate filter files.
* test/src/emacs-tests.el (emacs-tests/seccomp/allows-stdout)
(emacs-tests/seccomp/forbids-subprocess): New unit tests.
* test/Makefile.in (src/emacs-tests.log): Add dependency on the helper
binary.
Diffstat (limited to 'lib-src/Makefile.in')
| -rw-r--r-- | lib-src/Makefile.in | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index 0a6dd826c10..78905e48fb3 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in | |||
| @@ -214,6 +214,12 @@ LIB_WSOCK32=@LIB_WSOCK32@ | |||
| 214 | ## Extra libraries for etags | 214 | ## Extra libraries for etags |
| 215 | LIBS_ETAGS = $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM) | 215 | LIBS_ETAGS = $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM) |
| 216 | 216 | ||
| 217 | LIBSECCOMP=@LIBSECCOMP@ | ||
| 218 | |||
| 219 | ifneq ($(LIBSECCOMP),) | ||
| 220 | DONT_INSTALL += seccomp-filter$(EXEEXT) | ||
| 221 | endif | ||
| 222 | |||
| 217 | ## Extra libraries to use when linking movemail. | 223 | ## Extra libraries to use when linking movemail. |
| 218 | LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \ | 224 | LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \ |
| 219 | $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32) $(LIBS_ETAGS) | 225 | $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32) $(LIBS_ETAGS) |
| @@ -243,6 +249,10 @@ config_h = ../src/config.h $(srcdir)/../src/conf_post.h | |||
| 243 | 249 | ||
| 244 | all: ${EXE_FILES} ${SCRIPTS} | 250 | all: ${EXE_FILES} ${SCRIPTS} |
| 245 | 251 | ||
| 252 | ifneq ($(LIBSECCOMP),) | ||
| 253 | all: seccomp-filter.bpf | ||
| 254 | endif | ||
| 255 | |||
| 246 | .PHONY: all need-blessmail maybe-blessmail | 256 | .PHONY: all need-blessmail maybe-blessmail |
| 247 | 257 | ||
| 248 | LOADLIBES = ../lib/libgnu.a $(LIBS_SYSTEM) | 258 | LOADLIBES = ../lib/libgnu.a $(LIBS_SYSTEM) |
| @@ -425,4 +435,13 @@ update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h) | |||
| 425 | emacsclient.res: ../nt/emacsclient.rc $(NTINC)/../icons/emacs.ico | 435 | emacsclient.res: ../nt/emacsclient.rc $(NTINC)/../icons/emacs.ico |
| 426 | $(AM_V_RC)$(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ $< | 436 | $(AM_V_RC)$(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ $< |
| 427 | 437 | ||
| 438 | ifneq ($(LIBSECCOMP),) | ||
| 439 | seccomp-filter$(EXEEXT): $(srcdir)/seccomp-filter.c $(config_h) | ||
| 440 | $(AM_V_CCLD)$(CC) $(ALL_CFLAGS) $< $(LIBSECCOMP) -o $@ | ||
| 441 | |||
| 442 | seccomp-filter.bpf seccomp-filter.pfc: seccomp-filter$(EXEEXT) | ||
| 443 | $(AM_V_GEN)./seccomp-filter$(EXEEXT) \ | ||
| 444 | seccomp-filter.bpf seccomp-filter.pfc | ||
| 445 | endif | ||
| 446 | |||
| 428 | ## Makefile ends here. | 447 | ## Makefile ends here. |