/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 at recompile
  • Date: 2020-07-04 13:39:36 UTC
  • mfrom: (237.4.132 release)
  • Revision ID: teddy@recompile.se-20200704133936-lfk4sy1d48m53iqu
Merge from release branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
# "AvahiService" class, and some lines in "main".
12
12
#
13
13
# Everything else is
14
 
# Copyright © 2008-2019 Teddy Hogeborn
15
 
# Copyright © 2008-2019 Björn Påhlsson
 
14
# Copyright © 2008-2020 Teddy Hogeborn
 
15
# Copyright © 2008-2020 Björn Påhlsson
16
16
#
17
17
# This file is part of Mandos.
18
18
#
79
79
import codecs
80
80
import unittest
81
81
import random
 
82
import shlex
82
83
 
83
84
import dbus
84
85
import dbus.service
103
104
    collections.abc = abc
104
105
    del abc
105
106
 
 
107
# Add shlex.quote if it does not exist
 
108
try:
 
109
    shlex.quote
 
110
except AttributeError:
 
111
    shlex.quote = re.escape
 
112
 
106
113
# Show warnings by default
107
114
if not sys.warnoptions:
108
115
    import warnings
136
143
if sys.version_info < (3, 2):
137
144
    configparser.Configparser = configparser.SafeConfigParser
138
145
 
139
 
version = "1.8.9"
 
146
version = "1.8.12"
140
147
stored_state_file = "clients.pickle"
141
148
 
142
149
logger = logging.getLogger()
1127
1134
        if self.checker is None:
1128
1135
            # Escape attributes for the shell
1129
1136
            escaped_attrs = {
1130
 
                attr: re.escape(str(getattr(self, attr)))
 
1137
                attr: shlex.quote(str(getattr(self, attr)))
1131
1138
                for attr in self.runtime_expansions}
1132
1139
            try:
1133
1140
                command = self.checker_command % escaped_attrs