summaryrefslogtreecommitdiff
path: root/src/libudev
AgeCommit message (Collapse)Author
2015-04-12libudev-util: check length before accesing the arrayThomas Hindoe Paaboel Andersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-04-12libudev: monitor - improve loggingTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-27Remove hardcoded path /run and configure using --with-rootrundir=David Cortarello
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-19src/libudev/Makefile.am: bump libudev revision to 2Anthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18libudev: private - introduce udev_device_new_from_synthetic_event()Tom Gundersen
This allows set_action(), read_uevent_file() and read_db() to be made internal to libudev. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18libudev-monitor: use initializationZbigniew Jędrzejewski-Szmek
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18udev: downgrade "has devpath" and "filled with db file" messagesZbigniew Jędrzejewski-Szmek
Udev debug messages have to be significantly overhauled... For now just downgrade those two. They are responsible for approximately 25% of debug output during boot and are rather useless. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18udev: make set_usec_initialized() internal to libudevTom Gundersen
Instead introduce ensure_usec_initialized(), which copies the timestamp if possible otherwise sets it to now(CLOCK_MONOTONIC). Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18libudev: introduce clone_with_db()Tom Gundersen
This allows us to move the db reading from udevd to libudev. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18libudev: monitor - fix error path in send_deviceTom Gundersen
Return -errno rather than -1 in case sendmsg() fails. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18udevd: event - make db loading lazy in REMOVE event handlingTom Gundersen
We were explicitly eagerly loading the db, then deletenig the backing file and then processing the rules/symlinks. Instead we delete the backnig db file as the last step and let the db loading be lazy as everywhere else. This may save us a bit of work in casese where the db is not needed, but more importantly it hides some implementation details of libudev-device form udevd. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18libudev: introduce udev_device_properties_copy()Tom Gundersen
To copy properties from one device to another. Drop the equivalent functionality from udevd. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18libudev: private - make property_from_string_parse* staticTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18libudev: udev_device_read_db - drop unused argumentTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18libudev: udev_device_add_property - implicitly mark properties for saving to dbTom Gundersen
Note: We also ported touch() and touch_file() from upstream. -AGB. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18udev/libudev: event - move {OLD_,}INTERFACE handling from udevd to libudevTom Gundersen
This should be internal to the library as it is only about reflecting the sysfs state in the udev_device. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-11Minor cleanupsAnthony G. Basile
2015-02-11libudev: private - drop some functions from the internal APITom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-11udev: event - move renaming of udev_device to libudevTom Gundersen
This is not exposed in the public API. We want to simplify the internal libudev-device API as much as possible so that it will be simpler to rip the whole thing out in the future. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-08libudev: monitor - move nulstr parsing to libudev-deviceTom Gundersen
Hide the details a bit. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-08udev: event - introduce and use internal udev_device_shallow_clone()Tom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-25Add initialization helper for file_handle_unionZbigniew Jędrzejewski-Szmek
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-25libudev: fix check for too long packetTopi Miettinen
Don't use recvmsg(2) return value to check for too long packets (it doesn't work) but MSG_TRUNC flag. (David: add parantheses around condition) Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-25Assorted format fixesZbigniew Jędrzejewski-Szmek
Types used for pids and uids in various interfaces are unpredictable. Too bad. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-29libudev: fix strict aliasing violationShawn Paul Landden
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17use correct format typesThomas Hindoe Paaboel Andersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-04libudev: set errno properly in all error conditions of ↵Lennart Poettering
udev_device_new_from_syspath() Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01treewide: another round of simplificationsMichal Schmidt
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications". Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-30treewide: drop unnecessary trailing \n in log_*() callsMichal Schmidt
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-16src/udev: update the definition of udev_event_execute_ruleAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-14udev: switch to systemd logging functionsKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-14udev: use the systemd logging functions in udev toolsKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-07src/libudev/libudev-hwdb.c: update error messageAnthony G. Basile
2014-11-02libudev: Use correct free functionColin Walters
FILE * wants cleanup_fclose(). Spotted by udev hwdb segfaulting in gnome-continuous' buildroot construction. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-02Use log "level" instead of "priority"Zbigniew Jędrzejewski-Szmek
The term "priority" is misleading because higher levels have lower priority. "Level" is clearer and shorter. This commit touches only the textual descriptions, not function and variable names themselves. "Priority" is used in various command-line switches and protocol constants, so completly getting rid of "priority" is hard. I also left "priority" in various places where the clarity suffered when it was removed. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-02libudev: do not accept invalid log levelsZbigniew Jędrzejewski-Szmek
Invalid log levels lead to a assert failure later on. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-02libudev: modernizationZbigniew Jędrzejewski-Szmek
This brings udev logging style a bit closer to normal systemd convention. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18src: minor code cleanupAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
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) Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
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. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18src/shared: import upstream code needed for recent commitsAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-17udev: util - use log_level_from_string()Tom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-17libudev: util - drop util_delete_path()Tom Gundersen
Use rmdir_parents() from src/shared instead. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-17libudev: drop util_lookup_{user,group}Tom Gundersen
Use shared versions instead. Difference is with overwriting of repeated user/group name, and lack of logging. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-13udev: 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. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-10udev - drop print_kmsgTom Gundersen
The only remaining user was 'starting version XXX', which is now logged using log_info(). Basile: There were also print_kmsg in udev-event.c which I switched to log_info(). Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-10libudev: 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. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-03src/libudev/Makefile.am: link libudev against selinuxAmadeusz Sławiński
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-22configure.ac and src/libudev/Makefile.am: bump to 1.10 = upstream 216Anthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>