/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Teddy Hogeborn
  • Date: 2024-09-09 04:24:39 UTC
  • mto: This revision was merged to the branch mainline in revision 410.
  • Revision ID: teddy@recompile.se-20240909042439-j85mr20uli2hnyis
Eliminate compiler warnings

Many programs use nested functions, which now result in a linker
warning about executable stack.  Hide this warning.  Also, rewrite a
loop in the plymouth plugin to avoid warning about signed overflow.
This change also makes the plugin pick the alphabetically first
process entry instead of the last, in case many plymouth processes are
found (which should be unlikely).

* Makefile (plugin-runner, dracut-module/password-agent,
  plugins.d/password-prompt, plugins.d/mandos-client,
  plugins.d/plymouth): New target; set LDFLAGS to add "-Xlinker
  --no-warn-execstack".
* plugins.d/plymouth.c (get_pid): When no pid files are found, and we
  are looking through the process list, go though it from the start
  instead of from the end, i.e. in normal alphabetical order and not
  in reverse order.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
LANGUAGE:=-std=gnu11
45
45
CPPFLAGS+=-D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64
46
46
htmldir:=man
47
 
version:=1.8.17
 
47
version:=1.8.16
48
48
SED:=sed
49
49
PKG_CONFIG?=pkg-config
50
50
 
57
57
 
58
58
## Use these settings for a traditional /usr/local install
59
59
# PREFIX:=$(DESTDIR)/usr/local
60
 
# BINDIR:=$(PREFIX)/sbin
61
60
# CONFDIR:=$(DESTDIR)/etc/mandos
62
61
# KEYDIR:=$(DESTDIR)/etc/mandos/keys
63
62
# MANDIR:=$(PREFIX)/man
70
69
 
71
70
## These settings are for a package-type install
72
71
PREFIX:=$(DESTDIR)/usr
73
 
BINDIR:=$(PREFIX)/sbin
74
72
CONFDIR:=$(DESTDIR)/etc/mandos
75
73
KEYDIR:=$(DESTDIR)/etc/keys/mandos
76
74
MANDIR:=$(PREFIX)/share/man
291
289
                --expression='s/\(mandos_\)[0-9.]\+\(\.orig\.tar\.gz\)/\1$(version)\2/' \
292
290
                $@)
293
291
 
294
 
# Does the linker support the --no-warn-execstack option?
295
 
ifeq ($(shell echo 'int main(){}'|$(CC) --language=c /dev/stdin -o /dev/null -Xlinker --no-warn-execstack >/dev/null 2>&1 && echo yes),yes)
296
 
# These programs use nested functions, which uses an executable stack
 
292
# Uses nested functions
297
293
plugin-runner: LDFLAGS += -Xlinker --no-warn-execstack
298
294
dracut-module/password-agent: LDFLAGS += -Xlinker --no-warn-execstack
299
295
plugins.d/password-prompt: LDFLAGS += -Xlinker --no-warn-execstack
300
296
plugins.d/mandos-client: LDFLAGS += -Xlinker --no-warn-execstack
301
297
plugins.d/plymouth: LDFLAGS += -Xlinker --no-warn-execstack
302
 
endif
303
298
 
304
299
# Need to add the GnuTLS, Avahi and GPGME libraries
305
300
plugins.d/mandos-client: CFLAGS += $(GNUTLS_CFLAGS) $(strip \
419
414
                install -D --mode=u=rw,go=r sysusers.d-mandos.conf \
420
415
                        $(SYSUSERS)/mandos.conf; \
421
416
        fi
422
 
        install --directory $(BINDIR)
423
 
        install --mode=u=rwx,go=rx --target-directory=$(BINDIR) mandos
424
 
        install --mode=u=rwx,go=rx --target-directory=$(BINDIR) \
 
417
        install --directory $(PREFIX)/sbin
 
418
        install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
 
419
                mandos
 
420
        install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
425
421
                mandos-ctl
426
 
        install --mode=u=rwx,go=rx --target-directory=$(BINDIR) \
 
422
        install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
427
423
                mandos-monitor
428
424
        install --directory $(CONFDIR)
429
425
        install --mode=u=rw,go=r --target-directory=$(CONFDIR) \
478
474
        install --mode=u=rwx,go=rx \
479
475
                --target-directory=$(LIBDIR)/mandos \
480
476
                mandos-to-cryptroot-unlock
481
 
        install --directory $(BINDIR)
482
 
        install --mode=u=rwx,go=rx --target-directory=$(BINDIR) \
 
477
        install --directory $(PREFIX)/sbin
 
478
        install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
483
479
                mandos-keygen
484
480
        install --mode=u=rwx,go=rx \
485
481
                --target-directory=$(LIBDIR)/mandos/plugins.d \
545
541
.PHONY: install-client
546
542
install-client: install-client-nokey
547
543
# Post-installation stuff
548
 
        -$(BINDIR)/mandos-keygen --dir "$(KEYDIR)"
 
544
        -$(PREFIX)/sbin/mandos-keygen --dir "$(KEYDIR)"
549
545
        if command -v update-initramfs >/dev/null; then \
550
546
            update-initramfs -k all -u; \
551
547
        elif command -v dracut >/dev/null; then \
563
559
 
564
560
.PHONY: uninstall-server
565
561
uninstall-server:
566
 
        -rm --force $(BINDIR)/mandos \
567
 
                $(BINDIR)/mandos-ctl \
568
 
                $(BINDIR)/mandos-monitor \
 
562
        -rm --force $(PREFIX)/sbin/mandos \
 
563
                $(PREFIX)/sbin/mandos-ctl \
 
564
                $(PREFIX)/sbin/mandos-monitor \
569
565
                $(MANDIR)/man8/mandos.8.gz \
570
566
                $(MANDIR)/man8/mandos-monitor.8.gz \
571
567
                $(MANDIR)/man8/mandos-ctl.8.gz \
580
576
# to use it.
581
577
        ! grep --regexp='^ *[^ #].*keyscript=[^,=]*/mandos/' \
582
578
                $(DESTDIR)/etc/crypttab
583
 
        -rm --force $(BINDIR)/mandos-keygen \
 
579
        -rm --force $(PREFIX)/sbin/mandos-keygen \
584
580
                $(LIBDIR)/mandos/plugin-runner \
585
581
                $(LIBDIR)/mandos/plugins.d/password-prompt \
586
582
                $(LIBDIR)/mandos/plugins.d/mandos-client \