summaryrefslogtreecommitdiff
path: root/src/libudev
AgeCommit message (Collapse)Author
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>
2014-08-12udev: never bypass our own logging framework and call vsyslog() directly ↵Lennart Poettering
from udev tools Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-06src/libudev/libudev.sym: mark most symbols as hiddenAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05src/shared: refactor shared codeAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05src/{libudev,udev}: minor renamings from upstreamAnthony G. Basile
2014-08-05src/libudev/missing.h: clean up unused BTRFS_* declsAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-05Include missing.h in udev-builtin-btrfs.c, and move BTRFS_IOC_DEVICES_READY ↵Anthony G. Basile
to missing.h This is a combination of upstream commits dced15575f7bf172e3c9d798c43477539525558c 7bed7f0e3b1f9596aedb64657e432e5b267adebb by Simon McVittie <simon.mcvittie@collabora.co.uk> 7bed7f0e3b1f9596aedb64657e432e5b267adebb Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-04Reject invalid quoted stringsZbigniew Jędrzejewski-Szmek
String which ended in an unfinished quote were accepted, potentially with bad memory accesses. Reject anything which ends in a unfished quote, or contains non-whitespace characters right after the closing quote. _FOREACH_WORD now returns the invalid character in *state. But this return value is not checked anywhere yet. Also, make 'word' and 'state' variables const pointers, and rename 'w' to 'word' in various places. Things are easier to read if the same name is used consistently. mbiebl_> am I correct that something like this doesn't work mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-passwd "Unlock EncFS"' mbiebl_> systemd seems to strip of the quotes mbiebl_> systemctl status shows mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-password Unlock EncFS $RootDir $MountPoint mbiebl_> which is pretty weird Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-04Fix misuse of uint64_t as size_tZbigniew Jędrzejewski-Szmek
They have different size on 32 bit, so they are really not interchangable. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-08-04libudev: set errno when udev_device_new_from_* or udev_device_get_parent_* failTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-07-19Be more careful when checking for empty filesZbigniew Jędrzejewski-Szmek
If we want to avoid reading a totally empty file, it seems better to check after we have opened the file, not before. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>