=== modified file 'DBUS-API' --- DBUS-API 2017-08-20 16:20:54 +0000 +++ DBUS-API 2018-02-08 10:23:55 +0000 @@ -130,8 +130,8 @@ * Copyright - Copyright © 2010-2017 Teddy Hogeborn - Copyright © 2010-2017 Björn Påhlsson + Copyright © 2010-2018 Teddy Hogeborn + Copyright © 2010-2018 Björn Påhlsson ** License: === modified file 'Makefile' --- Makefile 2017-08-20 19:12:58 +0000 +++ Makefile 2018-01-29 19:43:17 +0000 @@ -1,4 +1,4 @@ -WARN=-O -Wall -Wextra -Wdouble-promotion -Wformat=2 -Winit-self \ +WARN:=-O -Wall -Wextra -Wdouble-promotion -Wformat=2 -Winit-self \ -Wmissing-include-dirs -Wswitch-default -Wswitch-enum \ -Wunused -Wuninitialized -Wstrict-overflow=5 \ -Wsuggest-attribute=pure -Wsuggest-attribute=const \ @@ -10,10 +10,10 @@ -Wmissing-format-attribute -Wnormalized=nfc -Wpacked \ -Wredundant-decls -Wnested-externs -Winline -Wvla \ -Wvolatile-register-var -Woverlength-strings -#DEBUG=-ggdb3 -fsanitize=address +#DEBUG:=-ggdb3 -fsanitize=address # For info about _FORTIFY_SOURCE, see feature_test_macros(7) # and . -FORTIFY=-D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIC +FORTIFY:=-D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIC # ALL_SANITIZE_OPTIONS:=-fsanitize=leak -fsanitize=undefined \ -fsanitize=shift -fsanitize=integer-divide-by-zero \ @@ -28,8 +28,8 @@ SANITIZE:=$(foreach option,$(ALL_SANITIZE_OPTIONS),$(shell \ echo 'int main(){}' | $(CC) --language=c $(option) /dev/stdin \ -o /dev/null >/dev/null 2>&1 && echo $(option))) -LINK_FORTIFY_LD=-z relro -z now -LINK_FORTIFY= +LINK_FORTIFY_LD:=-z relro -z now +LINK_FORTIFY:= # If BROKEN_PIE is set, do not build with -pie ifndef BROKEN_PIE @@ -37,33 +37,33 @@ LINK_FORTIFY += -pie endif #COVERAGE=--coverage -OPTIMIZE=-Os -fno-strict-aliasing -LANGUAGE=-std=gnu11 -htmldir=man -version=1.7.16 -SED=sed +OPTIMIZE:=-Os -fno-strict-aliasing +LANGUAGE:=-std=gnu11 +htmldir:=man +version:=1.7.16 +SED:=sed -USER=$(firstword $(subst :, ,$(shell getent passwd _mandos || getent passwd nobody || echo 65534))) -GROUP=$(firstword $(subst :, ,$(shell getent group _mandos || getent group nogroup || echo 65534))) +USER:=$(firstword $(subst :, ,$(shell getent passwd _mandos || getent passwd nobody || echo 65534))) +GROUP:=$(firstword $(subst :, ,$(shell getent group _mandos || getent group nogroup || echo 65534))) ## Use these settings for a traditional /usr/local install -# PREFIX=$(DESTDIR)/usr/local -# CONFDIR=$(DESTDIR)/etc/mandos -# KEYDIR=$(DESTDIR)/etc/mandos/keys -# MANDIR=$(PREFIX)/man -# INITRAMFSTOOLS=$(DESTDIR)/etc/initramfs-tools -# STATEDIR=$(DESTDIR)/var/lib/mandos -# LIBDIR=$(PREFIX)/lib +# PREFIX:=$(DESTDIR)/usr/local +# CONFDIR:=$(DESTDIR)/etc/mandos +# KEYDIR:=$(DESTDIR)/etc/mandos/keys +# MANDIR:=$(PREFIX)/man +# INITRAMFSTOOLS:=$(DESTDIR)/etc/initramfs-tools +# STATEDIR:=$(DESTDIR)/var/lib/mandos +# LIBDIR:=$(PREFIX)/lib ## ## These settings are for a package-type install -PREFIX=$(DESTDIR)/usr -CONFDIR=$(DESTDIR)/etc/mandos -KEYDIR=$(DESTDIR)/etc/keys/mandos -MANDIR=$(PREFIX)/share/man -INITRAMFSTOOLS=$(DESTDIR)/usr/share/initramfs-tools -STATEDIR=$(DESTDIR)/var/lib/mandos -LIBDIR=$(shell \ +PREFIX:=$(DESTDIR)/usr +CONFDIR:=$(DESTDIR)/etc/mandos +KEYDIR:=$(DESTDIR)/etc/keys/mandos +MANDIR:=$(PREFIX)/share/man +INITRAMFSTOOLS:=$(DESTDIR)/usr/share/initramfs-tools +STATEDIR:=$(DESTDIR)/var/lib/mandos +LIBDIR:=$(shell \ for d in \ "/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null`" \ "`rpm --eval='%{_libdir}' 2>/dev/null`" /usr/lib; do \ @@ -74,18 +74,18 @@ done) ## -SYSTEMD=$(DESTDIR)$(shell pkg-config systemd --variable=systemdsystemunitdir) -TMPFILES=$(DESTDIR)$(shell pkg-config systemd --variable=tmpfilesdir) +SYSTEMD:=$(DESTDIR)$(shell pkg-config systemd --variable=systemdsystemunitdir) +TMPFILES:=$(DESTDIR)$(shell pkg-config systemd --variable=tmpfilesdir) -GNUTLS_CFLAGS=$(shell pkg-config --cflags-only-I gnutls) -GNUTLS_LIBS=$(shell pkg-config --libs gnutls) -AVAHI_CFLAGS=$(shell pkg-config --cflags-only-I avahi-core) -AVAHI_LIBS=$(shell pkg-config --libs avahi-core) -GPGME_CFLAGS=$(shell gpgme-config --cflags; getconf LFS_CFLAGS) -GPGME_LIBS=$(shell gpgme-config --libs; getconf LFS_LIBS; \ +GNUTLS_CFLAGS:=$(shell pkg-config --cflags-only-I gnutls) +GNUTLS_LIBS:=$(shell pkg-config --libs gnutls) +AVAHI_CFLAGS:=$(shell pkg-config --cflags-only-I avahi-core) +AVAHI_LIBS:=$(shell pkg-config --libs avahi-core) +GPGME_CFLAGS:=$(shell gpgme-config --cflags; getconf LFS_CFLAGS) +GPGME_LIBS:=$(shell gpgme-config --libs; getconf LFS_LIBS; \ getconf LFS_LDFLAGS) -LIBNL3_CFLAGS=$(shell pkg-config --cflags-only-I libnl-route-3.0) -LIBNL3_LIBS=$(shell pkg-config --libs libnl-route-3.0) +LIBNL3_CFLAGS:=$(shell pkg-config --cflags-only-I libnl-route-3.0) +LIBNL3_LIBS:=$(shell pkg-config --libs libnl-route-3.0) # Do not change these two CFLAGS+=$(WARN) $(DEBUG) $(FORTIFY) $(SANITIZE) $(COVERAGE) \ @@ -117,25 +117,25 @@ /usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl \ $<; $(HTMLPOST) $@) # Fix citerefentry links -HTMLPOST=$(SED) --in-place \ +HTMLPOST:=$(SED) --in-place \ --expression='s/\(\)\([^<]*\)\(<\/span>(\)\([^)]*\)\()<\/span><\/a>\)/\1\3.\5\2\3\4\5\6/g' -PLUGINS=plugins.d/password-prompt plugins.d/mandos-client \ +PLUGINS:=plugins.d/password-prompt plugins.d/mandos-client \ plugins.d/usplash plugins.d/splashy plugins.d/askpass-fifo \ plugins.d/plymouth -PLUGIN_HELPERS=plugin-helpers/mandos-client-iprouteadddel -CPROGS=plugin-runner $(PLUGINS) $(PLUGIN_HELPERS) -PROGS=mandos mandos-keygen mandos-ctl mandos-monitor $(CPROGS) -DOCS=mandos.8 mandos-keygen.8 mandos-monitor.8 mandos-ctl.8 \ +PLUGIN_HELPERS:=plugin-helpers/mandos-client-iprouteadddel +CPROGS:=plugin-runner $(PLUGINS) $(PLUGIN_HELPERS) +PROGS:=mandos mandos-keygen mandos-ctl mandos-monitor $(CPROGS) +DOCS:=mandos.8 mandos-keygen.8 mandos-monitor.8 mandos-ctl.8 \ mandos.conf.5 mandos-clients.conf.5 plugin-runner.8mandos \ plugins.d/mandos-client.8mandos \ plugins.d/password-prompt.8mandos plugins.d/usplash.8mandos \ plugins.d/splashy.8mandos plugins.d/askpass-fifo.8mandos \ plugins.d/plymouth.8mandos intro.8mandos -htmldocs=$(addsuffix .xhtml,$(DOCS)) +htmldocs:=$(addsuffix .xhtml,$(DOCS)) -objects=$(addsuffix .o,$(CPROGS)) +objects:=$(addsuffix .o,$(CPROGS)) all: $(PROGS) mandos.lsm === modified file 'debian/compat' --- debian/compat 2013-10-20 15:25:09 +0000 +++ debian/compat 2018-02-06 20:03:50 +0000 @@ -1,1 +1,1 @@ -9 +10 === modified file 'debian/control' --- debian/control 2017-08-20 16:27:49 +0000 +++ debian/control 2018-02-10 18:47:22 +0000 @@ -4,13 +4,14 @@ Maintainer: Mandos Maintainers Uploaders: Teddy Hogeborn , Björn Påhlsson -Build-Depends: debhelper (>= 9), docbook-xml, docbook-xsl, +Build-Depends: debhelper (>= 10), docbook-xml, docbook-xsl, libavahi-core-dev, libgpgme-dev | libgpgme11-dev, libgnutls28-dev (>= 3.3.0) | gnutls-dev (>= 3.3.0), + libgnutls28-dev (<< 3.6.0) | libgnutls30 (<< 3.6.0), xsltproc, pkg-config, libnl-route-3-dev Build-Depends-Indep: systemd, python (>= 2.7), python (<< 3), python-dbus, python-gi -Standards-Version: 4.0.1 +Standards-Version: 4.1.3 Vcs-Bzr: https://ftp.recompile.se/pub/mandos/trunk Vcs-Browser: https://bzr.recompile.se/loggerhead/mandos/trunk/files Homepage: https://www.recompile.se/mandos @@ -19,6 +20,7 @@ Architecture: all Depends: ${misc:Depends}, python (>= 2.7), python (<< 3), libgnutls28-dev (>= 3.3.0) | libgnutls30 (>= 3.3.0), + libgnutls28-dev (<< 3.6.0) | libgnutls30 (<< 3.6.0), python-dbus, python-gi, avahi-daemon, adduser, python-urwid, gnupg2 | gnupg, systemd-sysv | lsb-base (>= 3.0-6) Recommends: ssh-client | fping === modified file 'debian/copyright' --- debian/copyright 2017-08-20 16:23:14 +0000 +++ debian/copyright 2018-02-08 10:23:55 +0000 @@ -4,8 +4,8 @@ Source: Files: * -Copyright: Copyright © 2008-2017 Teddy Hogeborn - Copyright © 2008-2017 Björn Påhlsson +Copyright: Copyright © 2008-2018 Teddy Hogeborn + Copyright © 2008-2018 Björn Påhlsson License: GPL-3+ This file is part of Mandos. . === modified file 'debian/mandos.lintian-overrides' --- debian/mandos.lintian-overrides 2017-02-21 18:23:54 +0000 +++ debian/mandos.lintian-overrides 2018-02-10 18:58:32 +0000 @@ -2,4 +2,4 @@ # it, so it must be kept unreadable for non-root users. # mandos binary: non-standard-file-perm etc/mandos/clients.conf 0600 != 0644 -mandos: init.d-script-needs-depends-on-lsb-base etc/init.d/mandos (line 49) +mandos: init.d-script-needs-depends-on-lsb-base etc/init.d/mandos (line 46) === modified file 'debian/rules' --- debian/rules 2016-06-23 19:46:41 +0000 +++ debian/rules 2018-02-08 12:25:31 +0000 @@ -1,4 +1,14 @@ #!/usr/bin/make -f + +ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) + MAKEFLAGS += OPTIMIZE=-O0 +endif + +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + MAKEFLAGS += -j$(NUMJOBS) +endif + %: dh $@ @@ -23,8 +33,8 @@ dh_fixperms --exclude etc/keys/mandos \ --exclude etc/mandos/plugins.d \ --exclude etc/mandos/plugin-helpers \ - --exclude usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null)/mandos/plugins.d \ - --exclude usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null)/mandos/plugin-helpers \ + --exclude usr/lib/$(DEB_HOST_MULTIARCH)/mandos/plugins.d \ + --exclude usr/lib/$(DEB_HOST_MULTIARCH)/mandos/plugin-helpers \ --exclude usr/share/doc/mandos-client/examples/network-hooks.d chmod --recursive g-w -- \ "$(CURDIR)/debian/mandos-client/usr/share/doc/mandos-client/examples/network-hooks.d" === modified file 'debian/watch' --- debian/watch 2014-02-16 02:42:42 +0000 +++ debian/watch 2018-02-08 10:02:51 +0000 @@ -1,3 +1,3 @@ -version=3 -opts=pgpsigurlmangle=s/$/.asc/ \ - ftp://ftp.recompile.se/pub/mandos/mandos[-_]([^\s]+?)(?:\.orig)?\.tar\.(?:gz|bz2|7z|xz) +version=4 +opts=pgpmode=auto \ + https://ftp.recompile.se/pub/@PACKAGE@/@PACKAGE@@ANY_VERSION@(?:\.orig)?@ARCHIVE_EXT@ === modified file 'init.d-mandos' --- init.d-mandos 2016-03-13 00:37:02 +0000 +++ init.d-mandos 2018-02-10 13:23:58 +0000 @@ -11,9 +11,6 @@ # Author: Teddy Hogeborn # Author: Björn Påhlsson -# -# Please remove the "Author" lines above and replace them -# with your own name if you copy and modify this script. # Do NOT "set -e" === modified file 'initramfs-unpack' --- initramfs-unpack 2017-08-20 16:20:54 +0000 +++ initramfs-unpack 2018-02-08 10:23:55 +0000 @@ -2,8 +2,8 @@ # # Initramfs unpacker - unpacks initramfs images into /tmp # -# Copyright © 2013 Teddy Hogeborn -# Copyright © 2013 Björn Påhlsson +# Copyright © 2013-2018 Teddy Hogeborn +# Copyright © 2013-2018 Björn Påhlsson # # This file is part of Mandos. # === modified file 'intro.xml' --- intro.xml 2017-02-23 19:11:11 +0000 +++ intro.xml 2018-02-08 10:23:55 +0000 @@ -1,7 +1,7 @@ + %common; ]> @@ -37,6 +37,7 @@ 2015 2016 2017 + 2018 Teddy Hogeborn Björn Påhlsson === modified file 'mandos' --- mandos 2017-08-20 19:12:58 +0000 +++ mandos 2018-02-09 21:48:47 +0000 @@ -11,8 +11,8 @@ # "AvahiService" class, and some lines in "main". # # Everything else is -# Copyright © 2008-2017 Teddy Hogeborn -# Copyright © 2008-2017 Björn Påhlsson +# Copyright © 2008-2018 Teddy Hogeborn +# Copyright © 2008-2018 Björn Påhlsson # # This file is part of Mandos. # @@ -496,7 +496,7 @@ class AvahiServiceToSyslog(AvahiService): def rename(self, *args, **kwargs): """Add the new name to the syslog messages""" - ret = AvahiService.rename(self, *args, **kwargs) + ret = super(AvahiServiceToSyslog, self).rename(*args, **kwargs) syslogger.setFormatter(logging.Formatter( 'Mandos ({}) [%(process)d]: %(levelname)s: %(message)s' .format(self.name))) @@ -2578,7 +2578,7 @@ command = request[0] if command == 'init': - fpr = request[1] + fpr = request[1].decode("ascii") address = request[2] for c in self.clients.values(): === modified file 'mandos-clients.conf.xml' --- mandos-clients.conf.xml 2017-02-23 19:11:11 +0000 +++ mandos-clients.conf.xml 2018-02-08 10:23:55 +0000 @@ -3,7 +3,7 @@ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ /etc/mandos/clients.conf"> - + %common; ]> @@ -42,6 +42,7 @@ 2015 2016 2017 + 2018 Teddy Hogeborn Björn Påhlsson === modified file 'mandos-ctl' --- mandos-ctl 2017-08-20 19:12:58 +0000 +++ mandos-ctl 2018-02-08 10:23:55 +0000 @@ -3,8 +3,8 @@ # # Mandos Monitor - Control and monitor the Mandos server # -# Copyright © 2008-2017 Teddy Hogeborn -# Copyright © 2008-2017 Björn Påhlsson +# Copyright © 2008-2018 Teddy Hogeborn +# Copyright © 2008-2018 Björn Påhlsson # # This file is part of Mandos. # === modified file 'mandos-ctl.xml' --- mandos-ctl.xml 2017-02-23 19:11:11 +0000 +++ mandos-ctl.xml 2018-02-08 10:23:55 +0000 @@ -2,7 +2,7 @@ - + %common; ]> @@ -39,6 +39,7 @@ 2015 2016 2017 + 2018 Teddy Hogeborn Björn Påhlsson === modified file 'mandos-keygen' --- mandos-keygen 2017-08-20 19:12:58 +0000 +++ mandos-keygen 2018-02-08 10:23:55 +0000 @@ -2,8 +2,8 @@ # # Mandos key generator - create a new OpenPGP key for a Mandos client # -# Copyright © 2008-2017 Teddy Hogeborn -# Copyright © 2008-2017 Björn Påhlsson +# Copyright © 2008-2018 Teddy Hogeborn +# Copyright © 2008-2018 Björn Påhlsson # # This file is part of Mandos. # === modified file 'mandos-keygen.xml' --- mandos-keygen.xml 2017-02-23 19:11:11 +0000 +++ mandos-keygen.xml 2018-02-08 10:23:55 +0000 @@ -2,7 +2,7 @@ - + %common; ]> @@ -41,6 +41,7 @@ 2015 2016 2017 + 2018 Teddy Hogeborn Björn Påhlsson === modified file 'mandos-monitor' --- mandos-monitor 2017-08-20 19:12:58 +0000 +++ mandos-monitor 2018-02-08 10:23:55 +0000 @@ -3,8 +3,8 @@ # # Mandos Monitor - Control and monitor the Mandos server # -# Copyright © 2009-2017 Teddy Hogeborn -# Copyright © 2009-2017 Björn Påhlsson +# Copyright © 2009-2018 Teddy Hogeborn +# Copyright © 2009-2018 Björn Påhlsson # # This file is part of Mandos. # === modified file 'mandos-monitor.xml' --- mandos-monitor.xml 2017-02-23 19:11:11 +0000 +++ mandos-monitor.xml 2018-02-08 10:23:55 +0000 @@ -2,7 +2,7 @@ - + %common; ]> @@ -39,6 +39,7 @@ 2015 2016 2017 + 2018 Teddy Hogeborn Björn Påhlsson === modified file 'mandos.conf.xml' --- mandos.conf.xml 2017-02-23 19:11:11 +0000 +++ mandos.conf.xml 2018-02-08 10:23:55 +0000 @@ -3,7 +3,7 @@ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ /etc/mandos/mandos.conf"> - + %common; ]> @@ -42,6 +42,7 @@ 2015 2016 2017 + 2018 Teddy Hogeborn Björn Påhlsson === modified file 'mandos.xml' --- mandos.xml 2017-02-23 19:11:11 +0000 +++ mandos.xml 2018-02-08 10:23:55 +0000 @@ -2,7 +2,7 @@ - + %common; ]> @@ -41,6 +41,7 @@ 2015 2016 2017 + 2018 Teddy Hogeborn Björn Påhlsson === modified file 'network-hooks.d/bridge' --- network-hooks.d/bridge 2017-08-20 14:08:59 +0000 +++ network-hooks.d/bridge 2018-02-08 10:23:55 +0000 @@ -6,8 +6,8 @@ # configuration file(s) should be copied into the # /etc/mandos/network-hooks.d directory. # -# Copyright © 2012 Teddy Hogeborn -# Copyright © 2012 Björn Påhlsson +# Copyright © 2012-2018 Teddy Hogeborn +# Copyright © 2012-2018 Björn Påhlsson # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright === modified file 'network-hooks.d/openvpn' --- network-hooks.d/openvpn 2012-06-13 22:06:57 +0000 +++ network-hooks.d/openvpn 2018-02-08 10:23:55 +0000 @@ -6,8 +6,8 @@ # configuration file(s) should be copied into the # /etc/mandos/network-hooks.d directory. # -# Copyright © 2012 Teddy Hogeborn -# Copyright © 2012 Björn Påhlsson +# Copyright © 2012-2018 Teddy Hogeborn +# Copyright © 2012-2018 Björn Påhlsson # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright === modified file 'network-hooks.d/wireless' --- network-hooks.d/wireless 2012-06-13 22:06:57 +0000 +++ network-hooks.d/wireless 2018-02-08 10:23:55 +0000 @@ -6,8 +6,8 @@ # configuration file(s) should be copied into the # /etc/mandos/network-hooks.d directory. # -# Copyright © 2012 Teddy Hogeborn -# Copyright © 2012 Björn Påhlsson +# Copyright © 2012-2018 Teddy Hogeborn +# Copyright © 2012-2018 Björn Påhlsson # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright === modified file 'plugin-helpers/mandos-client-iprouteadddel.c' --- plugin-helpers/mandos-client-iprouteadddel.c 2017-08-20 16:20:54 +0000 +++ plugin-helpers/mandos-client-iprouteadddel.c 2018-02-08 10:23:55 +0000 @@ -2,8 +2,8 @@ /* * iprouteadddel - Add or delete direct route to a local IP address * - * Copyright © 2015-2017 Teddy Hogeborn - * Copyright © 2015-2017 Björn Påhlsson + * Copyright © 2015-2018 Teddy Hogeborn + * Copyright © 2015-2018 Björn Påhlsson * * This file is part of Mandos. * === modified file 'plugin-runner.c' --- plugin-runner.c 2017-08-20 16:20:54 +0000 +++ plugin-runner.c 2018-02-08 10:23:55 +0000 @@ -2,8 +2,8 @@ /* * Mandos plugin runner - Run Mandos plugins * - * Copyright © 2008-2017 Teddy Hogeborn - * Copyright © 2008-2017 Björn Påhlsson + * Copyright © 2008-2018 Teddy Hogeborn + * Copyright © 2008-2018 Björn Påhlsson * * This file is part of Mandos. * @@ -313,6 +313,7 @@ __attribute__((nonnull)) static void free_plugin(plugin *plugin_node){ + free(plugin_node->name); for(char **arg = plugin_node->argv; *arg != NULL; arg++){ free(*arg); } === modified file 'plugin-runner.xml' --- plugin-runner.xml 2017-02-23 19:11:11 +0000 +++ plugin-runner.xml 2018-02-08 10:23:55 +0000 @@ -2,7 +2,7 @@ - + %common; ]> @@ -41,6 +41,7 @@ 2015 2016 2017 + 2018 Teddy Hogeborn Björn Påhlsson === modified file 'plugins.d/askpass-fifo.c' --- plugins.d/askpass-fifo.c 2017-08-20 16:20:54 +0000 +++ plugins.d/askpass-fifo.c 2018-02-08 10:23:55 +0000 @@ -2,8 +2,8 @@ /* * Askpass-FIFO - Read a password from a FIFO and output it * - * Copyright © 2008-2017 Teddy Hogeborn - * Copyright © 2008-2017 Björn Påhlsson + * Copyright © 2008-2018 Teddy Hogeborn + * Copyright © 2008-2018 Björn Påhlsson * * This file is part of Mandos. * === modified file 'plugins.d/askpass-fifo.xml' --- plugins.d/askpass-fifo.xml 2017-02-23 19:11:11 +0000 +++ plugins.d/askpass-fifo.xml 2018-02-08 10:23:55 +0000 @@ -2,7 +2,7 @@ - + %common; ]> @@ -41,6 +41,7 @@ 2015 2016 2017 + 2018 Teddy Hogeborn Björn Påhlsson === modified file 'plugins.d/mandos-client.c' --- plugins.d/mandos-client.c 2017-08-20 16:20:54 +0000 +++ plugins.d/mandos-client.c 2018-02-08 10:23:55 +0000 @@ -9,8 +9,8 @@ * "browse_callback", and parts of "main". * * Everything else is - * Copyright © 2008-2017 Teddy Hogeborn - * Copyright © 2008-2017 Björn Påhlsson + * Copyright © 2008-2018 Teddy Hogeborn + * Copyright © 2008-2018 Björn Påhlsson * * This file is part of Mandos. * === modified file 'plugins.d/mandos-client.xml' --- plugins.d/mandos-client.xml 2017-02-23 19:11:11 +0000 +++ plugins.d/mandos-client.xml 2018-02-08 10:23:55 +0000 @@ -2,7 +2,7 @@ - + %common; ]> @@ -41,6 +41,7 @@ 2015 2016 2017 + 2018 Teddy Hogeborn Björn Påhlsson === modified file 'plugins.d/password-prompt.c' --- plugins.d/password-prompt.c 2017-08-20 16:20:54 +0000 +++ plugins.d/password-prompt.c 2018-02-08 10:23:55 +0000 @@ -2,8 +2,8 @@ /* * Password-prompt - Read a password from the terminal and print it * - * Copyright © 2008-2017 Teddy Hogeborn - * Copyright © 2008-2017 Björn Påhlsson + * Copyright © 2008-2018 Teddy Hogeborn + * Copyright © 2008-2018 Björn Påhlsson * * This file is part of Mandos. * === modified file 'plugins.d/password-prompt.xml' --- plugins.d/password-prompt.xml 2017-02-23 19:11:11 +0000 +++ plugins.d/password-prompt.xml 2018-02-08 10:23:55 +0000 @@ -2,7 +2,7 @@ - + %common; ]> @@ -41,6 +41,7 @@ 2015 2016 2017 + 2018 Teddy Hogeborn Björn Påhlsson === modified file 'plugins.d/plymouth.c' --- plugins.d/plymouth.c 2017-08-20 16:20:54 +0000 +++ plugins.d/plymouth.c 2018-02-08 10:23:55 +0000 @@ -2,8 +2,8 @@ /* * Plymouth - Read a password from Plymouth and output it * - * Copyright © 2010-2017 Teddy Hogeborn - * Copyright © 2010-2017 Björn Påhlsson + * Copyright © 2010-2018 Teddy Hogeborn + * Copyright © 2010-2018 Björn Påhlsson * * This file is part of Mandos. * @@ -57,9 +57,11 @@ sig_atomic_t interrupted_by_signal = 0; /* Used by Ubuntu 11.04 (Natty Narwahl) */ -const char plymouth_old_pid[] = "/dev/.initramfs/plymouth.pid"; +const char plymouth_old_old_pid[] = "/dev/.initramfs/plymouth.pid"; /* Used by Ubuntu 11.10 (Oneiric Ocelot) */ -const char plymouth_pid[] = "/run/initramfs/plymouth.pid"; +const char plymouth_old_pid[] = "/run/initramfs/plymouth.pid"; +/* Used by Debian 9 (stretch) */ +const char plymouth_pid[] = "/run/plymouth/pid"; const char plymouth_path[] = "/bin/plymouth"; const char plymouthd_path[] = "/sbin/plymouthd"; @@ -282,7 +284,18 @@ } /* Try the old pid file location */ if(proc_id == 0){ - pidfile = fopen(plymouth_pid, "r"); + pidfile = fopen(plymouth_old_pid, "r"); + if(pidfile != NULL){ + ret = fscanf(pidfile, "%" SCNuMAX, &proc_id); + if(ret != 1){ + proc_id = 0; + } + fclose(pidfile); + } + } + /* Try the old old pid file location */ + if(proc_id == 0){ + pidfile = fopen(plymouth_old_old_pid, "r"); if(pidfile != NULL){ ret = fscanf(pidfile, "%" SCNuMAX, &proc_id); if(ret != 1){ @@ -299,9 +312,14 @@ error_plus(0, errno, "scandir"); } if(ret > 0){ - ret = sscanf(direntries[0]->d_name, "%" SCNuMAX, &proc_id); - if(ret < 0){ - error_plus(0, errno, "sscanf"); + for(int i = ret-1; i >= 0; i--){ + if(proc_id == 0){ + ret = sscanf(direntries[i]->d_name, "%" SCNuMAX, &proc_id); + if(ret < 0){ + error_plus(0, errno, "sscanf"); + } + } + free(direntries[i]); } } /* scandir might preallocate for this variable (man page unclear). @@ -317,7 +335,7 @@ return 0; } -const char * const * getargv(pid_t pid){ +char **getargv(pid_t pid){ int cl_fd; char *cmdline_filename; ssize_t sret; @@ -384,7 +402,7 @@ return NULL; } argz_extract(cmdline, cmdline_len, argv); /* Create argv */ - return (const char * const *)argv; + return argv; } int main(__attribute__((unused))int argc, @@ -465,11 +483,10 @@ } kill_and_wait(plymouth_command_pid); - const char * const *plymouthd_argv; + char **plymouthd_argv = NULL; pid_t pid = get_pid(); if(pid == 0){ error_plus(0, 0, "plymouthd pid not found"); - plymouthd_argv = plymouthd_default_argv; } else { plymouthd_argv = getargv(pid); } @@ -478,10 +495,21 @@ { plymouth_path, "quit", NULL }, false, false); if(not bret){ + if(plymouthd_argv != NULL){ + free(*plymouthd_argv); + free(plymouthd_argv); + } exit(EXIT_FAILURE); } - bret = exec_and_wait(NULL, plymouthd_path, plymouthd_argv, + bret = exec_and_wait(NULL, plymouthd_path, + (plymouthd_argv != NULL) + ? (const char * const *)plymouthd_argv + : plymouthd_default_argv, false, true); + if(plymouthd_argv != NULL){ + free(*plymouthd_argv); + free(plymouthd_argv); + } if(not bret){ exit(EXIT_FAILURE); } === modified file 'plugins.d/plymouth.xml' --- plugins.d/plymouth.xml 2017-02-23 19:11:11 +0000 +++ plugins.d/plymouth.xml 2018-02-08 10:23:55 +0000 @@ -2,7 +2,7 @@ - + %common; ]> @@ -39,6 +39,7 @@ 2015 2016 2017 + 2018 Teddy Hogeborn Björn Påhlsson === modified file 'plugins.d/splashy.c' --- plugins.d/splashy.c 2017-08-20 16:20:54 +0000 +++ plugins.d/splashy.c 2018-02-08 10:23:55 +0000 @@ -2,8 +2,8 @@ /* * Splashy - Read a password from splashy and output it * - * Copyright © 2008-2017 Teddy Hogeborn - * Copyright © 2008-2017 Björn Påhlsson + * Copyright © 2008-2018 Teddy Hogeborn + * Copyright © 2008-2018 Björn Påhlsson * * This file is part of Mandos. * === modified file 'plugins.d/splashy.xml' --- plugins.d/splashy.xml 2017-02-23 19:11:11 +0000 +++ plugins.d/splashy.xml 2018-02-08 10:23:55 +0000 @@ -2,7 +2,7 @@ - + %common; ]> @@ -41,6 +41,7 @@ 2015 2016 2017 + 2018 Teddy Hogeborn Björn Påhlsson === modified file 'plugins.d/usplash.c' --- plugins.d/usplash.c 2017-08-20 16:20:54 +0000 +++ plugins.d/usplash.c 2018-02-08 10:23:55 +0000 @@ -2,8 +2,8 @@ /* * Usplash - Read a password from usplash and output it * - * Copyright © 2008-2017 Teddy Hogeborn - * Copyright © 2008-2017 Björn Påhlsson + * Copyright © 2008-2018 Teddy Hogeborn + * Copyright © 2008-2018 Björn Påhlsson * * This file is part of Mandos. * === modified file 'plugins.d/usplash.xml' --- plugins.d/usplash.xml 2017-02-23 19:11:11 +0000 +++ plugins.d/usplash.xml 2018-02-08 10:23:55 +0000 @@ -2,7 +2,7 @@ - + %common; ]> @@ -41,6 +41,7 @@ 2015 2016 2017 + 2018 Teddy Hogeborn Björn Påhlsson