summaryrefslogtreecommitdiff
path: root/src/libudev
AgeCommit message (Collapse)Author
2014-09-18udev: fix path for database names on 'change' eventRobert Milasan
If a device does not have a major/minor number attached, we use different database names than if it does. On "change" events, we didn't copy the devnum over, therefore, we used different paths than on 'add' or 'remove' events (where devnum was properly copied). Fix this by always copying the devnum into the udev-device. (David: added commit-log from email)
2014-09-18libudev: monitor - warn if we fail to request SO_PASSCREDTom Gundersen
The function still succeeds, so there is no functional change. This fixes CID #996288.
2014-09-16udev: util - use log_level_from_string()Tom Gundersen
2014-09-16libudev: util - drop util_delete_path()Tom Gundersen
Use rmdir_parents() from src/shared instead.
2014-09-16libudev: drop util_lookup_{user,group}Tom Gundersen
Use shared versions instead. Difference is with overwriting of repeated user/group name, and lack of logging.
2014-09-11udev: allow removing tags via TAG-="foobar"David Herrmann
This extends the udev parser to support OP_REMOVE (-=) and adds support for TAG-= to remove previously set tags. We don't fail if the tag didn't exist. This is pretty handy if we ship default rules for seat-assignments and users want to exclude specific devices from that. They can easily add rules that drop any automatically added "seat" tags again.
2014-09-09udev - drop print_kmsgTom Gundersen
The only remaining user was 'starting version XXX', which is now logged using log_info().
2014-08-30libudev: fix symbol version for udev_queue_flush() and udev_queue_get_fd()Michael Biebl
Those symbols were introduced in commit 14cb733684d3c3f50d088a3a370ddf8e8894dfa4 and released in v215.
2014-08-11udev: never bypass our own logging framework and call vsyslog() directly ↵Lennart Poettering
from udev tools
2014-08-03Fix misuse of uint64_t as size_tZbigniew Jędrzejewski-Szmek
They have different size on 32 bit, so they are really not interchangable.
2014-08-01Revert "libudev: use get_*_creds from shared rather than util_lookup_*"Tom Gundersen
This reverts commit a56ba6158b9649e01226dfaf3ff7082c82571090. The commit was pushed in error.
2014-08-01libudev: use get_*_creds from shared rather than util_lookup_*Tom Gundersen
2014-08-01libudev: set errno when udev_device_new_from_* or udev_device_get_parent_* failTom Gundersen
2014-06-27libudev: queue - watch entire directory to allow the re-use of the watch ↵Kay Sievers
descriptor
2014-06-27libudev: queue provide file descriptor to watch busy event queueKay Sievers
2014-06-27libudev: fix udev_queue_get_queue_is_empty() logicKay Sievers
2014-05-15Remove unnecessary casts in printfsZbigniew Jędrzejewski-Szmek
No functional change expected :)
2014-04-24udev: warn when name_to_handle_at is not implementedZbigniew Jędrzejewski-Szmek
We have a bunch of reports from people who have a custom kernel and are confused why udev is not running. Issue a warning on error. Barring an error in the code, the only error that is possible is ENOSYS. https://bugzilla.redhat.com/show_bug.cgi?id=1072966
2014-04-24util: make sure all our name_to_handle_at() code makes use of file_handle_unionLennart Poettering
2014-04-21implement a union to pad out file_handleDave Reisner
Cases where name_to_handle_at is used allocated the full struct to be MAX_HANDLE_SZ, and assigned this size to handle_bytes. This is wrong since handle_bytes should describe the length of the flexible array member and not the whole struct. Define a union type which includes sufficient padding to allow assignment of MAX_HANDLE_SZ to be correct.
2014-04-13udev: remove seqnum API and all assumptions about seqnumsKay Sievers
The way the kernel namespaces have been implemented breaks assumptions udev made regarding uevent sequence numbers. Creating devices in a namespace "steals" uevents and its sequence numbers from the host. It confuses the "udevadmin settle" logic, which might block until util a timeout is reached, even when no uevent is pending. Remove any assumptions about sequence numbers and deprecate libudev's API exposing these numbers; none of that can reliably be used anymore when namespaces are involved.
2014-02-13everywhere: make use of new0() and macro() macros, and stop using perror()Lennart Poettering
2014-01-31use memzero(foo, length); for all memset(foo, 0, length); callsGreg KH
In trying to track down a stupid linker bug, I noticed a bunch of memset() calls that should be using memzero() to make it more "obvious" that the options are correct (i.e. 0 is not the length, but the data to set). So fix up all current calls to memset(foo, 0, length) to memzero(foo, length).
2013-12-23libudev: ship the original MurmurHash2.[ch] fileKay Sievers
2013-12-19remove unused variableThomas Hindoe Paaboel Andersen
2013-12-18libudev: monitor - only disallow "udev" type eventsKay Sievers
2013-12-18libudev: disable monitor inside a containerKay Sievers
Uevents are events of the host, which should not leak into a container. Containers do not support hotplug at the moment, and devices and uevents are not namespace aware.
2013-12-18bus: catch up with kdbus changesKay Sievers
2013-12-18libudev: devices received from udev are always initializedKay Sievers
2013-12-14Add more _printf_'s for format-nonliteralsThomas Hindoe Paaboel Andersen
Clang is a bit more strict wrt format-nonliterals: http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking Adding these extra printf attributes also makes gcc able to find more problems. E.g. this patch uncovers a format issue in udev-builtin-path_id.c Some parts looked intetional about breaking the format-nonliteral check. I added some supression for warnings there.
2013-12-10libudev: hwdb - use libudev not systemd loggingKay Sievers
2013-11-30docs: remove unneeded the's in gudev docsZbigniew Jędrzejewski-Szmek
https://bugs.freedesktop.org/show_bug.cgi?id=72164
2013-11-20libudev: always return NULL in _unref() APIsLennart Poettering
Returning anything else but NULL would suggest the caller's reference might still be valid, but it isn't, because the caller just invoked _unref() after all. This turns the return value into a typesafe shortcut that allows unreffing and resetting a reference in one line. In contrast to solutions for this which take a pointer to a pointer to accomplish the same this solution is just syntactic sugar the developer can make use of but doesn't have to, and this is particularly useful when immediately unreffing objects returned by function calls.
2013-11-20libudev: always return valid negative error codes on API functionsLennart Poettering
2013-11-18Remove duplicate includesKarel Zak
2013-11-13udev: declare some symbols staticKay Sievers
2013-11-12udev: declare some symbols staticKay Sievers
2013-10-30libudev: default log_priority to INFOTom Gundersen
This brings it in sync with the default config file.
2013-10-16macro: clean up usage of gcc attributesLennart Poettering
Always use our own macros, and name all our own macros the same style.
2013-10-15build-sys: libudev - get rid of the needless selinux linking (again)Kay Sievers
2013-10-13Never call qsort on potentially NULL arraysZbigniew Jędrzejewski-Szmek
This extends 62678ded 'efi: never call qsort on potentially NULL arrays' to all other places where qsort is used and it is not obvious that the count is non-zero.
2013-09-19device-nodes: move device node specific code to own fileDave Reisner
In the process, rename udev_encode_string which is poorly named for what it does. It deals specifically with encoding names that udev creates and has its own rules: utf8 is valid but some ascii is not (e.g. path separators), and everything else is simply escaped. Rename it to encode_devnode_name.
2013-09-17libudev: add missing 'global' to symbol exportKay Sievers
2013-09-17move utf8 functions from libudev-private.h to utf8.hDave Reisner
There's now some more obvious overlap amongst the two utf8 validation functions, but no more than there already was previously. This also adds some menial tests for anyone who wants to do more merging of these two in the future.
2013-09-13libudev: fix move_later comparisonLukas Nykryn
At the beginning move_later is set to -1, but it is set to different value only if expression !move_later is true.
2013-09-04libudev: enumerate - do not try to match against an empty subsystemKay Sievers
2013-09-04libudev: enumerate: fix NULL-deref for subsystem-matchesDavid Herrmann
udev_device_get_subsystem() may return NULL if no subsystem could be figured out by libudev. This might be due to OOM or if the device disconnected between the udev_device_new() call and udev_device_get_subsystem(). Therefore, we need to handle subsystem==NULL safely. Instead of testing for it in each helper, we treat subsystem==NULL as empty subsystem in match_subsystem(). Backtrace of udev_enumerate with an input-device disconnecting in exactly this time-frame: (gdb) bt #0 0x00007ffff569dc24 in strnlen () from /usr/lib/libc.so.6 #1 0x00007ffff56d9e04 in fnmatch@@GLIBC_2.2.5 () from /usr/lib/libc.so.6 #2 0x00007ffff5beb83d in match_subsystem (udev_enumerate=0x7a05f0, subsystem=0x0) at src/libudev/libudev-enumerate.c:727 #3 0x00007ffff5bebb30 in parent_add_child (enumerate=enumerate@entry=0x7a05f0, path=<optimized out>) at src/libudev/libudev-enumerate.c:834 #4 0x00007ffff5bebc3f in parent_crawl_children (enumerate=enumerate@entry=0x7a05f0, path=0x7a56b0 "/sys/devices/<shortened>/input/input97", maxdepth=maxdepth@entry=254) at src/libudev/libudev-enumerate.c:866 #5 0x00007ffff5bebc54 in parent_crawl_children (enumerate=enumerate@entry=0x7a05f0, path=0x79e8c0 "/sys/devices/<shortened>/input", maxdepth=maxdepth@entry=255) at src/libudev/libudev-enumerate.c:868 #6 0x00007ffff5bebc54 in parent_crawl_children (enumerate=enumerate@entry=0x7a05f0, path=path@entry=0x753190 "/sys/devices/<shortened>", maxdepth=maxdepth@entry=256) at src/libudev/libudev-enumerate.c:868 #7 0x00007ffff5bec7df in scan_devices_children (enumerate=0x7a05f0) at src/libudev/libudev-enumerate.c:882 #8 udev_enumerate_scan_devices (udev_enumerate=udev_enumerate@entry=0x7a05f0) at src/libudev/libudev-enumerate.c:919 #9 0x00007ffff5df8777 in <random_caller> () at some/file.c:181
2013-09-04libudev: fix memleak when enumerating childsDavid Herrmann
We need to free udev-devices again if they don't match. Funny that no-one noticed it yet since valgrind is quite verbose about it. Fix it and free non-matching devices.
2013-08-19libudev-enumerate.c:udev_enumerate_get_list_entry() fixed possible stale pointerHarald Hoyer
If a realloc() happens in syspath_add(), the move_later pointer could point to an invalid memory region. Let move_later store the array index, instead of the pointer to the entry.
2013-08-15typo fixes in man and commentsThomas Hindoe Paaboel Andersen