=== modified file 'TODO' --- TODO 2015-10-04 13:44:03 +0000 +++ TODO 2016-03-05 21:05:11 +0000 @@ -1,19 +1,5 @@ -*- org -*- -* GIT -** General: [[https://www.atlassian.com/git/workflows][Git Workflows]], [[http://gitimmersion.com/][Git Immersion]], [[https://news.ycombinator.com/item?id=7036628][Simple git workflow is simple]] [[https://news.ycombinator.com/item?id=9661349][On undoing, fixing, or removing commits in git]] -** Intro: [[http://www.eyrie.org/~eagle/notes/debian/git.html#combine][Using Git for Debian Packaging]] -** Use: [[https://honk.sigxcpu.org/piki/projects/git-buildpackage/][git-buildpackage]] -** Migration - tailor? - Using bzr-fastimport: [[http://www.fusonic.net/en/blog/2013/03/26/migrating-from-bazaar-to-git/][Migrating from Bazaar to Git]] -** Unresolved: [[http://jameswestby.net/bzr/builddeb/user_manual/split.html][bzr builddeb split mode]] - Maybe: [[http://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.import.html#GBP.IMPORT.UPSTREAM.GIT.NOTARBALL][git-buildpackage - No upstream tarballs]] - [[http://www.python.org/dev/peps/pep-0374/][PEP 374 - Choosing a distributed VCS for the Python project]] - [[http://www.emacswiki.org/emacs/GitForEmacsDevs][Git For Emacs Devs]] - -* [[http://www.undeadly.org/cgi?action=article&sid=20110530221728][OpenBSD]] - * Testing ** python-nemu @@ -27,7 +13,6 @@ ** TODO [#B] Use getaddrinfo(hints=AI_NUMERICHOST) instead of inet_pton() ** TODO [#C] Make start_mandos_communication() take "struct server". ** TODO [#C] --interfaces=regex,eth*,noregex (bridge-utils-interfaces(5)) -** TODO [#C] Remove code for GNU libc < 2.15 * splashy ** TODO [#B] use scandir(3) instead of readdir(3) @@ -50,7 +35,6 @@ *** Hook up stderr of plugins, buffer them, and prepend "Mandos Plugin [plugin name]" ** TODO [#C] use same file name rules as run-parts(8) ** kernel command line option for debug info -** TODO [#C] Remove code for GNU libc < 2.15 * mandos (server) ** TODO [#B] --notify-command @@ -74,7 +58,6 @@ ** TODO [#B] break the wait on approval_delay if connection dies ** TODO Generate Client.runtime_expansions from client options + extra ** TODO Allow %%(checker)s as a runtime expansion -** TODO Use python-tlslite? ** TODO D-Bus AddClient() method on server object ** TODO Use org.freedesktop.DBus.Method.NoReply annotation on async methods. :2: ** TODO Save state periodically to recover better from hard shutdowns @@ -82,13 +65,13 @@ ** TODO Secret Service API? http://standards.freedesktop.org/secret-service/ ** TODO Remove D-Bus interfaces with old domain name :2: -** TODO Remove old string_to_delta format :2: +** TODO Remove old string_to_delta format :2: ** TODO http://0pointer.de/blog/projects/stateless.html *** tmpfiles snippet to create /var/lib/mandos with right user+perms *** File in /usr/lib/sysusers.d to create user+group "_mandos" ** TODO Error handling on error parsing config files ** TODO init.d script error handling -** TODO D-Bus server properties; address, port, interface, etc. :2: +** TODO D-Bus server properties; address, port, interface, etc. :2: ** TODO [#C] In Python 3.3, use shlex.quote() instead of re.escape() * mandos.xml @@ -97,7 +80,7 @@ * mandos-ctl *** Handle "no D-Bus server" and/or "no Mandos server found" better *** [#B] --dump option -** TODO Remove old string_to_delta format :2: +** TODO Remove old string_to_delta format :2: * TODO mandos-dispatch Listens for specified D-Bus signals and spawns shell commands with @@ -109,7 +92,6 @@ Better view of client data in the listing *** Properties popup ** Print a nice "We are sorry" message, save stack trace to log. -** Rename module "gobject" to "GObject". * mandos-keygen ** TODO "--secfile" option @@ -129,5 +111,7 @@ ** TODO Locate which package moves the other bin/sh when busybox is deactivated ** TODO contact owner of package, and ask them to have that shell static in position regardless of busybox +* [[http://www.undeadly.org/cgi?action=article&sid=20110530221728][OpenBSD]] + #+STARTUP: showall === modified file 'debian/control' --- debian/control 2016-02-28 15:11:35 +0000 +++ debian/control 2016-03-05 21:05:11 +0000 @@ -9,7 +9,7 @@ | gnutls-dev (>= 3.3.0), xsltproc, pkg-config, libnl-route-3-dev Build-Depends-Indep: systemd, python (>= 2.7), python (<< 3), - python-dbus, python-avahi, python-gobject | python-gi + python-dbus, python-avahi, python-gi | python-gobject Standards-Version: 3.9.7 Vcs-Bzr: http://ftp.recompile.se/pub/mandos/trunk Vcs-Browser: http://bzr.recompile.se/loggerhead/mandos/trunk/files @@ -19,7 +19,7 @@ Architecture: all Depends: ${misc:Depends}, python (>= 2.7), python (<< 3), libgnutls28-dev (>= 3.3.0) | libgnutls30 (>= 3.3.0), - python-dbus, python-avahi, python-gobject | python-gi, + python-dbus, python-avahi, python-gi | python-gobject, avahi-daemon, adduser, python-urwid, gnupg Recommends: ssh-client | fping Description: server giving encrypted passwords to Mandos clients === modified file 'mandos' --- mandos 2016-03-02 17:35:23 +0000 +++ mandos 2016-03-05 21:05:11 +0000 @@ -77,9 +77,9 @@ import dbus import dbus.service try: - import gobject + from gi.repository import GObject except ImportError: - from gi.repository import GObject as gobject + import gobject as GObject import avahi from dbus.mainloop.glib import DBusGMainLoop import ctypes @@ -715,17 +715,17 @@ checker: subprocess.Popen(); a running checker process used to see if the client lives. 'None' if no process is running. - checker_callback_tag: a gobject event source tag, or None + checker_callback_tag: a GObject event source tag, or None checker_command: string; External command which is run to check if client lives. %() expansions are done at runtime with vars(self) as dict, so that for instance %(name)s can be used in the command. - checker_initiator_tag: a gobject event source tag, or None + checker_initiator_tag: a GObject event source tag, or None created: datetime.datetime(); (UTC) object creation client_structure: Object describing what attributes a client has and is used for storing the client at exit current_checker_command: string; current running checker_command - disable_initiator_tag: a gobject event source tag, or None + disable_initiator_tag: a GObject event source tag, or None enabled: bool() fingerprint: string (40 or 32 hexadecimal digits); used to uniquely identify the client @@ -885,17 +885,17 @@ if not quiet: logger.info("Disabling client %s", self.name) if getattr(self, "disable_initiator_tag", None) is not None: - gobject.source_remove(self.disable_initiator_tag) + GObject.source_remove(self.disable_initiator_tag) self.disable_initiator_tag = None self.expires = None if getattr(self, "checker_initiator_tag", None) is not None: - gobject.source_remove(self.checker_initiator_tag) + GObject.source_remove(self.checker_initiator_tag) self.checker_initiator_tag = None self.stop_checker() self.enabled = False if not quiet: self.send_changedstate() - # Do not run this again if called by a gobject.timeout_add + # Do not run this again if called by a GObject.timeout_add return False def __del__(self): @@ -905,14 +905,14 @@ # Schedule a new checker to be started an 'interval' from now, # and every interval from then on. if self.checker_initiator_tag is not None: - gobject.source_remove(self.checker_initiator_tag) - self.checker_initiator_tag = gobject.timeout_add( + GObject.source_remove(self.checker_initiator_tag) + self.checker_initiator_tag = GObject.timeout_add( int(self.interval.total_seconds() * 1000), self.start_checker) # Schedule a disable() when 'timeout' has passed if self.disable_initiator_tag is not None: - gobject.source_remove(self.disable_initiator_tag) - self.disable_initiator_tag = gobject.timeout_add( + GObject.source_remove(self.disable_initiator_tag) + self.disable_initiator_tag = GObject.timeout_add( int(self.timeout.total_seconds() * 1000), self.disable) # Also start a new checker *right now*. self.start_checker() @@ -954,10 +954,10 @@ if timeout is None: timeout = self.timeout if self.disable_initiator_tag is not None: - gobject.source_remove(self.disable_initiator_tag) + GObject.source_remove(self.disable_initiator_tag) self.disable_initiator_tag = None if getattr(self, "enabled", False): - self.disable_initiator_tag = gobject.timeout_add( + self.disable_initiator_tag = GObject.timeout_add( int(timeout.total_seconds() * 1000), self.disable) self.expires = datetime.datetime.utcnow() + timeout @@ -1018,16 +1018,16 @@ args = (pipe[1], subprocess.call, command), kwargs = popen_args) self.checker.start() - self.checker_callback_tag = gobject.io_add_watch( - pipe[0].fileno(), gobject.IO_IN, + self.checker_callback_tag = GObject.io_add_watch( + pipe[0].fileno(), GObject.IO_IN, self.checker_callback, pipe[0], command) - # Re-run this periodically if run by gobject.timeout_add + # Re-run this periodically if run by GObject.timeout_add return True def stop_checker(self): """Force the checker process, if any, to stop.""" if self.checker_callback_tag: - gobject.source_remove(self.checker_callback_tag) + GObject.source_remove(self.checker_callback_tag) self.checker_callback_tag = None if getattr(self, "checker", None) is None: return @@ -1807,7 +1807,7 @@ def approve(self, value=True): self.approved = value - gobject.timeout_add(int(self.approval_duration.total_seconds() + GObject.timeout_add(int(self.approval_duration.total_seconds() * 1000), self._reset_approved) self.send_changedstate() @@ -2024,8 +2024,8 @@ if (getattr(self, "disable_initiator_tag", None) is None): return - gobject.source_remove(self.disable_initiator_tag) - self.disable_initiator_tag = gobject.timeout_add( + GObject.source_remove(self.disable_initiator_tag) + self.disable_initiator_tag = GObject.timeout_add( int((self.expires - now).total_seconds() * 1000), self.disable) @@ -2051,8 +2051,8 @@ return if self.enabled: # Reschedule checker run - gobject.source_remove(self.checker_initiator_tag) - self.checker_initiator_tag = gobject.timeout_add( + GObject.source_remove(self.checker_initiator_tag) + self.checker_initiator_tag = GObject.timeout_add( value, self.start_checker) self.start_checker() # Start one now, too @@ -2462,7 +2462,7 @@ gnutls_priority GnuTLS priority string use_dbus: Boolean; to emit D-Bus signals or not - Assumes a gobject.MainLoop event loop. + Assumes a GObject.MainLoop event loop. """ def __init__(self, server_address, RequestHandlerClass, @@ -2493,9 +2493,9 @@ def add_pipe(self, parent_pipe, proc): # Call "handle_ipc" for both data and EOF events - gobject.io_add_watch( + GObject.io_add_watch( parent_pipe.fileno(), - gobject.IO_IN | gobject.IO_HUP, + GObject.IO_IN | GObject.IO_HUP, functools.partial(self.handle_ipc, parent_pipe = parent_pipe, proc = proc)) @@ -2505,7 +2505,7 @@ proc = None, client_object=None): # error, or the other end of multiprocessing.Pipe has closed - if condition & (gobject.IO_ERR | gobject.IO_HUP): + if condition & (GObject.IO_ERR | GObject.IO_HUP): # Wait for other process to exit proc.join() return False @@ -2532,9 +2532,9 @@ parent_pipe.send(False) return False - gobject.io_add_watch( + GObject.io_add_watch( parent_pipe.fileno(), - gobject.IO_IN | gobject.IO_HUP, + GObject.IO_IN | GObject.IO_HUP, functools.partial(self.handle_ipc, parent_pipe = parent_pipe, proc = proc, @@ -2965,14 +2965,14 @@ # Close all input and output, do double fork, etc. daemon() - # multiprocessing will use threads, so before we use gobject we - # need to inform gobject that threads will be used. - gobject.threads_init() + # multiprocessing will use threads, so before we use GObject we + # need to inform GObject that threads will be used. + GObject.threads_init() global main_loop # From the Avahi example code DBusGMainLoop(set_as_default=True) - main_loop = gobject.MainLoop() + main_loop = GObject.MainLoop() bus = dbus.SystemBus() # End of Avahi example code if use_dbus: @@ -3347,7 +3347,7 @@ sys.exit(1) # End of Avahi example code - gobject.io_add_watch(tcp_server.fileno(), gobject.IO_IN, + GObject.io_add_watch(tcp_server.fileno(), GObject.IO_IN, lambda *args, **kwargs: (tcp_server.handle_request (*args[2:], **kwargs) or True)) === modified file 'mandos-monitor' --- mandos-monitor 2016-02-29 21:28:39 +0000 +++ mandos-monitor 2016-03-05 21:05:11 +0000 @@ -40,9 +40,9 @@ from dbus.mainloop.glib import DBusGMainLoop try: - import gobject + from gi.repository import GObject except ImportError: - from gi.repository import GObject as gobject + import gobject as GObject import dbus @@ -172,11 +172,11 @@ """ if flag and self._update_timer_callback_tag is None: # Will update the shown timer value every second - self._update_timer_callback_tag = (gobject.timeout_add + self._update_timer_callback_tag = (GObject.timeout_add (1000, self.update_timer)) elif not (flag or self._update_timer_callback_tag is None): - gobject.source_remove(self._update_timer_callback_tag) + GObject.source_remove(self._update_timer_callback_tag) self._update_timer_callback_tag = None def checker_completed(self, exitstatus, condition, command): @@ -309,14 +309,14 @@ self.update_hook() def update_timer(self): - """called by gobject. Will indefinitely loop until - gobject.source_remove() on tag is called""" + """called by GObject. Will indefinitely loop until + GObject.source_remove() on tag is called""" self.update() return True # Keep calling this def delete(self, **kwargs): if self._update_timer_callback_tag is not None: - gobject.source_remove(self._update_timer_callback_tag) + GObject.source_remove(self._update_timer_callback_tag) self._update_timer_callback_tag = None for match in self.match_objects: match.remove() @@ -465,7 +465,7 @@ "q: Quit ?: Help")) self.busname = domain + '.Mandos' - self.main_loop = gobject.MainLoop() + self.main_loop = GObject.MainLoop() def client_not_found(self, fingerprint, address): self.log_message("Client with address {} and fingerprint {}" @@ -640,13 +640,13 @@ path=path) self.refresh() - self._input_callback_tag = (gobject.io_add_watch + self._input_callback_tag = (GObject.io_add_watch (sys.stdin.fileno(), - gobject.IO_IN, + GObject.IO_IN, self.process_input)) self.main_loop.run() # Main loop has finished, we should close everything now - gobject.source_remove(self._input_callback_tag) + GObject.source_remove(self._input_callback_tag) self.screen.stop() def stop(self):