diff options
| author | Philipp Stephani | 2020-12-17 11:20:55 +0100 |
|---|---|---|
| committer | Philipp Stephani | 2020-12-29 14:37:51 +0100 |
| commit | 202a61d09cddf420ce2f18f86aea741f086022fd (patch) | |
| tree | 567adc566589c3cda9cb3b4e615e575c34f3ec1c /lib-src/Makefile.in | |
| parent | 2334f9bfa3f54a606d1748ab86ee9fd481369d7a (diff) | |
| download | emacs-scratch/seccomp.tar.gz emacs-scratch/seccomp.zip | |
Add a helper binary to create a basic Secure Computing filter.scratch/seccomp
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 a2d27eab001..72a980e4de3 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in | |||
| @@ -209,6 +209,12 @@ LIB_EACCESS=@LIB_EACCESS@ | |||
| 209 | ## empty or -lwsock2 for MinGW | 209 | ## empty or -lwsock2 for MinGW |
| 210 | LIB_WSOCK32=@LIB_WSOCK32@ | 210 | LIB_WSOCK32=@LIB_WSOCK32@ |
| 211 | 211 | ||
| 212 | LIBSECCOMP=@LIBSECCOMP@ | ||
| 213 | |||
| 214 | ifneq ($(LIBSECCOMP),) | ||
| 215 | DONT_INSTALL += seccomp-filter$(EXEEXT) | ||
| 216 | endif | ||
| 217 | |||
| 212 | ## Extra libraries to use when linking movemail. | 218 | ## Extra libraries to use when linking movemail. |
| 213 | LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \ | 219 | LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \ |
| 214 | $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32) | 220 | $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32) |
| @@ -238,6 +244,10 @@ config_h = ../src/config.h $(srcdir)/../src/conf_post.h | |||
| 238 | 244 | ||
| 239 | all: ${EXE_FILES} ${SCRIPTS} | 245 | all: ${EXE_FILES} ${SCRIPTS} |
| 240 | 246 | ||
| 247 | ifneq ($(LIBSECCOMP),) | ||
| 248 | all: seccomp-filter.bpf | ||
| 249 | endif | ||
| 250 | |||
| 241 | .PHONY: all need-blessmail maybe-blessmail | 251 | .PHONY: all need-blessmail maybe-blessmail |
| 242 | 252 | ||
| 243 | LOADLIBES = ../lib/libgnu.a $(LIBS_SYSTEM) | 253 | LOADLIBES = ../lib/libgnu.a $(LIBS_SYSTEM) |
| @@ -420,4 +430,13 @@ update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h) | |||
| 420 | emacsclient.res: ../nt/emacsclient.rc $(NTINC)/../icons/emacs.ico | 430 | emacsclient.res: ../nt/emacsclient.rc $(NTINC)/../icons/emacs.ico |
| 421 | $(AM_V_RC)$(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ $< | 431 | $(AM_V_RC)$(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ $< |
| 422 | 432 | ||
| 433 | ifneq ($(LIBSECCOMP),) | ||
| 434 | seccomp-filter$(EXEEXT): $(srcdir)/seccomp-filter.c $(config_h) | ||
| 435 | $(AM_V_CCLD)$(CC) $(ALL_CFLAGS) $< $(LIBSECCOMP) -o $@ | ||
| 436 | |||
| 437 | seccomp-filter.bpf seccomp-filter.pfc: seccomp-filter$(EXEEXT) | ||
| 438 | $(AM_V_GEN)./seccomp-filter$(EXEEXT) \ | ||
| 439 | seccomp-filter.bpf seccomp-filter.pfc | ||
| 440 | endif | ||
| 441 | |||
| 423 | ## Makefile ends here. | 442 | ## Makefile ends here. |