=== modified file 'TODO' --- TODO 2011-10-09 12:53:54 +0000 +++ TODO 2011-10-09 15:21:16 +0000 @@ -114,8 +114,8 @@ From XML sources directly? * Side Stuff -** TODO Locate which packet move the other bin/sh when busy box is deactivated -** TODO contact owner of packet, and ask them to have that shell static in position regardless of busybox +** 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 #+STARTUP: showall === modified file 'mandos' --- mandos 2011-10-08 17:15:48 +0000 +++ mandos 2011-10-09 15:19:47 +0000 @@ -465,10 +465,10 @@ timeout = self.timeout self.last_checked_ok = datetime.datetime.utcnow() gobject.source_remove(self.disable_initiator_tag) - self.expires = datetime.datetime.utcnow() + timeout 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() @@ -1394,8 +1394,6 @@ return #wait until timeout or approved - #x = float(client - # ._timedelta_to_milliseconds(delay)) time = datetime.datetime.now() client.changedstate.acquire() (client.changedstate.wait @@ -1516,11 +1514,14 @@ except: self.handle_error(request, address) self.close_request(request) - + def process_request(self, request, address): """Start a new process to process the request.""" - multiprocessing.Process(target = self.sub_process_main, - args = (request, address)).start() + proc = multiprocessing.Process(target = self.sub_process_main, + args = (request, + address)) + proc.start() + return proc class MultiprocessingMixInWithPipe(MultiprocessingMixIn, object): @@ -1532,12 +1533,12 @@ """ parent_pipe, self.child_pipe = multiprocessing.Pipe() - super(MultiprocessingMixInWithPipe, - self).process_request(request, client_address) + proc = MultiprocessingMixIn.process_request(self, request, + client_address) self.child_pipe.close() - self.add_pipe(parent_pipe) + self.add_pipe(parent_pipe, proc) - def add_pipe(self, parent_pipe): + def add_pipe(self, parent_pipe, proc): """Dummy function; override as necessary""" raise NotImplementedError @@ -1631,18 +1632,21 @@ def server_activate(self): if self.enabled: return socketserver.TCPServer.server_activate(self) + def enable(self): self.enabled = True - def add_pipe(self, parent_pipe): + + def add_pipe(self, parent_pipe, proc): # Call "handle_ipc" for both data and EOF events gobject.io_add_watch(parent_pipe.fileno(), gobject.IO_IN | gobject.IO_HUP, functools.partial(self.handle_ipc, parent_pipe = - parent_pipe)) - + parent_pipe, + proc = proc)) + def handle_ipc(self, source, condition, parent_pipe=None, - client_object=None): + proc = None, client_object=None): condition_names = { gobject.IO_IN: "IN", # There is data to read. gobject.IO_OUT: "OUT", # Data can be written (without @@ -1659,6 +1663,7 @@ if cond & condition) # error or the other end of multiprocessing.Pipe has closed if condition & (gobject.IO_ERR | condition & gobject.IO_HUP): + proc.join() return False # Read a request from the child @@ -1688,6 +1693,7 @@ functools.partial(self.handle_ipc, parent_pipe = parent_pipe, + proc = proc, client_object = client)) parent_pipe.send(True) @@ -2129,6 +2135,7 @@ "Cleanup function; run on exit" service.cleanup() + multiprocessing.active_children() while tcp_server.clients: client = tcp_server.clients.pop() if use_dbus: === modified file 'mandos-ctl' --- mandos-ctl 2011-10-05 16:00:56 +0000 +++ mandos-ctl 2011-10-09 12:32:13 +0000 @@ -3,8 +3,8 @@ # # Mandos Monitor - Control and monitor the Mandos server # -# Copyright © 2008-2010 Teddy Hogeborn -# Copyright © 2008-2010 Björn Påhlsson +# Copyright © 2008-2011 Teddy Hogeborn +# Copyright © 2008-2011 Björn Påhlsson # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by === modified file 'plugin-runner.c' --- plugin-runner.c 2011-10-05 16:00:56 +0000 +++ plugin-runner.c 2011-10-09 12:32:13 +0000 @@ -2,8 +2,8 @@ /* * Mandos plugin runner - Run Mandos plugins * - * Copyright © 2008-2010 Teddy Hogeborn - * Copyright © 2008-2010 Björn Påhlsson + * Copyright © 2008-2011 Teddy Hogeborn + * Copyright © 2008-2011 Björn Påhlsson * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as === modified file 'plugins.d/password-prompt.c' --- plugins.d/password-prompt.c 2011-10-05 16:00:56 +0000 +++ plugins.d/password-prompt.c 2011-10-09 12:32:13 +0000 @@ -2,8 +2,8 @@ /* * Password-prompt - Read a password from the terminal and print it * - * Copyright © 2008-2010 Teddy Hogeborn - * Copyright © 2008-2010 Björn Påhlsson + * Copyright © 2008-2011 Teddy Hogeborn + * Copyright © 2008-2011 Björn Påhlsson * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as