=== modified file 'Makefile' --- Makefile 2019-08-05 21:24:02 +0000 +++ Makefile 2019-08-18 00:42:22 +0000 @@ -89,6 +89,8 @@ --variable=systemdsystemunitdir) TMPFILES:=$(DESTDIR)$(shell $(PKG_CONFIG) systemd \ --variable=tmpfilesdir) +SYSUSERS:=$(DESTDIR)$(shell $(PKG_CONFIG) systemd \ + --variable=sysusersdir) GNUTLS_CFLAGS:=$(shell $(PKG_CONFIG) --cflags-only-I gnutls) GNUTLS_LIBS:=$(shell $(PKG_CONFIG) --libs gnutls) @@ -390,6 +392,11 @@ install --mode=u=rw,go=r tmpfiles.d-mandos.conf \ $(TMPFILES)/mandos.conf; \ fi + if [ "$(SYSUSERS)" != "$(DESTDIR)" \ + -a -d "$(SYSUSERS)" ]; then \ + install --mode=u=rw,go=r sysusers.d-mandos.conf \ + $(SYSUSERS)/mandos.conf; \ + fi install --mode=u=rwx,go=rx mandos $(PREFIX)/sbin/mandos install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \ mandos-ctl @@ -429,6 +436,11 @@ install --directory --mode=u=rwx $(KEYDIR) \ $(LIBDIR)/mandos/plugins.d \ $(LIBDIR)/mandos/plugin-helpers + if [ "$(SYSUSERS)" != "$(DESTDIR)" \ + -a -d "$(SYSUSERS)" ]; then \ + install --mode=u=rw,go=r sysusers.d-mandos.conf \ + $(SYSUSERS)/mandos-client.conf; \ + fi if [ "$(CONFDIR)" != "$(LIBDIR)/mandos" ]; then \ install --mode=u=rwx \ --directory "$(CONFDIR)/plugins.d" \ === modified file 'debian/mandos-client.dirs' --- debian/mandos-client.dirs 2019-04-09 19:33:36 +0000 +++ debian/mandos-client.dirs 2019-08-18 04:14:31 +0000 @@ -5,3 +5,4 @@ usr/share/initramfs-tools/conf-hooks.d usr/share/initramfs-tools/scripts/init-premount usr/share/initramfs-tools/scripts/local-premount +usr/lib/sysusers.d === modified file 'debian/mandos.dirs' --- debian/mandos.dirs 2016-03-19 12:10:15 +0000 +++ debian/mandos.dirs 2019-08-18 00:23:21 +0000 @@ -7,3 +7,4 @@ var/lib/mandos lib/systemd/system usr/lib/tmpfiles.d +usr/lib/sysusers.d === modified file 'debian/mandos.postinst' --- debian/mandos.postinst 2019-08-02 22:16:53 +0000 +++ debian/mandos.postinst 2019-08-18 00:05:36 +0000 @@ -27,6 +27,11 @@ *:Mandos\ password\ system,,,:/nonexistent:/bin/false) usermod --login _mandos mandos groupmod --new-name _mandos mandos + # Reload D-Bus daemon to be aware of the _mandos + # user & group + if [ -x /etc/init.d/dbus ]; then + invoke-rc.d dbus force-reload || : + fi ;; esac fi @@ -36,6 +41,11 @@ --home /nonexistent --no-create-home --group \ --disabled-password --gecos "Mandos password system" \ _mandos + # Reload D-Bus daemon to be aware of the _mandos user & + # group + if [ -x /etc/init.d/dbus ]; then + invoke-rc.d dbus force-reload || : + fi elif dpkg --compare-versions "$2" eq 1.7.4-1 \ || dpkg --compare-versions "$2" eq "1.7.4-1~bpo8+1" then @@ -50,10 +60,6 @@ invoke-rc.d mandos start fi fi - # Reload D-Bus daemon to be aware of the _mandos user & group - if [ -x /etc/init.d/dbus ]; then - invoke-rc.d dbus force-reload || : - fi if ! dpkg-statoverride --list "/var/lib/mandos" >/dev/null \ 2>&1; then chown _mandos:_mandos /var/lib/mandos === added file 'debian/po/de.po' --- debian/po/de.po 1970-01-01 00:00:00 +0000 +++ debian/po/de.po 2019-08-16 19:28:16 +0000 @@ -0,0 +1,155 @@ +# German debconf translation of mandos. +# This file is distributed under the same license as the mandos package. +# Copyright (C) 2008-2019 Teddy Hogeborn and Björn Påhlsson +# Copyright (C) of this file 2019 Chris Leick . +# +msgid "" +msgstr "" +"Project-Id-Version: mandos 1.8.7-1\n" +"Report-Msgid-Bugs-To: mandos@packages.debian.org\n" +"POT-Creation-Date: 2019-08-05 22:57+0200\n" +"PO-Revision-Date: 2019-08-10 12:06+0100\n" +"Last-Translator: Chris Leick \n" +"Language-Team: German \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "New client option \"key_id\" is REQUIRED on server" +msgstr "Auf diesem Server ist die Client-Option »key_id« ERFORDERLICH" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "" +"A new \"key_id\" client option is REQUIRED in the clients.conf file, " +"otherwise the client most likely will not reboot unattended. This option:" +msgstr "" +"In der Datei clients.conf ist eine neue Client-Option »key_id« ERFORDERLICH, " +"andernfalls werden die Clients höchstwahrscheinlich nicht unbeaufsichtigt neu " +"starten. Die Option" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid " key_id = " +msgstr " key_id = " + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "" +"must be added in the file /etc/mandos/clients.conf, right before the " +"\"fingerprint\" option, for each Mandos client. You must edit that file and " +"add this option for all clients. To see the correct key ID for each client, " +"run this command (on each client):" +msgstr "" +"muss der Datei /etc/mandos/clients.conf kurz vor der Option »fingerprint« " +"auf jedem Mandos-Client hinzugefügt werden. Sie müssen diese Datei bearbeiten " +"und diese Option auf allen Clients hinzufügen. Um die korrekte " +"Schlüsselkennung für jeden Client anzusehen, führen Sie (auf jedem Client) " +"diesen Befehl aus:" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid " mandos-keygen -F/dev/null|grep ^key_id" +msgstr " mandos-keygen -F/dev/null|grep ^key_id" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "" +"Note: the clients must all also be using GnuTLS 3.6.6 or later; the server " +"cannot serve passwords for both old and new clients!" +msgstr "" +"Hinweis: Die Clients müssen außerdem alle GnuTLS 3.6.6 oder neuer nutzen; der " +"Server kann keine Passwörter für sowohl alte als auch neue Clients anbieten!" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "" +"Rationale: With GnuTLS 3.6.6, Mandos has been forced to stop using OpenPGP " +"keys as TLS session keys. A new TLS key pair will be generated on each " +"client and will be used as identification, but the key ID of the public key " +"needs to be added to this server, since this will now be used to identify " +"the client to the server." +msgstr "" +"Begründung: Mit GnuTLS 3.6.6 wurde erzwungen, dass Mandos die Benutzung von " +"OpenPGP als TLS-Sitzungsschlüssel stoppt. Auf jedem Client wird ein neues " +"TLS-Schlüsselpaar erzeugt und zur Identifizierung benutzt, aber der " +"öffentliche Schlüssel muss auf diesem Server hinzugefügt werden, da dies nun " +"zur Identifizierung des Clients auf dem Server verwendet wird." + +#. Type: note +#. Description +#: ../mandos.templates:2001 +msgid "Bad key IDs have been removed from clients.conf" +msgstr "Falsche Schlüsselkennungen wurden aus der clients.conf entfernt." + +#. Type: note +#. Description +#: ../mandos.templates:2001 +msgid "" +"Bad key IDs, which were created by a bug in Mandos client 1.8.0, have been " +"removed from /etc/mandos/clients.conf" +msgstr "" +"Falsche Schlüsselkennungen, die durch einen Fehler im Mandos-Client 1.8.0 " +"erzeugt wurden, wurden aus /etc/mandos/clients.conf entfernt." + +#. Type: note +#. description +#: ../mandos-client.templates:1001 +msgid "New client option \"${key_id}\" is REQUIRED on server" +msgstr "Auf dem Server ist die neue Client-Option »${key_id}« ERFORDERLICH." + +#. Type: note +#. description +#: ../mandos-client.templates:1001 +msgid "" +"A new \"key_id\" client option is REQUIRED in the server's clients.conf " +"file, otherwise this computer most likely will not reboot unattended. This " +"option:" +msgstr "" +"In der Datei clients.conf des Servers ist eine neue Client-Option »key_id« " +"ERFORDERLICH, andernfalls wird dieser Rechner höchstwahrscheinlich nicht " +"unbeaufsichtigt neu starten. Die Option " + +#. Type: note +#. description +#: ../mandos-client.templates:1001 +msgid " ${key_id}" +msgstr " ${key_id}" + +#. Type: note +#. description +#: ../mandos-client.templates:1001 +msgid "" +"must be added (all on one line!) on the Mandos server host, in the file /etc/" +"mandos/clients.conf, right before the \"fingerprint\" option for this Mandos " +"client. You must edit that file on that server and add this option." +msgstr "" +"muss (in einer einzigen Zeile!) der Datei /etc/mandos/clients.conf auf dem " +"Mandos-Server kurz vor der Option »fingerprint« für diesen Mandos-Client " +"hinzugefügt werden. Sie müssen diese Datei auf diesem Server bearbeiten und " +"diese Option hinzufügen." + +#. Type: note +#. description +#: ../mandos-client.templates:1001 +msgid "" +"With GnuTLS 3.6.6, Mandos has been forced to stop using OpenPGP keys as TLS " +"session keys. A new TLS key pair has been generated and will be used as " +"identification, but the key ID of the public key needs to be added to the " +"server, since this will now be used to identify the client to the server." +msgstr "" +"Mit GnuTLS 3.6.6 wurde erzwungen, dass Mandos die Benutzung von OpenPGP als " +"TLS-Sitzungsschlüssel stoppt. Ein neues TLS-Schlüsselpaar wurde erzeugt und " +"wird zur Identifizierung benutzt, aber die Schlüsselkennung des öffentlichen " +"Schlüssels muss auf diesem Server hinzugefügt werden, da dies nun " +"zur Identifizierung des Clients auf dem Server verwendet wird." === added file 'debian/po/fr.po' --- debian/po/fr.po 1970-01-01 00:00:00 +0000 +++ debian/po/fr.po 2019-08-16 19:32:47 +0000 @@ -0,0 +1,156 @@ +# Translation of mandos debconf templates to French +# Copyright (C) 2019, French l10n team +# This file is distributed under the same license as the mandos package. +# Grégoire Scano , 2019. +msgid "" +msgstr "" +"Project-Id-Version: mandos\n" +"Report-Msgid-Bugs-To: mandos@packages.debian.org\n" +"POT-Creation-Date: 2019-07-27 21:06+0200\n" +"PO-Revision-Date: 2019-08-11 15:58+0800\n" +"Last-Translator: Grégoire Scano \n" +"Language-Team: French \n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "New client option \"key_id\" is REQUIRED on server" +msgstr "La nouvelle option de client « key_id » est NÉCESSAIRE sur le serveur" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "" +"A new \"key_id\" client option is REQUIRED in the clients.conf file, " +"otherwise the client most likely will not reboot unattended. This option:" +msgstr "" +"Une nouvelle option de client « key_id » est NÉCESSAIRE dans le fichier " +"clients.conf, autrement le client ne redémarrera probablement pas de lui-" +"même. Cette option :" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "key_id = " +msgstr "key_id = " + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "" +"must be added in the file /etc/mandos/clients.conf, right before the " +"\"fingerprint\" option, for each Mandos client. You must edit that file and " +"add this option for all clients. To see the correct key ID for each client, " +"run this command (on each client):" +msgstr "" +"doit être ajoutée dans le fichier /etc/mandos/clients.conf, juste avant " +"l'option « fingerprint », pour chaque client Mandos. Vous devez éditer ce " +"fichier et ajouter cette option pour tous les clients. Pour voir " +"l'identifiant de clef correct pour chaque client, exécutez la commande (sur " +"chaque client) :" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "mandos-keygen -F/dev/null|grep ^key_id" +msgstr "mandos-keygen -F/dev/null|grep ^key_id" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "" +"Note: the clients must all also be using GnuTLS 3.6.6 or later; the server " +"cannot serve passwords for both old and new clients!" +msgstr "" +"Note : les clients doivent également tous utiliser GnuTLS 3.6.6 ou " +"ultérieur ; le serveur ne peut pas servir des mots de passe pour des clients " +"anciens et récents en même temps !" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "" +"Rationale: With GnuTLS 3.6.6, Mandos has been forced to stop using OpenPGP " +"keys as TLS session keys. A new TLS key pair will be generated on each " +"client and will be used as identification, but the key ID of the public key " +"needs to be added to this server, since this will now be used to identify " +"the client to the server." +msgstr "" +"Explication : avec GnuTLS 3.6.6, Mandos a été contraint d'arrêter d'utiliser " +"des clefs OpenPGP comme clefs de session TLS. Une nouvelle paire de clefs " +"TLS sera générée pour chaque client et sera utilisée pour l'identification, " +"mais l'identifiant de la clef publique doit être ajouté à ce serveur, " +"puisqu'il sera utilisé pour identifier le client auprès du serveur." + +#. Type: note +#. Description +#: ../mandos.templates:2001 +msgid "Bad key IDs have been removed from clients.conf" +msgstr "Les identifiants de clef incorrects ont été supprimés de clients.conf" + +#. Type: note +#. Description +#: ../mandos.templates:2001 +msgid "" +"Bad key IDs, which were created by a bug in Mandos client 1.8.0, have been " +"removed from /etc/mandos/clients.conf" +msgstr "" +"Les identifiants de clef incorrects, créés par un bogue dans le client " +"Mandos 1.8.0, ont été supprimés de /etc/mandos/clients.conf" + +#. Type: note +#. description +#: ../mandos-client.templates:1001 +msgid "New client option \"${key_id}\" is REQUIRED on server" +msgstr "" +"La nouvelle option de client « ${key_id} » est NÉCESSAIRE sur le serveur" + +#. Type: note +#. description +#: ../mandos-client.templates:1001 +msgid "" +"A new \"key_id\" client option is REQUIRED in the server's clients.conf " +"file, otherwise this computer most likely will not reboot unattended. This " +"option:" +msgstr "" +"Une nouvelle option de client « key_id » est NÉCESSAIRE dans le fichier " +"clients.conf du serveur, autrement cette machine ne pourra pas redémarrer " +"d'elle-même. Cette option :" + +#. Type: note +#. description +#: ../mandos-client.templates:1001 +msgid "${key_id}" +msgstr "${key_id}" + +#. Type: note +#. description +#: ../mandos-client.templates:1001 +msgid "" +"must be added (all on one line!) on the Mandos server host, in the file /etc/" +"mandos/clients.conf, right before the \"fingerprint\" option for this Mandos " +"client. You must edit that file on that server and add this option." +msgstr "" +"doit être ajoutée (tout sur une seule ligne !) sur le serveur Mandos hôte, " +"dans le fichier /etc/mandos/clients.conf, juste avant l'option " +"« fingerprint » de ce client Mandos. Vous devez éditer ce fichier sur ce " +"serveur et ajouter cette option." + +#. Type: note +#. description +#: ../mandos-client.templates:1001 +msgid "" +"With GnuTLS 3.6.6, Mandos has been forced to stop using OpenPGP keys as TLS " +"session keys. A new TLS key pair has been generated and will be used as " +"identification, but the key ID of the public key needs to be added to the " +"server, since this will now be used to identify the client to the server." +msgstr "" +"Avec GnuTLS 3.6.6, Mandos a été contraint d'arrêter d'utiliser des clefs " +"OpenPGP comme clefs de session TLS. Une nouvelle paire de clefs TLS a été " +"générée et sera utilisée pour l'identification, mais l'identifiant de la " +"clef publique doit être ajouté au serveur, puisqu'il sera utilisé pour " +"identifier le client auprès du serveur." === added file 'debian/po/sv.po' --- debian/po/sv.po 1970-01-01 00:00:00 +0000 +++ debian/po/sv.po 2019-08-16 20:47:52 +0000 @@ -0,0 +1,156 @@ +# Translation of mandos debconf templates to Swedish +# Copyright (C) 2019, Mandos Maintainers +# This file is distributed under the same license as the mandos package. +# Teddy Hogeborn , 2019. +# +msgid "" +msgstr "" +"Project-Id-Version: mandos\n" +"Report-Msgid-Bugs-To: mandos@packages.debian.org\n" +"POT-Creation-Date: 2019-08-05 22:57+0200\n" +"PO-Revision-Date: 2019-08-16 22:45+0200\n" +"Last-Translator: Teddy Hogeborn \n" +"Language-Team: Swedish \n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "New client option \"key_id\" is REQUIRED on server" +msgstr "Ny klientinställning ”key_id” KRÄVS på servern" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "" +"A new \"key_id\" client option is REQUIRED in the clients.conf file, " +"otherwise the client most likely will not reboot unattended. This option:" +msgstr "" +"En ny klientinställning, ”key_id”, KRÄVS i filen clients.conf, annars\n" +"kommer klienten antagligen inte att starta upp av sig själv. Denna\n" +"inställning:" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid " key_id = " +msgstr " key_id = " + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "" +"must be added in the file /etc/mandos/clients.conf, right before the " +"\"fingerprint\" option, for each Mandos client. You must edit that file and " +"add this option for all clients. To see the correct key ID for each client, " +"run this command (on each client):" +msgstr "" +"måste läggas till i filen /etc/mandos/clients.conf, precis ovanför\n" +"inställningen ”fingerprint”, för varje Mandosklient. Du måste ändra i\n" +"den filen och lägga till den inställningen för alla klienter. För att\n" +"se det korrekta nyckel-IDt för varje klient, kör följande kommando (på\n" +"varje klient):" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid " mandos-keygen -F/dev/null|grep ^key_id" +msgstr " mandos-keygen -F/dev/null|grep ^key_id" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "" +"Note: the clients must all also be using GnuTLS 3.6.6 or later; the server " +"cannot serve passwords for both old and new clients!" +msgstr "" +"Observera: Alla klienter måste också använda GnuTLS 3.6.6 eller nyare;\n" +"servern kan inte ge lösenord till både nya och gamla klienter!" + +#. Type: note +#. Description +#: ../mandos.templates:1001 +msgid "" +"Rationale: With GnuTLS 3.6.6, Mandos has been forced to stop using OpenPGP " +"keys as TLS session keys. A new TLS key pair will be generated on each " +"client and will be used as identification, but the key ID of the public key " +"needs to be added to this server, since this will now be used to identify " +"the client to the server." +msgstr "" +"Förklaring: Med GnuTLS 3.6.6 så har Mandos nödgats att sluta använda\n" +"OpenPGP-nycklar som TLS-sessionsnycklar. Ett nytt TLS-nyckelpar\n" +"kommer att genereras på varje klient och kommer att användas för\n" +"identifiering, men nyckel-IDt för den publika nyckeln måste läggas\n" +"till på denna server, då denna numera kommer att användas för att\n" +"identifiera klienten för servern." + +#. Type: note +#. Description +#: ../mandos.templates:2001 +msgid "Bad key IDs have been removed from clients.conf" +msgstr "Dåliga nyckel-IDn har tagits bort från clients.conf" + +#. Type: note +#. Description +#: ../mandos.templates:2001 +msgid "" +"Bad key IDs, which were created by a bug in Mandos client 1.8.0, have been " +"removed from /etc/mandos/clients.conf" +msgstr "" +"Dåliga nyckel-IDn, som skapats av en bugg i Mandosklienten 1.8.0, har\n" +"tagits bort från /etc/mandos/clients.conf" + +#. Type: note +#. description +#: ../mandos-client.templates:1001 +msgid "New client option \"${key_id}\" is REQUIRED on server" +msgstr "Ny klientinställning ”${key_id}” KRÄVS på servern" + +#. Type: note +#. description +#: ../mandos-client.templates:1001 +msgid "" +"A new \"key_id\" client option is REQUIRED in the server's clients.conf " +"file, otherwise this computer most likely will not reboot unattended. This " +"option:" +msgstr "" +"En ny klientinställning, ”key_id”, KRÄVS i serverns clients.conf-fil,\n" +"annars kommer denna dator antagligen inte att starta upp av sig själv.\n" +"Denna inställning:" + +#. Type: note +#. description +#: ../mandos-client.templates:1001 +msgid " ${key_id}" +msgstr " ${key_id}" + +#. Type: note +#. description +#: ../mandos-client.templates:1001 +msgid "" +"must be added (all on one line!) on the Mandos server host, in the file /etc/" +"mandos/clients.conf, right before the \"fingerprint\" option for this Mandos " +"client. You must edit that file on that server and add this option." +msgstr "" +"måste läggas till (allt på en rad!) på Mandosservervärddatorn, i filen\n" +"/etc/mandos/clients.conf, precis ovanför inställningen ”fingerprint”,\n" +"för denna Mandosklient. Du måste ändra i den filen och lägga till den\n" +"inställningen." + +#. Type: note +#. description +#: ../mandos-client.templates:1001 +msgid "" +"With GnuTLS 3.6.6, Mandos has been forced to stop using OpenPGP keys as TLS " +"session keys. A new TLS key pair has been generated and will be used as " +"identification, but the key ID of the public key needs to be added to the " +"server, since this will now be used to identify the client to the server." +msgstr "" +"Med GnuTLS 3.6.6 så har Mandos nödgats att sluta använda\n" +"OpenPGP-nycklar som TLS-sessionsnycklar. Ett nytt TLS-nyckelpar har\n" +"genererats och kommer att användas för identifiering, men nyckel-IDt\n" +"för den publika nyckeln måste läggas till på servern, då detta numera\n" +"kommer att användas för att identifiera klienten för servern." === modified file 'mandos' --- mandos 2019-08-05 21:24:02 +0000 +++ mandos 2019-08-10 15:19:47 +0000 @@ -88,6 +88,9 @@ import xml.dom.minidom import inspect +if sys.version_info.major == 2: + __metaclass__ = type + # Try to find the value of SO_BINDTODEVICE: try: # This is where SO_BINDTODEVICE is in Python 3.3 (or 3.4?) and @@ -183,7 +186,7 @@ pass -class PGPEngine(object): +class PGPEngine: """A simple class for OpenPGP symmetric encryption & decryption""" def __init__(self): @@ -279,7 +282,7 @@ # Pretend that we have an Avahi module -class avahi(object): +class avahi: """This isn't so much a class as it is a module-like namespace.""" IF_UNSPEC = -1 # avahi-common/address.h PROTO_UNSPEC = -1 # avahi-common/address.h @@ -319,7 +322,7 @@ pass -class AvahiService(object): +class AvahiService: """An Avahi (Zeroconf) service. Attributes: @@ -507,7 +510,7 @@ # Pretend that we have a GnuTLS module -class gnutls(object): +class gnutls: """This isn't so much a class as it is a module-like namespace.""" library = ctypes.util.find_library("gnutls") @@ -576,7 +579,7 @@ pass # Classes - class Credentials(object): + class Credentials: def __init__(self): self._c_object = gnutls.certificate_credentials_t() gnutls.certificate_allocate_credentials( @@ -586,7 +589,7 @@ def __del__(self): gnutls.certificate_free_credentials(self._c_object) - class ClientSession(object): + class ClientSession: def __init__(self, socket, credentials=None): self._c_object = gnutls.session_t() gnutls_flags = gnutls.CLIENT @@ -818,7 +821,7 @@ connection.close() -class Client(object): +class Client: """A representation of a client host served by this server. Attributes: @@ -2213,7 +2216,7 @@ del _interface -class ProxyClient(object): +class ProxyClient: def __init__(self, child_pipe, key_id, fpr, address): self._pipe = child_pipe self._pipe.send(('init', key_id, fpr, address)) @@ -2492,7 +2495,7 @@ return hex_fpr -class MultiprocessingMixIn(object): +class MultiprocessingMixIn: """Like socketserver.ThreadingMixIn, but with multiprocessing""" def sub_process_main(self, request, address): @@ -2510,7 +2513,7 @@ return proc -class MultiprocessingMixInWithPipe(MultiprocessingMixIn, object): +class MultiprocessingMixInWithPipe(MultiprocessingMixIn): """ adds a pipe to the MixIn """ def process_request(self, request, client_address): @@ -2531,7 +2534,7 @@ class IPv6_TCPServer(MultiprocessingMixInWithPipe, - socketserver.TCPServer, object): + socketserver.TCPServer): """IPv6-capable TCP server. Accepts 'None' as address and/or port Attributes: === modified file 'mandos-ctl' --- mandos-ctl 2019-08-05 21:24:02 +0000 +++ mandos-ctl 2019-08-10 15:19:47 +0000 @@ -46,6 +46,9 @@ import tempfile import contextlib +if sys.version_info.major == 2: + __metaclass__ = type + try: import pydbus import gi @@ -53,10 +56,10 @@ except ImportError: import dbus as dbus_python pydbus = None - class gi(object): + class gi: """Dummy gi module, for the tests""" - class repository(object): - class GLib(object): + class repository: + class GLib: class Error(Exception): pass @@ -467,9 +470,9 @@ parser.error("--remove can only be combined with --deny") -class dbus(object): +class dbus: - class SystemBus(object): + class SystemBus: object_manager_iface = "org.freedesktop.DBus.ObjectManager" def get_managed_objects(self, busname, objectpath): @@ -521,7 +524,7 @@ pass -class dbus_python_adapter(object): +class dbus_python_adapter: class SystemBus(dbus.MandosBus): """Use dbus-python""" @@ -581,7 +584,7 @@ self.client_interface, key, value) - class SilenceLogger(object): + class SilenceLogger: "Simple context manager to silence a particular logger" def __init__(self, loggername): self.logger = logging.getLogger(loggername) @@ -616,7 +619,7 @@ return new_object -class pydbus_adapter(object): +class pydbus_adapter: class SystemBus(dbus.MandosBus): def __init__(self, module=pydbus): self.pydbus = module @@ -712,10 +715,10 @@ return commands -class command(object): +class command: """A namespace for command classes""" - class Base(object): + class Base: """Abstract base class for commands""" def run(self, clients, bus=None): """Normal commands should implement run_on_one_client(), @@ -784,7 +787,7 @@ keywords = self.all_keywords print(self.TableOfClients(clients.values(), keywords)) - class TableOfClients(object): + class TableOfClients: tableheaders = { "Name": "Name", "Enabled": "Enabled", @@ -1021,7 +1024,7 @@ "output")) -class Unique(object): +class Unique: """Class for objects which exist only to be unique objects, since unittest.mock.sentinel only exists in Python 3.3""" @@ -1311,13 +1314,13 @@ class Test_dbus_python_adapter_SystemBus(TestCaseWithAssertLogs): def MockDBusPython_func(self, func): - class mock_dbus_python(object): + class mock_dbus_python: """mock dbus-python module""" - class exceptions(object): + class exceptions: """Pseudo-namespace""" class DBusException(Exception): pass - class SystemBus(object): + class SystemBus: @staticmethod def get_object(busname, objectpath): DBusObject = collections.namedtuple( @@ -1337,7 +1340,7 @@ dbus_interface=dbus_interface) return DBusObject(methodname=method, Set=set_property) - class Boolean(object): + class Boolean: def __init__(self, value): self.value = bool(value) def __bool__(self): @@ -1555,9 +1558,9 @@ self.call_method(bus, "methodname", "busname", "objectpath", "interface") - class fake_dbus_python_raises_exception_on_connect(object): + class fake_dbus_python_raises_exception_on_connect: """fake dbus-python module""" - class exceptions(object): + class exceptions: """Pseudo-namespace""" class DBusException(Exception): pass @@ -1571,9 +1574,9 @@ class Test_dbus_python_adapter_CachingBus(unittest.TestCase): - class mock_dbus_python(object): + class mock_dbus_python: """mock dbus-python modules""" - class SystemBus(object): + class SystemBus: @staticmethod def get_object(busname, objectpath): return Unique() @@ -1625,9 +1628,9 @@ class Test_pydbus_adapter_SystemBus(TestCaseWithAssertLogs): def Stub_pydbus_func(self, func): - class stub_pydbus(object): + class stub_pydbus: """stub pydbus module""" - class SystemBus(object): + class SystemBus: @staticmethod def get(busname, objectpath): DBusObject = collections.namedtuple( @@ -1679,7 +1682,7 @@ self.call_method(bus, "methodname", "busname", "objectpath", "interface") - class fake_pydbus_raises_exception_on_connect(object): + class fake_pydbus_raises_exception_on_connect: """fake dbus-python module""" @classmethod def SystemBus(cls): @@ -1689,11 +1692,11 @@ return Bus(get=get) def test_set_property_uses_setattr(self): - class Object(object): + class Object: pass obj = Object() - class pydbus_spy(object): - class SystemBus(object): + class pydbus_spy: + class SystemBus: @staticmethod def get(busname, objectpath): return {"interface": obj} @@ -1706,8 +1709,8 @@ def test_get_suppresses_xml_deprecation_warning(self): if sys.version_info.major >= 3: return - class stub_pydbus_get(object): - class SystemBus(object): + class stub_pydbus_get: + class SystemBus: @staticmethod def get(busname, objectpath): warnings.warn_explicit( @@ -1721,9 +1724,9 @@ class Test_pydbus_adapter_CachingBus(unittest.TestCase): - class stub_pydbus(object): + class stub_pydbus: """stub pydbus module""" - class SystemBus(object): + class SystemBus: @staticmethod def get(busname, objectpath): return Unique() === added file 'sysusers.d-mandos.conf' --- sysusers.d-mandos.conf 1970-01-01 00:00:00 +0000 +++ sysusers.d-mandos.conf 2019-08-18 00:42:22 +0000 @@ -0,0 +1,3 @@ +# This file will be installed as mandos.conf and/or mandos-client.conf +# in the /usr/lib/sysusers.d directory. See sysusers.d(5) +u _mandos - "Mandos password system"