<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libevdev.git/libevdev/libevdev-uinput.c, branch libevdev-1.3</title>
<subtitle>gitlab.freedesktop.org: libevdev/libevdev.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/'/>
<entry>
<title>uinput: explicitly ignore the UI_DEV_DESTROY return value</title>
<updated>2014-08-24T23:54:28+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-08-22T01:47:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=6247e5c12a6b1df5a0a68ea1beeddb48b9f7a495'/>
<id>6247e5c12a6b1df5a0a68ea1beeddb48b9f7a495</id>
<content type='text'>
This can't fail in the kernel anyway, so cast it to shut up Coverity.
Error message:
"Calling function "ioctl(int, unsigned long, ...)" without checking return
 value (as is done elsewhere 35 out of 36 times)."

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This can't fail in the kernel anyway, so cast it to shut up Coverity.
Error message:
"Calling function "ioctl(int, unsigned long, ...)" without checking return
 value (as is done elsewhere 35 out of 36 times)."

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uinput: close the managed fd on error</title>
<updated>2014-08-22T01:50:13+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-08-22T01:42:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=53958c56cd486378800fe2db247fd7923a73cf6a'/>
<id>53958c56cd486378800fe2db247fd7923a73cf6a</id>
<content type='text'>
Using LIBEVDEV_UINPUT_OPEN_MANAGED can leak the fd if an error occurs after
opening it.

Found by Coverity.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using LIBEVDEV_UINPUT_OPEN_MANAGED can leak the fd if an error occurs after
opening it.

Found by Coverity.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uinput: preserve the errno before cleaning up</title>
<updated>2014-08-14T22:37:30+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-08-12T05:41:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=debe9b030c8069cdf78307888ef3b65830b25122'/>
<id>debe9b030c8069cdf78307888ef3b65830b25122</id>
<content type='text'>
libevdev_uinput_destroy() may/will botch the errno, make sure we save it
before use.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
libevdev_uinput_destroy() may/will botch the errno, make sure we save it
before use.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uinput: check errno against the positive value</title>
<updated>2014-08-14T22:37:26+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-08-12T05:38:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=09529a6a65e5f6eb8f2e10b8da013929c83ad314'/>
<id>09529a6a65e5f6eb8f2e10b8da013929c83ad314</id>
<content type='text'>
We use the negative errno internally, but the proper errno is always positive.

Fixes device creation failures on kernels that don't support UI_SET_PROPBIT.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We use the negative errno internally, but the proper errno is always positive.

Fixes device creation failures on kernels that don't support UI_SET_PROPBIT.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uinput: change strcpy/strcat usage for snprintf</title>
<updated>2014-06-20T01:00:16+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-06-19T04:20:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=734aadb4871c6190328fc70f88931fe896df4de5'/>
<id>734aadb4871c6190328fc70f88931fe896df4de5</id>
<content type='text'>
Better protection against buffer overflow, though by the time someone
is manipulating your sysfs, libevdev is unlikely to be the biggest worry.

Slight change in functionality: before we checked the timestamp of
/sys/devices/virtual/input/inputXYZ before looking at /inputXYZ/name, now we
just check the name file for the timestamp.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Better protection against buffer overflow, though by the time someone
is manipulating your sysfs, libevdev is unlikely to be the biggest worry.

Slight change in functionality: before we checked the timestamp of
/sys/devices/virtual/input/inputXYZ before looking at /inputXYZ/name, now we
just check the name file for the timestamp.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uinput: use the UI_GET_SYSNAME ioctl if available</title>
<updated>2014-06-20T00:58:46+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-06-19T04:10:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=2ff45c73a1ce5577a4a06cf255a394d3c93d0915'/>
<id>2ff45c73a1ce5577a4a06cf255a394d3c93d0915</id>
<content type='text'>
Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add per-device log handlers</title>
<updated>2014-06-05T05:16:06+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-05-14T06:36:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=93bc9a329d622fe28aae101710163fae6f03850c'/>
<id>93bc9a329d622fe28aae101710163fae6f03850c</id>
<content type='text'>
The global log handler isn't a good choice for a low-level library. In the
caser of the X server, both evdev and synaptics are now using the libevdev but
are loaded from the same server process. Thus, there's only one log handler,
but evdev and synaptics don't talk to each other (a bit childish, I know).

Add a per-device log handler that overrides the global log handler, and fall
back to the global log handler if no device log handler is set. The log
macros take care of that automatically, especially as we can't do per-device
log handlers for the uinput code.

Note that we use the same struct for the global and device logging, so in each
instance one of the two function pointers is NULL. Suicide triggers are in
place in case we mess that up.

This also makes libevdev_new_from_fd() a bit less useful since we can't set
the log handler beforehand.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The global log handler isn't a good choice for a low-level library. In the
caser of the X server, both evdev and synaptics are now using the libevdev but
are loaded from the same server process. Thus, there's only one log handler,
but evdev and synaptics don't talk to each other (a bit childish, I know).

Add a per-device log handler that overrides the global log handler, and fall
back to the global log handler if no device log handler is set. The log
macros take care of that automatically, especially as we can't do per-device
log handlers for the uinput code.

Note that we use the same struct for the global and device logging, so in each
instance one of the two function pointers is NULL. Suicide triggers are in
place in case we mess that up.

This also makes libevdev_new_from_fd() a bit less useful since we can't set
the log handler beforehand.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Ignore NULL as argument in libevdev_uinput_destroy()</title>
<updated>2014-05-07T08:52:17+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-05-01T21:53:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=d0af7f2851b1d6b8d0aed79e9647ce0502388d07'/>
<id>d0af7f2851b1d6b8d0aed79e9647ce0502388d07</id>
<content type='text'>
Triggered by the tests when run as non-root. Simply ignore any attempt to
destroy a NULL device, which also matches the behaviour of libevdev_free().

Reported-by: Andreas Radke &lt;a.radke@arcor.de&gt;
Reviewed-by: Daniel Martin &lt;consume.noise@gmail.com&gt;
Tested-by: Daniel Martin &lt;consume.noise@gmail.com&gt;
Reviewed-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Triggered by the tests when run as non-root. Simply ignore any attempt to
destroy a NULL device, which also matches the behaviour of libevdev_free().

Reported-by: Andreas Radke &lt;a.radke@arcor.de&gt;
Reviewed-by: Daniel Martin &lt;consume.noise@gmail.com&gt;
Tested-by: Daniel Martin &lt;consume.noise@gmail.com&gt;
Reviewed-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>uinput: check for asprintf failure</title>
<updated>2014-03-18T23:36:41+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-03-18T03:55:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=f29008b758e82f9ba2d2f9627a680c952d44668b'/>
<id>f29008b758e82f9ba2d2f9627a680c952d44668b</id>
<content type='text'>
This doesn't really do much here, but strictly speaking: if asprintf returns
-1, devnode is undefined. So reset it to NULL to avoid weird pointers. And
also free the rest of the names if we ever have more than one device - which
also shouldn't happen.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This doesn't really do much here, but strictly speaking: if asprintf returns
-1, devnode is undefined. So reset it to NULL to avoid weird pointers. And
also free the rest of the names if we ever have more than one device - which
also shouldn't happen.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix memory leaks when failing to create a uinput device</title>
<updated>2014-02-27T03:22:50+00:00</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2014-02-27T01:29:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libevdev.git/commit/?id=fdf737494ed940d68ce68c52ee029417bb68c8ff'/>
<id>fdf737494ed940d68ce68c52ee029417bb68c8ff</id>
<content type='text'>
For an invalid fd, or a failure to open the device, the pre-allocated uinput
device struct would leak.

We can drop the open_uinput() function now, since skipping to the error
handling means we'll return -errno anyway.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For an invalid fd, or a failure to open the device, the pre-allocated uinput
device struct would leak.

We can drop the open_uinput() function now, since skipping to the error
handling means we'll return -errno anyway.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
