/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-08 02:18:57 UTC
  • mto: This revision was merged to the branch mainline in revision 410.
  • Revision ID: teddy@recompile.se-20240908021857-821e09dd4mp37h9k
Be more tolerant when a client is misconfigured in clients.conf

* mandos (Client/config_parser): If a client config section in
  clients.conf lacks both a fingerprint= and a key_id= setting, show
  an error and skip that client instead of crashing.

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
 
289
289
                --expression='s/\(mandos_\)[0-9.]\+\(\.orig\.tar\.gz\)/\1$(version)\2/' \
290
290
                $@)
291
291
 
292
 
# Does the linker support the --no-warn-execstack option?
293
 
ifeq ($(shell echo 'int main(){}'|$(CC) --language=c /dev/stdin -o /dev/null -Xlinker --no-warn-execstack >/dev/null 2>&1 && echo yes),yes)
294
 
# These programs use nested functions, which uses an executable stack
295
 
plugin-runner: LDFLAGS += -Xlinker --no-warn-execstack
296
 
dracut-module/password-agent: LDFLAGS += -Xlinker --no-warn-execstack
297
 
plugins.d/password-prompt: LDFLAGS += -Xlinker --no-warn-execstack
298
 
plugins.d/mandos-client: LDFLAGS += -Xlinker --no-warn-execstack
299
 
plugins.d/plymouth: LDFLAGS += -Xlinker --no-warn-execstack
300
 
endif
301
 
 
302
292
# Need to add the GnuTLS, Avahi and GPGME libraries
303
293
plugins.d/mandos-client: CFLAGS += $(GNUTLS_CFLAGS) $(strip \
304
294
        ) $(AVAHI_CFLAGS) $(GPGME_CFLAGS)
385
375
 
386
376
# Used by run-server
387
377
confdir/mandos.conf: mandos.conf
388
 
        install -D --mode=u=rw,go=r $^ $@
 
378
        install --directory confdir
 
379
        install --mode=u=rw,go=r $^ $@
389
380
confdir/clients.conf: clients.conf keydir/seckey.txt keydir/tls-pubkey.pem
390
 
        install -D --mode=u=rw $< $@
 
381
        install --directory confdir
 
382
        install --mode=u=rw $< $@
391
383
# Add a client password
392
384
        ./mandos-keygen --dir keydir --password --no-ssh >> $@
393
385
statedir:
398
390
 
399
391
.PHONY: install-html
400
392
install-html: html
401
 
        install -D --mode=u=rw,go=r --target-directory=$(htmldir) \
 
393
        install --directory $(htmldir)
 
394
        install --mode=u=rw,go=r --target-directory=$(htmldir) \
402
395
                $(htmldocs)
403
396
 
404
397
.PHONY: install-server
405
398
install-server: doc
 
399
        install --directory $(CONFDIR)
406
400
        if install --directory --mode=u=rwx --owner=$(USER) \
407
401
                --group=$(GROUP) $(STATEDIR); then \
408
402
                :; \
409
403
        elif install --directory --mode=u=rwx $(STATEDIR); then \
410
404
                chown -- $(USER):$(GROUP) $(STATEDIR) || :; \
411
405
        fi
412
 
        if [ "$(TMPFILES)" != "$(DESTDIR)" ]; then \
413
 
                install -D --mode=u=rw,go=r tmpfiles.d-mandos.conf \
 
406
        if [ "$(TMPFILES)" != "$(DESTDIR)" \
 
407
                        -a -d "$(TMPFILES)" ]; then \
 
408
                install --mode=u=rw,go=r tmpfiles.d-mandos.conf \
414
409
                        $(TMPFILES)/mandos.conf; \
415
410
        fi
416
 
        if [ "$(SYSUSERS)" != "$(DESTDIR)" ]; then \
417
 
                install -D --mode=u=rw,go=r sysusers.d-mandos.conf \
 
411
        if [ "$(SYSUSERS)" != "$(DESTDIR)" \
 
412
                        -a -d "$(SYSUSERS)" ]; then \
 
413
                install --mode=u=rw,go=r sysusers.d-mandos.conf \
418
414
                        $(SYSUSERS)/mandos.conf; \
419
415
        fi
420
 
        install --directory $(PREFIX)/sbin
421
 
        install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
422
 
                mandos
 
416
        install --mode=u=rwx,go=rx mandos $(PREFIX)/sbin/mandos
423
417
        install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
424
418
                mandos-ctl
425
419
        install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
426
420
                mandos-monitor
427
 
        install --directory $(CONFDIR)
428
421
        install --mode=u=rw,go=r --target-directory=$(CONFDIR) \
429
422
                mandos.conf
430
423
        install --mode=u=rw --target-directory=$(CONFDIR) \
431
424
                clients.conf
432
 
        install -D --mode=u=rw,go=r dbus-mandos.conf \
 
425
        install --mode=u=rw,go=r dbus-mandos.conf \
433
426
                $(DBUSPOLICYDIR)/mandos.conf
434
 
        install -D --mode=u=rwx,go=rx init.d-mandos \
 
427
        install --mode=u=rwx,go=rx init.d-mandos \
435
428
                $(DESTDIR)/etc/init.d/mandos
436
 
        if [ "$(SYSTEMD)" != "$(DESTDIR)" ]; then \
437
 
                install -D --mode=u=rw,go=r mandos.service \
438
 
                        $(SYSTEMD); \
 
429
        if [ "$(SYSTEMD)" != "$(DESTDIR)" -a -d "$(SYSTEMD)" ]; then \
 
430
                install --mode=u=rw,go=r mandos.service $(SYSTEMD); \
439
431
        fi
440
 
        install -D --mode=u=rw,go=r default-mandos \
 
432
        install --mode=u=rw,go=r default-mandos \
441
433
                $(DESTDIR)/etc/default/mandos
442
434
        if [ -z $(DESTDIR) ]; then \
443
435
                update-rc.d mandos defaults 25 15;\
444
436
        fi
445
 
        install --directory $(MANDIR)/man8 $(MANDIR)/man5
446
437
        gzip --best --to-stdout mandos.8 \
447
438
                > $(MANDIR)/man8/mandos.8.gz
448
439
        gzip --best --to-stdout mandos-monitor.8 \
458
449
 
459
450
.PHONY: install-client-nokey
460
451
install-client-nokey: all doc
 
452
        install --directory $(LIBDIR)/mandos $(CONFDIR)
461
453
        install --directory --mode=u=rwx $(KEYDIR) \
462
454
                $(LIBDIR)/mandos/plugins.d \
463
455
                $(LIBDIR)/mandos/plugin-helpers
464
 
        if [ "$(SYSUSERS)" != "$(DESTDIR)" ]; then \
465
 
                install -D --mode=u=rw,go=r sysusers.d-mandos.conf \
 
456
        if [ "$(SYSUSERS)" != "$(DESTDIR)" \
 
457
                        -a -d "$(SYSUSERS)" ]; then \
 
458
                install --mode=u=rw,go=r sysusers.d-mandos.conf \
466
459
                        $(SYSUSERS)/mandos-client.conf; \
467
460
        fi
468
461
        if [ "$(CONFDIR)" != "$(LIBDIR)/mandos" ]; then \
469
 
                install --directory \
470
 
                        --mode=u=rwx "$(CONFDIR)/plugins.d" \
 
462
                install --mode=u=rwx \
 
463
                        --directory "$(CONFDIR)/plugins.d" \
471
464
                        "$(CONFDIR)/plugin-helpers"; \
472
465
        fi
473
 
        install --directory --mode=u=rwx,go=rx \
 
466
        install --mode=u=rwx,go=rx --directory \
474
467
                "$(CONFDIR)/network-hooks.d"
475
468
        install --mode=u=rwx,go=rx \
476
469
                --target-directory=$(LIBDIR)/mandos plugin-runner
477
470
        install --mode=u=rwx,go=rx \
478
471
                --target-directory=$(LIBDIR)/mandos \
479
472
                mandos-to-cryptroot-unlock
480
 
        install --directory $(PREFIX)/sbin
481
473
        install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
482
474
                mandos-keygen
483
475
        install --mode=u=rwx,go=rx \
501
493
        install --mode=u=rwx,go=rx \
502
494
                --target-directory=$(LIBDIR)/mandos/plugin-helpers \
503
495
                plugin-helpers/mandos-client-iprouteadddel
504
 
        install -D initramfs-tools-hook \
 
496
        install initramfs-tools-hook \
505
497
                $(INITRAMFSTOOLS)/hooks/mandos
506
 
        install -D --mode=u=rw,go=r initramfs-tools-conf \
 
498
        install --mode=u=rw,go=r initramfs-tools-conf \
507
499
                $(INITRAMFSTOOLS)/conf.d/mandos-conf
508
 
        install -D --mode=u=rw,go=r initramfs-tools-conf-hook \
 
500
        install --mode=u=rw,go=r initramfs-tools-conf-hook \
509
501
                $(INITRAMFSTOOLS)/conf-hooks.d/zz-mandos
510
 
        install -D initramfs-tools-script \
 
502
        install initramfs-tools-script \
511
503
                $(INITRAMFSTOOLS)/scripts/init-premount/mandos
512
 
        install -D initramfs-tools-script-stop \
 
504
        install initramfs-tools-script-stop \
513
505
                $(INITRAMFSTOOLS)/scripts/local-premount/mandos
514
 
        install -D --mode=u=rw,go=r \
515
 
                --target-directory=$(DRACUTMODULE) \
 
506
        install --directory $(DRACUTMODULE)
 
507
        install --mode=u=rw,go=r --target-directory=$(DRACUTMODULE) \
516
508
                dracut-module/ask-password-mandos.path \
517
509
                dracut-module/ask-password-mandos.service
518
510
        install --mode=u=rwxs,go=rx \
521
513
                dracut-module/cmdline-mandos.sh \
522
514
                dracut-module/password-agent
523
515
        install --mode=u=rw,go=r plugin-runner.conf $(CONFDIR)
524
 
        install --directory $(MANDIR)/man8
525
516
        gzip --best --to-stdout mandos-keygen.8 \
526
517
                > $(MANDIR)/man8/mandos-keygen.8.gz
527
518
        gzip --best --to-stdout plugin-runner.8mandos \
624
615
                $(DESTDIR)/etc/dbus-1/system.d/mandos.conf
625
616
                $(DESTDIR)/etc/default/mandos \
626
617
                $(DESTDIR)/etc/init.d/mandos \
 
618
                $(SYSTEMD)/mandos.service \
627
619
                $(DESTDIR)/run/mandos.pid \
628
620
                $(DESTDIR)/var/run/mandos.pid
629
 
        if [ "$(SYSTEMD)" != "$(DESTDIR)" -a -d "$(SYSTEMD)" ]; then \
630
 
                -rm --force -- $(SYSTEMD)/mandos.service; \
631
 
        fi
632
621
        -rmdir $(CONFDIR)
633
622
 
634
623
.PHONY: purge-client