Age | Commit message (Collapse) | Author |
|
|
|
We replace the idiom "X && !(*foo = 0)" with "X && ((*foo = 0), true)".
This is not a functional change, but should hopefully make it less
likely that people and static analyzers believe there is a typo here
(i.e., to make it clear that the intention was not "X && *foo != 0").
Thanks to David Herrmann for the suggestion.
|
|
Both as documentation, and to make Coverity happy.
Fixes CID #1241495 and #1241496.
|
|
|
|
This commit introduces possibility to call parse_env_file_internal() and hand
over extra argument where we will accumulate how many items were successfully
parsed and pushed by callback. We make use of this in parse_env_file() and
return number of parsed items on success instead of always returning zero.
As a side-effect this commit should fix bug that locale settings in
/etc/locale.conf are not overriden by options passed via kernel command line.
|
|
Instead of operating on an sd_bus_message object, expose an API that has 4
functions:
policy_check_own()
policy_check_hello()
policy_check_recv()
policy_check_send()
This also allows dropping extra code to parse message contents - the bus
proxy already has dedicated code paths for that, and we can hook into
those later.
Tests amended accordingly.
|
|
strerror_r does not return null here and even if it did we would have
problems already at the preceding strlen call.
Found by coverity. Fixes: CID#1237770
|
|
Allow users to query the display dimensions of a grdev_display. This is
required to properly resize the objects to be rendered.
|
|
Make sure the kernel always returns events properly. This is guaranteed
right now, otherwise, we do something really wrong. But lets be sure and
verify the received values properly. This also silences some coverity
warnings.
|
|
We used to set "pipe->tile = tile" inside of the leaf allocation. We no
longer do that. Verify that "out" is non-NULL, otherwise we'd leak memory.
This is currently always given, but make sure to add an assert(), so
coverity does not complain.
|
|
Binary operators with two pointers as arguments always operate on
object-size, not bytes. That is, "int *a, *b", (a - b) calculates the
number of integers between b and a, not the number of bytes.
Fix our cache-offset calculation to not use sizeof() with full-ptr
arithmetic.
|
|
This adds some log-messages to ioctl() calls where we don't really care
for the return value. It isn't strictly necessary to look for those, but
lets be sure and print warnings. This silences gcc and coverity, and also
makes sure we get reports in case something goes wrong and we didn't
expect it to fail that way.
|
|
|
|
Just a rename of two struct members to make the header file c++ compatible.
|
|
Other functions in this file follow this pattern,
we have vconsole_write_data and locale_write_data.
|
|
src/shared/label.c:255:15: warning: unused variable 'l' [-Wunused-variable]
char *l = NULL;
^
|
|
|
|
https://bugs.freedesktop.org/show_bug.cgi?id=84201
|
|
The kdbus logic name registry logic was changed to transport the actual
name to acquire, release or report in a kdbus item.
This brings the name API a little more in line with other calls, and allows
for later augmentation.
Follow that change on the systemd side.
|
|
Lets not unnecessarily rely on __WORDSIZE, which is not clearly specified
by any spec. Use explicit size comparisons if we're not interested in the
WORDSIZE, anyway.
(David: adjust commit message to explain why we do this)
|
|
Now that we no longer propagate callback return values, we can safely call
into user-callbacks during sysview_context_stop(). This way, users can
rely on all objects to be removed via callbacks (except if they failed
during object creation). This avoids duplicating any object hashtables on
the users' side and reduces memory consumption.
|
|
We cannot sanely propagate error codes if we call into user-callbacks
multiple times for multiple objects. There is no way to merge those errors
or somehow propagate them.
However, we can just act similar to sd-event and print a log-message while
discarding the values. This way, we allow error-returns, but can properly
continue working on our objects.
|
|
Add "userdata" storage to a bunch of external objects, namely displays and
sessions. Furthermore, add some property retrieval helpers.
This is required if we want external API users to not duplicate our own
object hashtables, but retrieve context from the objects themselves.
|
|
Instead of adding matches per device, we now add logind matches per
session. This reduces the number of matches considerably and saves
resources.
|
|
|
|
|
|
The desktop brand is stored as DESKTOP variable for sessions. It can be
set arbitrarily by the session owner and identifies the desktop
environment that is running on that session.
|
|
All kdbus ioctl arguments must be 8byte aligned. Make sure we use
alloca_align() and _alignas_(8) in all situations where gcc doesn't
guarantee 8-byte alignment.
Note that objects on the stack are always 8byte aligned as we put
_alignas_(8) into the structure definition in kdbus.h.
|
|
The alloca_align() helper is the alloca() equivalent of posix_memalign().
As there is no such function provided by glibc, we simply account for
additional memory and return a pointer offset into the allocated memory to
grant the alignment.
Furthermore, alloca0_align() is added, which simply clears the allocated
memory.
|
|
Properly free all temporary resources to make valgrind not complain about
lost records.
|
|
Instead of raising DEVICE_CHANGE only per device, we now raise it per
device-session attachment. This is what we want for all sysview users,
anyway, as sessions are meant to be independent of each other. Lets avoid
any external session iterators and just do that in sysview itself.
|
|
Whenever we resync an evdev device (or disable it), we should send RESYNC
events to the linked upper layers. This allows to disable key-repeat and
assume some events got dropped.
|
|
The current pause/resume logic kinda intertwines the resume/pause and
enable/disable functions. Lets avoid that non-obvious behavior and always
make resume call into enable, and pause call into disable, if appropriate.
|
|
Whenever a key-event is part of a RESYNC, we should print that verbosely
as those events are out-of-order.
|
|
Add some test files and routines for dbus policy checking.
|
|
Add policy_check() to actually check whether an incoming message is allowed
by the policy. The code is not yet used from the proxy daemon, though.
|
|
|
|
This function is quite useful for debugging. Exiting from it seems
unnecessary.
|
|
Instead of making the function call itself recursively.
|
|
Do the lookup during parsing already, and set i->uid, or i->gid to the
numerical values.
|
|
|
|
In the D-Bus policy, the order of items matters, so make sure to store them
in the same order as they are parsed by the sax parser.
|
|
|
|
We now verify the existence of uid's before applying them to devicenodes, so change the
test accordingly. We assume that both uid/gid 1 and 2 exist on the test system.
|
|
The GETXY ioctls of DRM are usually called twice by libdrm: Once to
retrieve the number of objects, a second time with suitably sized buffers
to actually retrieve all objects. In grdrm, we avoid these excessive calls
and instead just call ioctls with cached buffers and resize them if they
were too small.
However, connectors need to read the mode list via EDID, which is horribly
slow. As the kernel still cannot do that asynchronously (seriously, we
need to fix this!), it has a hack to only do it if count_modes==0. This is
fine with libdrm, as it calls every ioctl twice, anyway. However, we fail
horribly with this as we usually never pass 0.
Fix this by calling into GETCONNECTOR ioctls twice in case we received an
hotplug event. Only in those cases, we need to re-read modes, so this
should be totally fine.
|
|
Multiple issues here:
1) Don't print excessive card dumps on each resync. Disable it and make
developers add it themselves.
2) Ignore EINVAL on page-flips. Some cards don't support page-flips, so
we'd print it on each frame. Maybe, at some point, the kernel will add
support to retrieve capabilities for that. Until then, simply ignore
it.
3) Replace the now dropped card-dump with a short message about resyncing
the card.
|
|
Whenever we cannot use hardware frame events, we now schedule a virtual
frame event to make sure applications don't have to do this. Usually,
applications render only on data changes, but we can further reduce
render-time by also limiting rendering to vsyncs.
|
|
Whenever a display is added or changed, we suppressed any frame events.
Make sure to raise them manually so we can avoid rendering when handling
anything but FRAME events.
|
|
This helper is quite huge, split it apart to make it easier to follow.
|
|
Whenever we get udev hotplug events, re-read the device state so we
properly detect any changed in the display setups.
|