fix some more fd leaks

This commit is contained in:
Wojtek Porczyk 2017-08-31 20:28:08 +02:00
parent 6ff1bfdc16
commit 029ec9cb38
2 changed files with 9 additions and 2 deletions

View File

@ -706,6 +706,12 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
self.events_enabled = True
self.fire_event('domain-init')
def close(self):
if self._qdb_connection is not None:
self._qdb_connection.close()
self._qdb_connection = None
super().close()
def __hash__(self):
return self.qid

View File

@ -69,8 +69,9 @@ def main(args=None):
caller_ident = args.process_ident + "," + args.domain + "," + args.domain_id
log = logging.getLogger('qubespolicy')
log.setLevel(logging.INFO)
handler = logging.handlers.SysLogHandler(address='/dev/log')
log.addHandler(handler)
if not log.handlers:
handler = logging.handlers.SysLogHandler(address='/dev/log')
log.addHandler(handler)
log_prefix = 'qrexec: {}: {} -> {}: '.format(
args.service_name, args.domain, args.target)
try: