diff options
| author | Philipp Stephani | 2020-12-17 11:20:55 +0100 |
|---|---|---|
| committer | Philipp Stephani | 2021-04-10 21:01:46 +0200 |
| commit | f3a7536aa29e6690c66f69174079ba51d40c0443 (patch) | |
| tree | 5f16989652dc6294245f5dc767bbf51cfd9a7983 /lib-src/Makefile.in | |
| parent | 2d17e0124e4232db6344b18cec466eb31920e675 (diff) | |
| download | emacs-scratch/seccomp-helper-binary.tar.gz emacs-scratch/seccomp-helper-binary.zip | |
Add a helper binary to create a basic Secure Computing filter.scratch/seccomp-helper-binary
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 05eb524d19b..1942882004e 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in | |||
| @@ -189,6 +189,12 @@ LIB_WSOCK32=@LIB_WSOCK32@ | |||
| 189 | ## Extra libraries for etags | 189 | ## Extra libraries for etags |
| 190 | LIBS_ETAGS = $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM) | 190 | LIBS_ETAGS = $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM) |
| 191 | 191 | ||
| 192 | LIBSECCOMP=@LIBSECCOMP@ | ||
| 193 | |||
| 194 | ifneq ($(LIBSECCOMP),) | ||
| 195 | DONT_INSTALL += seccomp-filter$(EXEEXT) | ||
| 196 | endif | ||
| 197 | |||
| 192 | ## Extra libraries to use when linking movemail. | 198 | ## Extra libraries to use when linking movemail. |
| 193 | LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \ | 199 | LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \ |
| 194 | $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32) $(LIBS_ETAGS) | 200 | $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV) $(LIB_WSOCK32) $(LIBS_ETAGS) |
| @@ -218,6 +224,10 @@ config_h = ../src/config.h $(srcdir)/../src/conf_post.h | |||
| 218 | 224 | ||
| 219 | all: ${EXE_FILES} ${SCRIPTS} | 225 | all: ${EXE_FILES} ${SCRIPTS} |
| 220 | 226 | ||
| 227 | ifneq ($(LIBSECCOMP),) | ||
| 228 | all: seccomp-filter.bpf | ||
| 229 | endif | ||
| 230 | |||
| 221 | .PHONY: all need-blessmail maybe-blessmail | 231 | .PHONY: all need-blessmail maybe-blessmail |
| 222 | 232 | ||
| 223 | LOADLIBES = ../lib/libgnu.a $(LIBS_SYSTEM) | 233 | LOADLIBES = ../lib/libgnu.a $(LIBS_SYSTEM) |
| @@ -400,4 +410,13 @@ update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h) | |||
| 400 | emacsclient.res: ../nt/emacsclient.rc $(NTINC)/../icons/emacs.ico | 410 | emacsclient.res: ../nt/emacsclient.rc $(NTINC)/../icons/emacs.ico |
| 401 | $(AM_V_RC)$(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ $< | 411 | $(AM_V_RC)$(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ $< |
| 402 | 412 | ||
| 413 | ifneq ($(LIBSECCOMP),) | ||
| 414 | seccomp-filter$(EXEEXT): $(srcdir)/seccomp-filter.c $(config_h) | ||
| 415 | $(AM_V_CCLD)$(CC) $(ALL_CFLAGS) $< $(LIBSECCOMP) -o $@ | ||
| 416 | |||
| 417 | seccomp-filter.bpf seccomp-filter.pfc: seccomp-filter$(EXEEXT) | ||
| 418 | $(AM_V_GEN)./seccomp-filter$(EXEEXT) \ | ||
| 419 | seccomp-filter.bpf seccomp-filter.pfc | ||
| 420 | endif | ||
| 421 | |||
| 403 | ## Makefile ends here. | 422 | ## Makefile ends here. |