=== modified file 'Makefile' --- Makefile 2011-10-09 17:36:01 +0000 +++ Makefile 2011-10-11 19:36:00 +0000 @@ -65,7 +65,9 @@ --param man.authors.section.enabled 0 \ /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl \ $(notdir $<); \ - $(MANPOST) $(notdir $@)) + $(MANPOST) $(notdir $@);\ + LANG=en_US.UTF-8 MANWIDTH=80 man --warnings --encoding=UTF-8 \ + --local-file $(notdir $@) >/dev/null) # DocBook-to-man post-processing to fix a '\n' escape bug MANPOST=$(SED) --in-place --expression='s,\\\\en,\\en,g;s,\\n,\\en,g' === modified file 'TODO' --- TODO 2011-10-09 15:21:16 +0000 +++ TODO 2011-10-14 18:00:50 +0000 @@ -66,6 +66,7 @@ ** TODO [#C] python-parsedatetime ** TODO [#C] systemd/launchd http://0pointer.de/blog/projects/systemd.html + http://wiki.debian.org/systemd ** TODO Separate logging logic to own object ** TODO make clients to a dict! ** TODO [#A] Limit approval_delay to max gnutls/tls timeout value @@ -81,6 +82,7 @@ *** Handle "no D-Bus server" and/or "no Mandos server found" better *** [#B] --dump option ** TODO Support RFC 3339 time duration syntax +** TODO Send milliseconds if bare integer is passed as time duration * TODO mandos-dispatch Listens for specified D-Bus signals and spawns shell commands with === modified file 'debian/control' --- debian/control 2011-10-05 17:03:36 +0000 +++ debian/control 2011-10-11 19:36:00 +0000 @@ -6,7 +6,7 @@ Björn Påhlsson Build-Depends: debhelper (>= 7), docbook-xml, docbook-xsl, libavahi-core-dev, libgpgme11-dev, libgnutls-dev, xsltproc, - pkg-config + pkg-config, man Standards-Version: 3.9.2 Vcs-Bzr: http://ftp.recompile.se/pub/mandos/trunk Vcs-Browser: http://bzr.recompile.se/loggerhead/mandos/trunk/files @@ -38,7 +38,7 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, cryptsetup, gnupg (<< 2) -Conflicts: dropbear (<= 0.52-5) +Breaks: dropbear (<= 0.53.1-1) Enhances: cryptsetup Description: do unattended reboots with an encrypted root file system This is the client part of the Mandos system, which allows === modified file 'debian/copyright' --- debian/copyright 2011-10-05 16:00:56 +0000 +++ debian/copyright 2011-10-10 20:29:58 +0000 @@ -1,8 +1,7 @@ -Format-Specification: - http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=233 +Format: http://anonscm.debian.org/viewvc/dep/web/deps/dep5.mdwn?revision=202 Upstream-Name: Mandos -Upstream-Maintainer: Mandos Maintainers -Upstream-Source: +Upstream-Contact: Mandos +Source: Files: * Copyright: Copyright © 2008-2011 Teddy Hogeborn === modified file 'debian/mandos-client.postinst' --- debian/mandos-client.postinst 2009-05-24 23:36:15 +0000 +++ debian/mandos-client.postinst 2011-10-10 20:29:58 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh # This script can be called in the following ways: # # After the package was installed: @@ -15,6 +15,8 @@ # If prerm fails during replacement due to conflict: # abort-remove in-favour +set -e + # Update the initial RAM file system image update_initramfs() { === modified file 'debian/mandos-client.postrm' --- debian/mandos-client.postrm 2011-02-27 17:00:41 +0000 +++ debian/mandos-client.postrm 2011-10-10 20:29:58 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh # This script can be called in the following ways: # # After the package was removed: @@ -26,6 +26,7 @@ # If preinst fails during upgrade: # abort-upgrade +set -e # Update the initial RAM file system image update_initramfs() === modified file 'debian/mandos.postinst' --- debian/mandos.postinst 2009-05-24 23:28:04 +0000 +++ debian/mandos.postinst 2011-10-10 20:29:58 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/sh # This script can be called in the following ways: # # After the package was installed: @@ -15,6 +15,8 @@ # If prerm fails during replacement due to conflict: # abort-remove in-favour +set -e + case "$1" in configure) # Rename old "mandos" user and group === modified file 'debian/mandos.prerm' --- debian/mandos.prerm 2009-01-18 00:16:57 +0000 +++ debian/mandos.prerm 2011-10-10 20:29:58 +0000 @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # prerm script for mandos # # see: dh_installdeb(1) === modified file 'mandos' --- mandos 2011-10-09 17:36:01 +0000 +++ mandos 2011-10-14 18:35:55 +0000 @@ -464,11 +464,13 @@ if timeout is None: timeout = self.timeout self.last_checked_ok = datetime.datetime.utcnow() - gobject.source_remove(self.disable_initiator_tag) - self.disable_initiator_tag = (gobject.timeout_add - (_timedelta_to_milliseconds - (timeout), self.disable)) - self.expires = datetime.datetime.utcnow() + timeout + if self.disable_initiator_tag is not None: + gobject.source_remove(self.disable_initiator_tag) + if getattr(self, "enabled", False): + self.disable_initiator_tag = (gobject.timeout_add + (_timedelta_to_milliseconds + (timeout), self.disable)) + self.expires = datetime.datetime.utcnow() + timeout def need_approval(self): self.last_approval_request = datetime.datetime.utcnow() @@ -891,8 +893,8 @@ """ Modify a variable so that it's a property which announces its changes to DBus. - transform_fun: Function that takes a value and transforms it - to a D-Bus type. + transform_fun: Function that takes a value and a variant_level + and transforms it to a D-Bus type. dbus_name: D-Bus name of the variable type_func: Function that transform the value before sending it to the D-Bus. Default: no transform @@ -905,7 +907,8 @@ type_func(getattr(self, attrname, None)) != type_func(value)): dbus_value = transform_func(type_func(value), - variant_level) + variant_level + =variant_level) self.PropertyChanged(dbus.String(dbus_name), dbus_value) setattr(self, attrname, value) @@ -1187,12 +1190,11 @@ gobject.source_remove(self.disable_initiator_tag) self.disable_initiator_tag = None self.expires = None - time_to_die = (self. - _timedelta_to_milliseconds((self - .last_checked_ok - + self.timeout) - - datetime.datetime - .utcnow())) + time_to_die = _timedelta_to_milliseconds((self + .last_checked_ok + + self.timeout) + - datetime.datetime + .utcnow()) if time_to_die <= 0: # The timeout has passed self.disable() @@ -1428,7 +1430,7 @@ sent_size += sent logger.info("Sending secret to %s", client.name) - # bump the timeout as if seen + # bump the timeout using extended_timeout client.checked_ok(client.extended_timeout) if self.server.use_dbus: # Emit D-Bus signal @@ -1661,8 +1663,9 @@ for cond, name in condition_names.iteritems() if cond & condition) - # error or the other end of multiprocessing.Pipe has closed + # error, or the other end of multiprocessing.Pipe has closed if condition & (gobject.IO_ERR | condition & gobject.IO_HUP): + # Wait for other process to exit proc.join() return False === modified file 'mandos-clients.conf.xml' --- mandos-clients.conf.xml 2011-10-05 16:00:56 +0000 +++ mandos-clients.conf.xml 2011-10-10 20:29:58 +0000 @@ -3,7 +3,7 @@ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ /etc/mandos/clients.conf"> - + %common; ]> @@ -190,7 +190,7 @@ Extended timeout is an added timeout that is given once - after a password has been sent sucessfully to a client. + after a password has been sent successfully to a client. The timeout is by default longer than the normal timeout, and is used for handling the extra long downtime while a machine is booting up. Time to take into consideration === modified file 'mandos-ctl' --- mandos-ctl 2011-10-09 17:36:01 +0000 +++ mandos-ctl 2011-10-14 18:21:46 +0000 @@ -301,41 +301,41 @@ dbus_interface= dbus.PROPERTIES_IFACE) else 1) - if options.checker: + if options.checker is not None: client.Set(client_interface, "Checker", options.checker, dbus_interface=dbus.PROPERTIES_IFACE) - if options.host: + if options.host is not None: client.Set(client_interface, "Host", options.host, dbus_interface=dbus.PROPERTIES_IFACE) - if options.interval: + if options.interval is not None: client.Set(client_interface, "Interval", timedelta_to_milliseconds (string_to_delta(options.interval)), dbus_interface=dbus.PROPERTIES_IFACE) - if options.approval_delay: + if options.approval_delay is not None: client.Set(client_interface, "ApprovalDelay", timedelta_to_milliseconds (string_to_delta(options. approval_delay)), dbus_interface=dbus.PROPERTIES_IFACE) - if options.approval_duration: + if options.approval_duration is not None: client.Set(client_interface, "ApprovalDuration", timedelta_to_milliseconds (string_to_delta(options. approval_duration)), dbus_interface=dbus.PROPERTIES_IFACE) - if options.timeout: + if options.timeout is not None: client.Set(client_interface, "Timeout", timedelta_to_milliseconds (string_to_delta(options.timeout)), dbus_interface=dbus.PROPERTIES_IFACE) - if options.extended_timeout: + if options.extended_timeout is not None: client.Set(client_interface, "ExtendedTimeout", timedelta_to_milliseconds (string_to_delta(options.extended_timeout)), dbus_interface=dbus.PROPERTIES_IFACE) - if options.secret: + if options.secret is not None: client.Set(client_interface, "Secret", dbus.ByteArray(open(options.secret, "rb").read()),