/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

  • Committer: Teddy Hogeborn
  • Date: 2008-08-11 08:04:35 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080811080435-7qfkwv5g43ww5h9x
* plugins.d/password-request.c (main): Bug fix: Bring up network
                                       interface *before* dropping
                                       privileges.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
from dbus.mainloop.glib import DBusGMainLoop
62
62
import ctypes
63
63
 
 
64
version = "1.0"
64
65
 
65
66
logger = logging.Logger('mandos')
66
67
syslogger = logging.handlers.SysLogHandler\
70
71
                        ('Mandos: %(levelname)s: %(message)s'))
71
72
logger.addHandler(syslogger)
72
73
 
 
74
console = logging.StreamHandler()
 
75
console.setFormatter(logging.Formatter('%(name)s: %(levelname)s:'
 
76
                                       ' %(message)s'))
 
77
logger.addHandler(console)
73
78
 
74
79
class AvahiError(Exception):
75
80
    def __init__(self, value):
653
658
    global main_loop_started
654
659
    main_loop_started = False
655
660
    
656
 
    parser = OptionParser()
 
661
    parser = OptionParser(version = "%%prog %s" % version)
657
662
    parser.add_option("-i", "--interface", type="string",
658
663
                      metavar="IF", help="Bind to interface IF")
659
664
    parser.add_option("-a", "--address", type="string",
716
721
    
717
722
    if not debug:
718
723
        syslogger.setLevel(logging.WARNING)
 
724
        console.setLevel(logging.WARNING)
719
725
    
720
726
    if server_settings["servicename"] != "Mandos":
721
727
        syslogger.setFormatter(logging.Formatter\
750
756
            avahi.DBUS_INTERFACE_SERVER )
751
757
    # End of Avahi example code
752
758
    
753
 
    if debug:
754
 
        console = logging.StreamHandler()
755
 
        # console.setLevel(logging.DEBUG)
756
 
        console.setFormatter(logging.Formatter\
757
 
                             ('%(levelname)s: %(message)s'))
758
 
        logger.addHandler(console)
759
 
        del console
760
 
    
761
759
    clients = Set()
762
760
    def remove_from_clients(client):
763
761
        clients.remove(client)
775
773
        sys.exit(1)
776
774
    
777
775
    if not debug:
 
776
        logger.removeHandler(console)
778
777
        daemon()
779
778
    
780
779
    pidfilename = "/var/run/mandos/mandos.pid"