| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
File descriptors are represented as the C int type, but only non-negative
values represent a valid fd, with all negative values representing the
absence of a fd (a NULL-like value).
Previously, make_fd() accepted negative fds, but then UnixFd_tp_new
would crash with an assertion failure. Instead, range-check the value
according to the semantically valid range. If it isn't, raise the same
error we previously raised for values that don't fit in an int.
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the D-Bus wire protocol, the representation of a Unix fd is a simple
integer in the message body (referred to as the "handle" in GDBus)
which acts as an index into the array of out-of-band fds attached to
the message. The libdbus API (and therefore the dbus-python API)
automatically translates handles into fds, but the GDBus API does not,
making it possible for a GDBus sender to send a message containing
handles that are out-of-range for the number of attached fds. The
message bus also does not prevent such messages from being sent.
dbus-python services need to cope with this and fail gracefully while
unpacking the message, rather than crashing with an assertion failure
in UnixFd_tp_new when the fd turns out to be invalid.
Resolves: https://github.com/firewalld/firewalld/issues/985
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
| |
|
|
|
|
| |
get_allow_interactive_authorization for message
add unit tests
|
| |
|
|
|
|
|
|
| |
Python 2 reached EOL on 2020-01-01, and the latest version of
AX_PYTHON_DEVEL breaks the build with Python 2. This seems as good a
time as any to drop compatibility.
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
| |
|
|
| |
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
| |
|
|
|
|
| |
Found by Coverity.
Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=1938703
|
| |
|
|
|
|
|
|
| |
Python 3.8 removes the tp_str for various built-in types, so we would
print Double values as their repr (for example dbus.Double(0.5)), which
is a regression. Print them as 0.5 instead.
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
| |
|
|
|
|
|
|
|
|
| |
Python 3.8 removes the tp_str for various built-in types, so we would
print Boolean values as their repr (for example dbus.Boolean(True)),
which is a regression. Print them as 0 or 1 instead, which was the
historical behaviour (arguably False or True would be better, but
that would be a behaviour change).
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
| |
|
|
|
|
|
|
|
|
| |
Python 3.8 removes the tp_str for various built-in types, so we would
print long-derived values as their repr (for example dbus.Int64(42)),
which is a regression. Print them as 42 instead.
Co-authored-by: matclab <mathieu@clabaut.net>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Fixes: https://gitlab.freedesktop.org/dbus/dbus-python/issues/31
|
| |
|
|
|
|
|
|
|
|
| |
Saving and restoring the exception indicator breaks users of dbus-python
that rely on being able to raise SystemExit (or call sys.exit()) from a
dbus-python method, such as libsecret's test suite.
This reverts commit dbc0f7ef463922c026f1183a07368aa61ffe98dc.
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
| |
|
|
| |
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
| |
|
|
| |
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
| |
|
|
| |
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
| | |
|
| |
|
|
|
|
|
|
|
| |
Casting via void (*)(void) is the documented way to suppress this
warning. This is required because the CPython API treats function
pointers as generic, with flags to indicate different calling
conventions.
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
| |
|
|
|
|
|
| |
This has apparently never actually done anything in the Python 3
series.
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
| |
|
|
| |
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
| |
|
|
| |
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
| |
|
|
| |
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
| |
|
|
| |
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
| |
|
|
| |
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
|
|
Python warns that it is not importing these directories because they
contain no __init__.py.
Signed-off-by: Simon McVittie <smcv@collabora.com>
|