summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2015-03-18libudev-monitor: use initializationZbigniew Jędrzejewski-Szmek
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18selinux: fix SEGV during switch-root if SELinux policy loadedWill Woods
If you've got SELinux policy loaded, label_hnd is your labeling handle. When systemd is shutting down, we free that handle via mac_selinux_finish(). But: switch_root() calls mkdir_p_label(), which tries to look up a label using that freed handle, and so we get a bunch of garbage and eventually SEGV in libselinux. (This doesn't happen in the switch-root from initramfs to real root because there's no SELinux policy loaded in initramfs, so label_hnd is NULL and we never attempt any lookups.) So: make sure that mac_selinux_finish() actually sets label_hnd to NULL, so nobody tries to use it after it becomes invalid. https://bugzilla.redhat.com/show_bug.cgi?id=1185604 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18Check that EWOULDBLOCK is the same as EAGAINZbigniew Jędrzejewski-Szmek
It certainly is everywhere on Linux, but as a courtesy to people doing some strange cross-compilation, check that the assumption holds. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18Replace ENOTSUP with EOPNOTSUPPAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18udev-ctrl: fix strict aliasing issuesShawn Landden
it is ironic that "The only purpose of this structure is to cast the structure pointer passed in addr in order to avoid compiler warnings. See EXAMPLE below." from bind(2) 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: properly calculate size of remaining dataZbigniew Jędrzejewski-Szmek
The data comes from the kernel, so chances of it being garbled are low, but for correctness' sake, add the check. CID #996458. 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-18path-util: fix path_is_mount_point() for symlinksHarald Hoyer
path_is_mount_point() compares the mount_id of a directory and the mount_id of the parent directory. When following symlinks, the function to get the parent directory does not take the symlink into account. /bin -> /usr/bin with /usr being a mountpoint: mount_id of /bin with AT_SYMLINK_FOLLOW != mount_id of / Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18udevd: improve handling of failed workerTom Gundersen
The information in the db is stale, so it does not make sense to expose it any longer. Also, don't drop the kernel event, but simply pass it on to userspace without ammending it. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18udevd: don't free event when killing the worker, wait until it has been reapedTom Gundersen
This will allow us to clean up the device when we are notified about the worker being killed. 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-18udev: add SYSCTL{} supportKay Sievers
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: add missing hunksTom Gundersen
This should have been committed with udev_device_add_property - implicitly mark properties for saving to db 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-03-18udev: simplify event_queue_update() and add debug loggingTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18udev: use inttypes.h types wherever appropriateLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18tree-wide: use _packed_ macro instead of raw gcc __attribute__Lennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18udevd: close race in udev settleTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18v4l_id: use standard option parsing loopZbigniew Jędrzejewski-Szmek
Not terribly important, but the loop wasn't an actual loop, making coverity unhappy. CID #1261725. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-18shared: import close_many() from upstreamAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-03-01shared: introduce cmsg_close_all() callLennart Poettering
The call iterates through cmsg list and closes all fds passed via SCM_RIGHTS. This patch also ensures the call is used wherever appropriate, where we might get spurious fds sent and we should better close them, then leave them lying around. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-11src/udev/udev-event.c: clean up net if renaming codeAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-11src/udev/udev-builtin.c: remove legacy optional keymapAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-11src/udev/udev-builtin-kmod.c: remove the modprobe alt to kmod codeAnthony G. Basile
2015-02-11src/udev/udevd.c: remove create static nodes from modulesAnthony G. Basile
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-11rule_generator: remove legacy codeAnthony G. Basile
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-08util: rework strappenda(), and rename it strjoina()Lennart Poettering
After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-02-08udev: event - minor nitTom Gundersen
Stay uniform and use 'dev' rather than 'event->dev', as these are aliases (and event->dev looks like it may be a typo for event->dev_db). 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-25build-sys: fix build on compilers without static_assertZbigniew Jędrzejewski-Szmek
Build would fail when assert was used on the same line in different files #included together. https://bugs.freedesktop.org/show_bug.cgi?id=87339 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-25src/shared/util.h: only define the _to_string() enum mapping functionLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-25src/shared/util.h: further cleanup PID_FMTAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-25Fix some format strings for enums, they are signedZbigniew Jędrzejewski-Szmek
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-25shared/util: use signed printf format for PIDsZbigniew Jędrzejewski-Szmek
gcc 5 started warning about this. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-25log: add new log output mode, that prints to console, butLennart Poettering
prefixes with syslog priority This is useful when we execute our own programs, reading output from its STDERR, and want to retain priority information. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-25util: Add some missing hidden_file() suffixesMartin Pitt
dpkg itself also uses *.dpkg-dist, while .dpkg-{bak,backup,remove} are being used by dpkg-maintscript-helper. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2015-01-25Move DEFINE_TRIVIAL_CLEANUP_FUNC to macro.hZbigniew Jędrzejewski-Szmek
This remove the need for various header files to include the (relatively heavyweight) util.h. 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>