/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-02-05 21:39:28 UTC
  • Revision ID: teddy@recompile.se-20200205213928-vpvt0fwfg47ikv6f
Allow users to alter ask-password-mandos.service

If a user uses dracut with systemd and wishes to modify the options
passed to password-agent(8mandos) or mandos-client(8mandos), they
should be able to do so by simply creating a file
/etc/systemd/system/ask-password-mandos.service.d/override.conf,
containing, for instance:

[Service]
Environment=MANDOS_CLIENT_OPTIONS=--debug

Adding PASSWORD_AGENT_OPTIONS should also be possible (but should not
normally be needed).

* dracut-module/ask-password-mandos.service ([Service]/ExecStart): Add
  $PASSWORD_AGENT_OPTIONS before "--" and "$MANDOS_CLIENT_OPTIONS" to
  end of line.
* dracut-module/module-setup.sh (install): Install all files named
  /etc/systemd/system/ask-password-mandos.service.d/*.conf if any
  exists.  Also add --dh-params before $MANDOS_CLIENT_OPTIONS instead
  of at end of line.

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
import collections
79
79
import codecs
80
80
import unittest
 
81
import random
81
82
 
82
83
import dbus
83
84
import dbus.service
91
92
 
92
93
if sys.version_info.major == 2:
93
94
    __metaclass__ = type
 
95
    str = unicode
94
96
 
95
97
# Show warnings by default
96
98
if not sys.warnoptions:
122
124
            # No value found
123
125
            SO_BINDTODEVICE = None
124
126
 
125
 
if sys.version_info.major == 2:
126
 
    str = unicode
127
 
 
128
127
if sys.version_info < (3, 2):
129
128
    configparser.Configparser = configparser.SafeConfigParser
130
129
 
1037
1036
        if self.checker_initiator_tag is not None:
1038
1037
            GLib.source_remove(self.checker_initiator_tag)
1039
1038
        self.checker_initiator_tag = GLib.timeout_add(
1040
 
            int(self.interval.total_seconds() * 1000),
 
1039
            random.randrange(int(self.interval.total_seconds() * 1000
 
1040
                                 + 1)),
1041
1041
            self.start_checker)
1042
1042
        # Schedule a disable() when 'timeout' has passed
1043
1043
        if self.disable_initiator_tag is not None:
1413
1413
                raise ValueError("Byte arrays not supported for non-"
1414
1414
                                 "'ay' signature {!r}"
1415
1415
                                 .format(prop._dbus_signature))
1416
 
            value = dbus.ByteArray(b''.join(chr(byte)
1417
 
                                            for byte in value))
 
1416
            value = dbus.ByteArray(bytes(value))
1418
1417
        prop(value)
1419
1418
 
1420
1419
    @dbus.service.method(dbus.PROPERTIES_IFACE,