/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: 2016-03-02 16:45:38 UTC
  • Revision ID: teddy@recompile.se-20160302164538-n9ocll4izthzw1ov
Ignore any error from initramfs-tools' "configure_networking".

* initramfs-tools-script: Wrap call to "configure_networking" with
  "set +e" and "set -e", since configure_networking was not designed
  to run in a "set -e" environment.

Closes: 816513
Thanks: Carlos Alberto Lopez Perez <clopez@igalia.com>
Thanks: Ben Hutchings <ben@decadent.org.uk>

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python2.7
 
1
#!/usr/bin/python
2
2
# -*- mode: python; coding: utf-8 -*-
3
3
4
4
# Mandos server - give out binary blobs to connecting clients.
11
11
# "AvahiService" class, and some lines in "main".
12
12
13
13
# Everything else is
14
 
# Copyright © 2008-2015 Teddy Hogeborn
15
 
# Copyright © 2008-2015 Björn Påhlsson
 
14
# Copyright © 2008-2016 Teddy Hogeborn
 
15
# Copyright © 2008-2016 Björn Påhlsson
16
16
17
17
# This program is free software: you can redistribute it and/or modify
18
18
# it under the terms of the GNU General Public License as published by
98
98
if sys.version_info.major == 2:
99
99
    str = unicode
100
100
 
101
 
version = "1.7.1"
 
101
version = "1.7.3"
102
102
stored_state_file = "clients.pickle"
103
103
 
104
104
logger = logging.getLogger()
151
151
    
152
152
    def __init__(self):
153
153
        self.tempdir = tempfile.mkdtemp(prefix="mandos-")
 
154
        self.gpg = "gpg"
 
155
        try:
 
156
            output = subprocess.check_output(["gpgconf"])
 
157
            for line in output.splitlines():
 
158
                name, text, path = line.split(":")
 
159
                if name == "gpg":
 
160
                    self.gpg = path
 
161
                    break
 
162
        except OSError as e:
 
163
            if e.errno != errno.ENOENT:
 
164
                raise
154
165
        self.gnupgargs = ['--batch',
155
 
                          '--home', self.tempdir,
 
166
                          '--homedir', self.tempdir,
156
167
                          '--force-mdc',
157
168
                          '--quiet',
158
169
                          '--no-use-agent']
197
208
                dir=self.tempdir) as passfile:
198
209
            passfile.write(passphrase)
199
210
            passfile.flush()
200
 
            proc = subprocess.Popen(['gpg', '--symmetric',
 
211
            proc = subprocess.Popen([self.gpg, '--symmetric',
201
212
                                     '--passphrase-file',
202
213
                                     passfile.name]
203
214
                                    + self.gnupgargs,
215
226
                dir = self.tempdir) as passfile:
216
227
            passfile.write(passphrase)
217
228
            passfile.flush()
218
 
            proc = subprocess.Popen(['gpg', '--decrypt',
 
229
            proc = subprocess.Popen([self.gpg, '--decrypt',
219
230
                                     '--passphrase-file',
220
231
                                     passfile.name]
221
232
                                    + self.gnupgargs,