/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-03-14 03:22:36 UTC
  • Revision ID: teddy@recompile.se-20200314032236-ea0oko1tlyuzyzye
dracut-module/password-agent.c: Skip flaky test on non-AMD64

It is difficult to find a suitable buffer size large enough to
predictably make send() fail with EMSGSIZE on a PF_LOCAL socket, while
still being small enough to reliably malloc() twice on any platform
and in any environment.  The existing size was experimentally
determined on AMD64; skip the test for all other platforms.

* dracut-module/password-agent.c
  (test_send_password_to_socket_EMSGSIZE): Skip this test on non-AMD64
  platforms.

Closes: 953799
Reported-by: Michael Biebl <biebl@debian.org>

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
94
95
    __metaclass__ = type
95
96
    str = unicode
96
97
 
 
98
# Add collections.abc.Callable if it does not exist
 
99
try:
 
100
    collections.abc.Callable
 
101
except AttributeError:
 
102
    class abc:
 
103
        Callable = collections.Callable
 
104
    collections.abc = abc
 
105
    del abc
 
106
 
 
107
# Add shlex.quote if it does not exist
 
108
try:
 
109
    shlex.quote
 
110
except AttributeError:
 
111
    shlex.quote = re.escape
 
112
 
97
113
# Show warnings by default
98
114
if not sys.warnoptions:
99
115
    import warnings
1118
1134
        if self.checker is None:
1119
1135
            # Escape attributes for the shell
1120
1136
            escaped_attrs = {
1121
 
                attr: re.escape(str(getattr(self, attr)))
 
1137
                attr: shlex.quote(str(getattr(self, attr)))
1122
1138
                for attr in self.runtime_expansions}
1123
1139
            try:
1124
1140
                command = self.checker_command % escaped_attrs
2748
2764
        if command == 'getattr':
2749
2765
            attrname = request[1]
2750
2766
            if isinstance(client_object.__getattribute__(attrname),
2751
 
                          collections.Callable):
 
2767
                          collections.abc.Callable):
2752
2768
                parent_pipe.send(('function', ))
2753
2769
            else:
2754
2770
                parent_pipe.send((