<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:peter.hutterer@who-t.net" title="Peter Hutterer <peter.hutterer@who-t.net>"> <span class="fn">Peter Hutterer</span></a>
</span> changed
<a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - Provide a udev handle from the libinput device"
href="https://bugs.freedesktop.org/show_bug.cgi?id=85573">bug 85573</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>ASSIGNED
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>peter.hutterer@who-t.net
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - Provide a udev handle from the libinput device"
href="https://bugs.freedesktop.org/show_bug.cgi?id=85573#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - Provide a udev handle from the libinput device"
href="https://bugs.freedesktop.org/show_bug.cgi?id=85573">bug 85573</a>
from <span class="vcard"><a class="email" href="mailto:peter.hutterer@who-t.net" title="Peter Hutterer <peter.hutterer@who-t.net>"> <span class="fn">Peter Hutterer</span></a>
</span></b>
<pre>Main question here: better to get the udev_device handle directly, or the
device node and leave the rest up to the caller?
What are the side-effects to each approach?.
If libinput caches the udev_device handle and returns that, there's some odd
case where dropping privileges in the caller may give a device the caller does
not have access to anymore (struggling to find a use-case for that though,
since it would also break hotplugging).
If the cached handle is returned, a buggy caller could call udev_device_unref
too often and cause a (hard to debug) segfault in libinput. I'd consider that a
normal bug though, can be avoided by returning a new handle for the device.
If a new handle is returned, the code isn't much different than returning the
device node, other than adding another udev dependency on the API. The path
backend uses udev internally, but returning the device node would be simple
enough.
Any new, uncached handle can suffer from race conditions if the device
disappears. Not much different to normal error handling though.
Not all devices may have a udev handle, but then again not all devices have a
device node.
Comments, more things to think about?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>