/mandos/release

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

« back to all changes in this revision

Viewing changes to mandos

* mandos-keygen (password): Remove bashism "${PIPESTATUS}".

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
class Client(dbus.service.Object):
179
179
    """A representation of a client host served by this server.
180
180
    Attributes:
181
 
    name:       string; from the config file, used in log messages and
182
 
                        D-Bus identifiers
 
181
    name:       string; from the config file, used in log messages
183
182
    fingerprint: string (40 or 32 hexadecimal digits); used to
184
183
                 uniquely identify the client
185
184
    secret:     bytestring; sent verbatim (over TLS) to client
504
503
                dbus.String("checker_running"):
505
504
                    dbus.Boolean(self.checker is not None,
506
505
                                 variant_level=1),
507
 
                dbus.String("object_path"):
508
 
                    dbus.ObjectPath(self.dbus_object_path,
509
 
                                    variant_level=1)
510
506
                }, signature="sv")
511
507
    
512
508
    # IsStillValid - method
1099
1095
                dbus.service.Object.__init__(self, bus,
1100
1096
                                             "/Mandos")
1101
1097
            _interface = u"org.mandos_system.Mandos"
1102
 
            
 
1098
 
1103
1099
            @dbus.service.signal(_interface, signature="oa{sv}")
1104
1100
            def ClientAdded(self, objpath, properties):
1105
1101
                "D-Bus signal"
1106
1102
                pass
1107
 
            
1108
 
            @dbus.service.signal(_interface, signature="os")
1109
 
            def ClientRemoved(self, objpath, name):
 
1103
 
 
1104
            @dbus.service.signal(_interface, signature="o")
 
1105
            def ClientRemoved(self, objpath):
1110
1106
                "D-Bus signal"
1111
1107
                pass
1112
 
            
 
1108
 
1113
1109
            @dbus.service.method(_interface, out_signature="ao")
1114
1110
            def GetAllClients(self):
1115
1111
                return dbus.Array(c.dbus_object_path for c in clients)
1116
 
            
 
1112
 
1117
1113
            @dbus.service.method(_interface, out_signature="a{oa{sv}}")
1118
1114
            def GetAllClientsWithProperties(self):
1119
1115
                return dbus.Dictionary(
1120
1116
                    ((c.dbus_object_path, c.GetAllProperties())
1121
1117
                     for c in clients),
1122
1118
                    signature="oa{sv}")
1123
 
            
 
1119
 
1124
1120
            @dbus.service.method(_interface, in_signature="o")
1125
1121
            def RemoveClient(self, object_path):
1126
1122
                for c in clients:
1130
1126
                        c.use_dbus = False
1131
1127
                        c.disable()
1132
1128
                        # Emit D-Bus signal
1133
 
                        self.ClientRemoved(object_path, c.name)
1134
 
                        return
1135
 
                raise KeyError
1136
 
            
1137
 
            @dbus.service.method(_interface, in_signature="s")
1138
 
            def RemoveClientByName(self, name):
1139
 
                for c in clients:
1140
 
                    if c.name == name:
1141
 
                        clients.remove(c)
1142
 
                        # Don't signal anything except ClientRemoved
1143
 
                        c.use_dbus = False
1144
 
                        c.disable()
1145
 
                        # Emit D-Bus signal
1146
 
                        self.ClientRemoved(c.dbus_object_path, name)
1147
 
                        return
1148
 
                raise KeyError
1149
 
            
 
1129
                        self.ClientRemoved(object_path)
 
1130
                        return
 
1131
                raise KeyError
1150
1132
            @dbus.service.method(_interface)
1151
1133
            def Quit(self):
1152
1134
                main_loop.quit()
1153
 
            
 
1135
 
1154
1136
            del _interface
1155
 
        
 
1137
    
1156
1138
        mandos_server = MandosServer()
1157
1139
    
1158
1140
    for client in clients: