/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos-monitor

  • Committer: Teddy Hogeborn
  • Date: 2015-08-10 07:34:37 UTC
  • Revision ID: teddy@recompile.se-20150810073437-3m8jgt13nqric6vf
Revert change to D-Bus API.

The D-Bus API signal CheckerCompleted is documented to provide a
wait(2) status value.  Since the server switched to using subprocess
to run checkers, it no longer has access to a wait(2) status value.  A
previous change to work around this made the D-Bus API incompatible.
Revert this change by constructing a fake wait(2) status value; this
keeps the D-Bus API stable.

* DBUS-API (CheckerCompleted): Revert incompatible change.
* mandos (ClientDBus.checker_callback): Construct fake wait(2) status.
* mandos-monitor (MandosClientWidget.checker_completed): Revert to
                                                         using
                                                         original API
                                                         with wait(2)
                                                         condition
                                                         value.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
4
4
# Mandos Monitor - Control and monitor the Mandos server
5
5
6
 
# Copyright © 2009-2014 Teddy Hogeborn
7
 
# Copyright © 2009-2014 Björn Påhlsson
 
6
# Copyright © 2009-2015 Teddy Hogeborn
 
7
# Copyright © 2009-2015 Björn Påhlsson
8
8
9
9
# This program is free software: you can redistribute it and/or modify
10
10
# it under the terms of the GNU General Public License as published by
191
191
                        ' killed by signal {}'
192
192
                        .format(self.properties["Name"], command,
193
193
                                os.WTERMSIG(condition)))
194
 
        elif os.WCOREDUMP(condition):
195
 
            self.logger('Checker for client {} (command "{}") dumped'
196
 
                        ' core'.format(self.properties["Name"],
197
 
                                       command))
198
 
        else:
199
 
            self.logger('Checker for client {} completed'
200
 
                        ' mysteriously'
201
 
                        .format(self.properties["Name"]))
202
194
        self.update()
203
195
    
204
196
    def checker_started(self, command):
337
329
        """Handle keys.
338
330
        This overrides the method from urwid.FlowWidget"""
339
331
        if key == "+":
340
 
            self.proxy.Enable(dbus_interface = client_interface,
341
 
                              ignore_reply=True)
 
332
            self.proxy.Set(client_interface, "Enabled",
 
333
                           dbus.Boolean(True), ignore_reply = True,
 
334
                           dbus_interface = dbus.PROPERTIES_IFACE)
342
335
        elif key == "-":
343
 
            self.proxy.Disable(dbus_interface = client_interface,
344
 
                               ignore_reply=True)
 
336
            self.proxy.Set(client_interface, "Enabled", False,
 
337
                           ignore_reply = True,
 
338
                           dbus_interface = dbus.PROPERTIES_IFACE)
345
339
        elif key == "a":
346
340
            self.proxy.Approve(dbus.Boolean(True, variant_level=1),
347
341
                               dbus_interface = client_interface,
355
349
                                                  .object_path,
356
350
                                                  ignore_reply=True)
357
351
        elif key == "s":
358
 
            self.proxy.StartChecker(dbus_interface = client_interface,
359
 
                                    ignore_reply=True)
 
352
            self.proxy.Set(client_interface, "CheckerRunning",
 
353
                           dbus.Boolean(True), ignore_reply = True,
 
354
                           dbus_interface = dbus.PROPERTIES_IFACE)
360
355
        elif key == "S":
361
 
            self.proxy.StopChecker(dbus_interface = client_interface,
362
 
                                   ignore_reply=True)
 
356
            self.proxy.Set(client_interface, "CheckerRunning",
 
357
                           dbus.Boolean(False), ignore_reply = True,
 
358
                           dbus_interface = dbus.PROPERTIES_IFACE)
363
359
        elif key == "C":
364
360
            self.proxy.CheckedOK(dbus_interface = client_interface,
365
361
                                 ignore_reply=True)