summaryrefslogtreecommitdiff
path: root/src/udev/udev-event.c
AgeCommit message (Collapse)Author
2014-07-30udev: place opening { at the same line as the function declarationKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-07-30udev: unify event timeout handlingKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-05-15udev: do not skip the execution of RUN when renaming a network device failsKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-03-17udev: properly detect reference to unexisting part of PROGRAM's resultLukas Nykryn
2014-02-21everywhere: make use of new0() and macro() macros, and stop using perror()Lennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-02-02use 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). Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-01-13src/udev: bring up to date with upstream.Anthony G. Basile
These commits were authored by Zbigniew Jędrzejewski-Szmek Tom Gundersen Kay Sievers Lennart Poettering Shawn Landden Daniel Buch Martin Pitt Karel Zak Yang Zhiyong Note: udev_builtin_net_setup_link has *not* been imported. Also still missing from udev-builtin is udev_builtin_uaccess. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-01-09udev: support custom Linux Security Module labels for device nodesKay Sievers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-08-16fix usage of glibc-specific sys/poll.hrofl0r
sys/poll.h is a legacy alias used by glibc. according to POSIX #include <poll.h> is correct. on GLIBC, the POSIX header includes sys/poll.h, so everything continues working as it should. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-08-02rule-generator: proactively rename ifaces to avoid conflictsIan Stakenvicius
When a new network iface device is added, scan through the list of rules to see if its kernel-assigned name is used as a target for another device. If so, and said target device is not this device, rename it to a temporary interface name. Then rename the device in accordance with any rename rules that may apply to this device, if applicable. The temporary name assigned is the basename of the interface with a numeric compoment which is close to the inverse of the numeric id (127 - id#). This should provide a more user-friendly output than the old 'rename#' behaviour, when there is no final target name for the iface. This proactive temporary rename will prevent cases where old-style rule-generator rules are used and a target NAME= is set for one iface, assigning it to the iface name used by a second iface, and that second iface has no rename rule to apply. The original rename code would be blocked due to the conflict and time out when attempting to rename, leaving the interface assigned to the temporary 'rename[id#]' name and/or failing to rename other ifaces in accordance with the existing rules. This is a corner case that only occurrs when 75-persistent-net-generator.rules or the write_net_rules script it 'IMPORTS' fails to generate a new rule and rename the interface and there is no other interface-renaming rules that apply. There may also be performance benefits to renaming ifaces early, but no benchmarks have been run to confirm this. Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-07-07Import strxcpyx from upstreamAnthony G. Basile
This commit imports strxcpyx from upstream. This is upstream commit d5a89d7dc17a5ba5cf4fc71f82963c5c94a31c3d Note: there were also some very minor code cleanups to accelerometer.c: line 187 collect.c: lines 35, 140 libudev-device.c: line 780 libudev-hwdb.c: line 300 These are part of upstream commits: 507f22bd0172bff5e5d98145b1419bd472a2c57f 3cf7b686e6b29f78de0af5929602cae4482f6d49 67410e9f73a6cdd8453c78b966451b5151def14a Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-04-07src/udev/udev-event.c: restore code to allow rule generator to workAnthony G. Basile
This code was dropped while importing from upstream. It is needed to allow the legacy renaming of interfaces like eth* or wlan*. X-Eudev-Bug: 56 X-Eudev-Bug-URL: https://github.com/gentoo/eudev/issues/56 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-04-02udev: updateAnthony G. Basile
This updates the daemon codebase to upstream. Authors: Zbigniew Jędrzejewski-Szmek Lennart Poettering Václav Pavlín Kay Sievers Harald Hoyer Rob Clark Zeeshan Ali (Khattak) See http://cgit.freedesktop.org/systemd/systemd/log/src/udev Ian is signing off but has some concerns on a few of the changes that he may fix in future commits. Signed-off-by: Anthony G. Basile <blueness@gentoo.org> Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
2013-01-28Cleanup of spacing to help with diffsIan Stakenvicius
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2013-01-28Honor DEVUID, DEVGID in addition to DEVMODEIan Stakenvicius
New behaviour in udev-197 systemd commit 1edefa4f1d7bae6cc19aa4a97238400c5a04f7a4 Author: Kay Sievers <kay@vrfy.org> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-12-12Changed --enable-split-usr to add hard-coded paths for rules etc in both / ↵Ian Stakenvicius
and /usr This is necessary because the code originally defined paths assuming UDEV_LIBEXECDIR was /usr prefixed, and also that udevrulesdir was located in /etc. Since (1) both of these defaults have changed, and (2) they could be set to more or less anything, we want to ensure that there is support for the standard paths as well, irrespective of what UDEV_LIBEXECDIR and UDEV_RULES_DIR are set to. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-11-23Propagation of configured installation paths to Makefile.am and .c codeAnthony G. Basile
This commit is a continuation of the previous one in which all the configured paths obtained in configure.ac are propagated to the Makefile.am and .c files via AM_CPPFLAGS of the form -DUDEV_CONF_FILE=\"$(udevconffile)\". This should address the issue in https://github.com/gentoo/eudev/issues/17 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-11-20udev: allow helpers to be in /lib/udevEgor Y. Egorov
Signed-off-by: Richard Yao <ryao@gentoo.org>
2012-11-13udev: properly handle symlink removal by 'change' eventKay Sievers
If a 'change' event is supposed to remove created symlinks, we create a new device structure from the sysfs device and fill it with the list of links, to compute the delta of the old and new list of links to apply. If the device is already 'remove'd by the kernel though, udev fails to create the device structure, so the links are not removed properly. > From: Neil Brown <nfbrown@suse.com> > Date: Thu, 8 Nov 2012 10:39:06 +0100 > Subject: [PATCH] If a 'change' event does not get handled by udev until > after the device has subsequently disappeared, udev mis-handles > it. This can happen with 'md' devices which emit a change > event and then a remove event when they are stopped. It is > normally only noticed if udev is very busy (lots of arrays > being stopped at once) or the machine is otherwise loaded > and reponding slowly. > > There are two problems. > > 1/ udev_device_new_from_syspath() will refuse to create the device > structure if the device does not exist in /sys, and particularly if > the uevent file does not exist. > If a 'db' file does exist, that is sufficient evidence that the device > is genuine and should be created. Equally if we have just received an > event from the kernel about the device, it must be real. > > This patch just disabled the test for the 'uevent' file, it doesn't > try imposing any other tests - it isn't clear that they are really > needed. > > 2/ udev_event_execute_rules() calls udev_device_read_db() on a 'device' > structure that is largely uninitialised and in particular does not > have the 'subsystem' set. udev_device_read_db() needs the subsystem > so it tries to read the 'subsystem' symlink out of sysfs. If the > device is already deleted, this naturally fails. > udev_event_execute_rules() knows the subsystem (as it was in the > event message) so this patch simply sets the subsystem for the device > structure to be loaded to match the subsystem of the device structure > that is handling the event. > > With these two changes, deleted handling of change events will still > correctly remove any symlinks that are not needed any more. Use udev_device_new() instead of allowing udev_device_new_from_syspath() to proceed without a sysfs device.
2012-11-12use the same email address everywhereKay Sievers
2012-11-12udev: use usec_t and now()Kay Sievers
2012-07-30udev: add missing newline when writing to /dev/kmsgKay Sievers
2012-07-15udev: get rid of TEST_PREFIX and use unshare() to fake /sys, /dev, /runKay Sievers
2012-07-14udev: avoid creating /dev/kmsg with fopen() to support CONFIG_PRINTK=nKay Sievers
2012-07-05udev: network device renaming - immediately give up if the target name isn't ↵Kay Sievers
available
2012-07-05udev: add some O_CLOEXECKay Sievers
2012-04-16udev: use startswith() and streq()Kay Sievers
2012-04-16udev: remove configuration options for /dev, /sys, /run directoriesKay Sievers
2012-04-16udev: replace ARRAY_SIZE() with ELEMENTSOF()Kay Sievers
2012-04-13udev: fix a few issues detected by the llvm static analyzerKay Sievers
2012-04-10udev: fix gcc warnings showing up after adding $(AM_CFLAGS)Kay Sievers
2012-04-09udev: remove RUN+="socket:.." and udev_monitor_new_from_netlink()Kay Sievers
2012-04-09udev: convert 'uaccess' to a builtinKay Sievers
2012-04-08udev: switch to systemd logging functionsKay Sievers
2012-04-04move imported udev into placeKay Sievers