/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: 2019-08-03 12:40:59 UTC
  • mfrom: (1144 trunk)
  • mto: This revision was merged to the branch mainline in revision 1145.
  • Revision ID: teddy@recompile.se-20190803124059-z12hb7q97uc74ydk
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
 
81
81
import dbus
82
82
import dbus.service
 
83
import gi
83
84
from gi.repository import GLib
84
85
from dbus.mainloop.glib import DBusGMainLoop
85
86
import ctypes
115
116
if sys.version_info.major == 2:
116
117
    str = unicode
117
118
 
 
119
if sys.version_info < (3, 2):
 
120
    configparser.Configparser = configparser.SafeConfigParser
 
121
 
118
122
version = "1.8.5"
119
123
stored_state_file = "clients.pickle"
120
124
 
2998
3002
    del priority
2999
3003
 
3000
3004
    # Parse config file for server-global settings
3001
 
    server_config = configparser.SafeConfigParser(server_defaults)
 
3005
    server_config = configparser.ConfigParser(server_defaults)
3002
3006
    del server_defaults
3003
3007
    server_config.read(os.path.join(options.configdir, "mandos.conf"))
3004
 
    # Convert the SafeConfigParser object to a dict
 
3008
    # Convert the ConfigParser object to a dict
3005
3009
    server_settings = server_config.defaults()
3006
3010
    # Use the appropriate methods on the non-string config options
3007
3011
    for option in ("debug", "use_dbus", "use_ipv6", "restore",
3079
3083
                                  server_settings["servicename"])))
3080
3084
 
3081
3085
    # Parse config file with clients
3082
 
    client_config = configparser.SafeConfigParser(Client
3083
 
                                                  .client_defaults)
 
3086
    client_config = configparser.ConfigParser(Client.client_defaults)
3084
3087
    client_config.read(os.path.join(server_settings["configdir"],
3085
3088
                                    "clients.conf"))
3086
3089
 
3157
3160
        # Close all input and output, do double fork, etc.
3158
3161
        daemon()
3159
3162
 
3160
 
    # multiprocessing will use threads, so before we use GLib we need
3161
 
    # to inform GLib that threads will be used.
3162
 
    GLib.threads_init()
 
3163
    if gi.version_info < (3, 10, 2):
 
3164
        # multiprocessing will use threads, so before we use GLib we
 
3165
        # need to inform GLib that threads will be used.
 
3166
        GLib.threads_init()
3163
3167
 
3164
3168
    global main_loop
3165
3169
    # From the Avahi example code