/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

  • Committer: Teddy Hogeborn
  • Date: 2013-12-31 16:02:18 UTC
  • mto: (237.7.272 trunk)
  • mto: This revision was merged to the branch mainline in revision 307.
  • Revision ID: teddy@recompile.se-20131231160218-plmmb0o0iifkd5l2
Specify BusName in systemd service file.

* mandos.service (BusName): Uncommented.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
    except ImportError:
89
89
        SO_BINDTODEVICE = None
90
90
 
91
 
version = "1.6.1"
 
91
version = "1.6.2"
92
92
stored_state_file = "clients.pickle"
93
93
 
94
94
logger = logging.getLogger()
690
690
        # If a checker exists, make sure it is not a zombie
691
691
        try:
692
692
            pid, status = os.waitpid(self.checker.pid, os.WNOHANG)
693
 
        except (AttributeError, OSError) as error:
694
 
            if (isinstance(error, OSError)
695
 
                and error.errno != errno.ECHILD):
696
 
                raise error
 
693
        except AttributeError:
 
694
            pass
 
695
        except OSError as error:
 
696
            if error.errno != errno.ECHILD:
 
697
                raise
697
698
        else:
698
699
            if pid:
699
700
                logger.warning("Checker was a zombie")
1702
1703
            logger.debug("Protocol version: %r", line)
1703
1704
            try:
1704
1705
                if int(line.strip().split()[0]) > 1:
1705
 
                    raise RuntimeError
 
1706
                    raise RuntimeError(line)
1706
1707
            except (ValueError, IndexError, RuntimeError) as error:
1707
1708
                logger.error("Unknown protocol version: %s", error)
1708
1709
                return
1915
1916
    
1916
1917
    def add_pipe(self, parent_pipe, proc):
1917
1918
        """Dummy function; override as necessary"""
1918
 
        raise NotImplementedError
 
1919
        raise NotImplementedError()
1919
1920
 
1920
1921
 
1921
1922
class IPv6_TCPServer(MultiprocessingMixInWithPipe,
2258
2259
            else:
2259
2260
                raise ValueError("Unknown suffix {0!r}"
2260
2261
                                 .format(suffix))
2261
 
        except (ValueError, IndexError) as e:
 
2262
        except IndexError as e:
2262
2263
            raise ValueError(*(e.args))
2263
2264
        timevalue += delta
2264
2265
    return timevalue
2457
2458
                                        or None))
2458
2459
    if not foreground:
2459
2460
        pidfilename = "/run/mandos.pid"
 
2461
        if not os.path.isdir("/run/."):
 
2462
            pidfilename = "/var/run/mandos.pid"
2460
2463
        pidfile = None
2461
2464
        try:
2462
2465
            pidfile = open(pidfilename, "w")
2479
2482
        os.setuid(uid)
2480
2483
    except OSError as error:
2481
2484
        if error.errno != errno.EPERM:
2482
 
            raise error
 
2485
            raise
2483
2486
    
2484
2487
    if debug:
2485
2488
        # Enable all possible GnuTLS debugging
2790
2793
            else:
2791
2794
                logger.warning("Could not save persistent state:",
2792
2795
                               exc_info=e)
2793
 
                raise e
 
2796
                raise
2794
2797
        
2795
2798
        # Delete all clients, and settings from config
2796
2799
        while tcp_server.clients: