/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-04 12:39:39 UTC
  • Revision ID: teddy@recompile.se-20190804123939-vadn3y4ia18np40q
Add Debian DEP 12 upstream metadata file

See DEP 12: https://dep-team.pages.debian.net/deps/dep12/

* debian/upstream/metadata: New.

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
 
118
 
version = "1.8.4"
 
119
if sys.version_info < (3, 2):
 
120
    configparser.Configparser = configparser.SafeConfigParser
 
121
 
 
122
version = "1.8.6"
119
123
stored_state_file = "clients.pickle"
120
124
 
121
125
logger = logging.getLogger()
821
825
    approved:   bool(); 'None' if not yet approved/disapproved
822
826
    approval_delay: datetime.timedelta(); Time to wait for approval
823
827
    approval_duration: datetime.timedelta(); Duration of one approval
824
 
    checker:    subprocess.Popen(); a running checker process used
825
 
                                    to see if the client lives.
826
 
                                    'None' if no process is running.
 
828
    checker: multiprocessing.Process(); a running checker process used
 
829
             to see if the client lives. 'None' if no process is
 
830
             running.
827
831
    checker_callback_tag: a GLib event source tag, or None
828
832
    checker_command: string; External command which is run to check
829
833
                     if client lives.  %() expansions are done at
1036
1040
    def checker_callback(self, source, condition, connection,
1037
1041
                         command):
1038
1042
        """The checker has completed, so take appropriate actions."""
1039
 
        self.checker_callback_tag = None
1040
 
        self.checker = None
1041
1043
        # Read return code from connection (see call_pipe)
1042
1044
        returncode = connection.recv()
1043
1045
        connection.close()
 
1046
        self.checker.join()
 
1047
        self.checker_callback_tag = None
 
1048
        self.checker = None
1044
1049
 
1045
1050
        if returncode >= 0:
1046
1051
            self.last_checker_status = returncode
2997
3002
    del priority
2998
3003
 
2999
3004
    # Parse config file for server-global settings
3000
 
    server_config = configparser.SafeConfigParser(server_defaults)
 
3005
    server_config = configparser.ConfigParser(server_defaults)
3001
3006
    del server_defaults
3002
3007
    server_config.read(os.path.join(options.configdir, "mandos.conf"))
3003
 
    # Convert the SafeConfigParser object to a dict
 
3008
    # Convert the ConfigParser object to a dict
3004
3009
    server_settings = server_config.defaults()
3005
3010
    # Use the appropriate methods on the non-string config options
3006
3011
    for option in ("debug", "use_dbus", "use_ipv6", "restore",
3078
3083
                                  server_settings["servicename"])))
3079
3084
 
3080
3085
    # Parse config file with clients
3081
 
    client_config = configparser.SafeConfigParser(Client
3082
 
                                                  .client_defaults)
 
3086
    client_config = configparser.ConfigParser(Client.client_defaults)
3083
3087
    client_config.read(os.path.join(server_settings["configdir"],
3084
3088
                                    "clients.conf"))
3085
3089
 
3156
3160
        # Close all input and output, do double fork, etc.
3157
3161
        daemon()
3158
3162
 
3159
 
    # multiprocessing will use threads, so before we use GLib we need
3160
 
    # to inform GLib that threads will be used.
3161
 
    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()
3162
3167
 
3163
3168
    global main_loop
3164
3169
    # From the Avahi example code