Commit Graph
145 Commits
Author SHA1 Message Date
Kay Sievers 1d843b7d68 libudev: run_program() - select() -> epoll 2011-04-18 02:13:40 +02:00
Kay Sievers 13052c0285 use 'else if' in epoll event array loop 2011-04-17 22:10:18 +02:00
Kay Sievers f2fd4d2723 libudev: test - use epoll 2011-04-15 12:18:06 +02:00
Kay Sievers fdf52f5e2a libudev: ctrl, monitor - use SOCK_NONBLOCK 2011-04-15 01:14:10 +02:00
Kay Sievers 7459bcdc8d udevd: get netlink socket from systemd 2011-04-14 23:46:44 +02:00
Kay Sievers 02bf3e13e0 udevd: do not nice processes 2011-04-14 12:25:19 +02:00
Kay Sievers 9ead662791 udevadm: info --cleanup-db
Most of the udev database from initramfs should be deleted before
starting udev in the real root. udevadm: info --cleanup-db deletes
all database entries in /run/udev. Events that processed IMPORT{db},
or mark devices explicitely as persistent, will be excluded.
2011-04-13 22:33:01 +02:00
Kay Sievers 80707e9ad6 libudev: ctrl - fix refcounting in connection handling 2011-04-13 18:21:47 +02:00
Kay Sievers e48e291202 trivial cleanups 2011-04-13 01:47:56 +02:00
Kay Sievers ff2c503df0 udevadm: control - add --exit 2011-04-13 01:17:09 +02:00
Kay Sievers 51f43b5329 selinux: do not label files in runtime dir
Do not label any files in the udev runtime directory, but only nodes,
links and directories below /dev.

In case the runtime directory falls back to /dev/.udev, label this
directory once at udevd startup, but never anything below it.
2011-04-08 01:09:20 +02:00
Kay Sievers b4155660f2 libudev: make valgrind happy
Warning: noted but unhandled ioctl 0x641e with no size/direction hints
  Syscall param socketcall.setsockopt(optval) points to uninitialised byte(s)
  at 0x6A30BAA: setsockopt (syscall-template.S:82)
  by 0x4E36E1C: udev_monitor_filter_update (libudev-monitor.c:347)
  by 0x4E36ED8: udev_monitor_enable_receiving (libudev-monitor.c:373)
  by 0x8A9E68E: I830ScreenInit (intel_driver.c:838)
  by 0x42EE9E: AddScreen (dispatch.c:3890)
  by 0x471561: InitOutput (xf86Init.c:738)
  by 0x422C18: main (main.c:205)
  Location 0x7ff0000c2 is 2 bytes inside local var "filter"
  declared at libudev-monitor.c:256, in frame #1 of thread 1
  Uninitialised value was created by a stack allocation
  at 0x4E30860: ??? (in /lib64/libudev.so.0.10.0)

Thanks to Zdenek Kabelac.
2011-03-28 14:34:05 +02:00
Kay Sievers 672ff71911 libudev: docs - add udev_get_run_path() 2011-03-25 17:58:30 +01:00
Kay Sievers 6e0768d290 libudev: export udev_get_run_path() 2011-03-25 16:29:36 +01:00
Kay Sievers fc1de713f5 systemd: bind udev control socket in systemd and split udev.service
We should bind the udev socket from systemd, so we are sure
that the abstract namespace socket is always bound by a root
process and there is never a window during an update where
an untrusted process can steal our socket.

Also split the udev.service file, so that the daemon can be
updated/restarted without triggering any coldplug events.
2011-03-23 16:40:23 +01:00
Kay Sievers 4ec9c3e797 use /run/udev/ if possible and fall back to /dev/.udev/ 2011-03-23 02:31:09 +01:00
Kay Sievers 5f59fa0900 move /dev/.udev/ to /dev/.run/udev/ and convert old udev database at udevd startup 2011-03-15 17:26:08 +01:00
Kay Sievers 3e0a2c9a50 libudev: resolve ifindex in udev_device_new_from_id_filename() 2011-03-05 06:26:39 +01:00
Kay Sievers 20bee04c19 libudev: udev_device_get_sysattr_list_entry() update 2011-03-04 23:00:52 +01:00
Kay Sievers d53a3878d2 test-libudev: add short options 2011-03-04 22:56:54 +01:00
Thomas Egerer 95ce1875d7 libudev: use sysfs attr ilist interface for attribute walk
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2011-03-04 21:51:32 +01:00
Thomas Egerer f180ad259f libudev: allow to get list of all available sysfs attrs for a device
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
2011-03-04 21:51:03 +01:00
Kay Sievers 0c19cc73da update some comments 2011-02-15 22:28:31 +01:00
Kei Tokunaga c54b43e2c2 udevadm: enumerate - update prev pointer properly
When I tried to boot a system with 256 disks x 4 paths with
device-mapper, udevadm trigger (--type=devices) that was called
from start_udev ended up dumping a core due to a segmentation
fault.

In udev_enumerate_get_list_entry(), if it finds the devices that
should be delayed, it calls syspath_add().  If realloc() in
syspath_add() allocates the required memory at a different memory
address, referring prev->len afterward causes the segmentation
fault.

Signed-off-by: Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com>
2011-02-15 22:28:31 +01:00
Kay Sievers 9c6a11b1c6 libudev: record and export "age" of device record 2010-12-15 08:58:46 +01:00
Kay Sievers 93a724d3f8 libudev: fix renamed device nodes detection logic 2010-12-15 08:58:45 +01:00
Kay Sievers 48a0170b11 libudev: enumerate - allow to filter-out not-already-initialized devices 2010-12-14 14:18:32 +01:00
Kay Sievers ff0e1f4e5d check ifindex > 0 instead of subsystem == "net" 2010-12-14 11:27:02 +01:00
Kay Sievers 14996e80d4 udevd: write full database file for (unsupported) renamed device nodes 2010-12-14 02:30:36 +01:00
Kay Sievers cad40a5fe7 udevd: switch to common id_filename functions 2010-12-12 20:07:15 +01:00
Kay Sievers 24d1076696 udevd: simplify udev database and fix DEVNAME handling 2010-12-11 14:00:46 +01:00
Kay Sievers 4281da1fa6 udevd: use dev_t or netif ifindex as database key
We need to preserve the database of network interfaces while we
rename them. Use the kernel's numbers wherever possible, instead
of the device names.

Fix wrong database filenames which contain a '/', translated
from '!' in the kernel name.

Fix segfault for kobject pathes where the subsystem can not be
determined from sysfs.
2010-12-10 01:18:15 +01:00
Kay Sievers 8ba13ec1cd libudev: do not overwrite path with readlink() call 2010-12-10 01:18:14 +01:00
Kay Sievers cdb1d7608a libudev: return kernel provided devnode when asked before we handled any rules 2010-10-22 13:56:16 +02:00
Kay Sievers fc416258f3 udevd: do not wrongly delay events for devices with swapped names
Renaming network devices might delay events for the other device, which has
the same devpath in the meantime as the original event. Causing a delay until
the timout of the event is reached.

Look at the ifindex/devnum of the devices to check if they are really
the same devices.
2010-10-13 13:08:29 +02:00
Kay Sievers ebd189621f do not rename the database on device rename
Harald Hoyer discovered some incorrect behavior while debugging
problems with network interface renaming:

Udev events might be queued for devices which are renamed. A new
device registered the same time may claime the old name and create
a database entry for it. The current rename logic would move over
this databse entry to the wrong device.
2010-08-11 14:34:32 +02:00
Kay Sievers c11f89b61a fix broken "compile warning fix" 2010-08-10 08:07:28 +02:00
Yin Kangkai ae8011a084 udev: fix compile warning
CC     udev/udevd.o
In file included from udev/udev.h:27,
                 from udev/udevd.c:47:
./libudev/libudev-private.h: In function ‘udev_selinux_setfscreateconat’:
./libudev/libudev-private.h:230: warning: declaration of ‘dirfd’ shadows a global declaration
/usr/include/dirent.h:224: warning: shadowed declaration is here

Signed-off-by: Yin Kangkai <kangkai.yin@intel.com>
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2010-08-08 20:37:37 +02:00
Kay Sievers 8e5a620b17 call util_delete_path() only when we actually deleted stuff 2010-08-03 12:13:53 +02:00
Marco d'Itri 9b6c6b5612 log an error when a message from the wrong version of udevadm is ignored 2010-07-19 10:56:37 +02:00
Kay Sievers 727b12d650 libudev: fix fd leak in udev_enumerate_scan_devices() when tags are searched
Thanks to Lennart for finding this.
2010-06-05 10:30:36 +02:00
Kay Sievers a7d29d1509 libudev: doc - fix typo 2010-05-31 11:18:52 +02:00
Kay Sievers c830e98d6a udevd: read debug settings from kernel commandline 2010-05-28 12:07:27 +02:00
Kay Sievers 87d55ff672 childs -> children 2010-05-27 17:27:56 +02:00
Kay Sievers 88cbfb09ee while (1) -> for (;;) 2010-05-27 15:11:00 +02:00
Kay Sievers e0d9c042f8 libudev: fix udev_queue_get_seqnum_sequence_is_finished() with empty queue file
We an empty or garbage-collected queue file, we might not have a record
for the first sequence we wait for, and therefore must not wait for it.
2010-05-25 12:17:43 +02:00
Kay Sievers cb9a0eeeab udevd: create standard symlinks and handle /lib/udev/devices 2010-05-20 09:04:26 +02:00
Kay Sievers 0c5c48040a libudev: add O_CLOEXEC 2010-05-14 14:52:18 +02:00
Kay Sievers e85f5ec15f reset process priority before executing RUN+=
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581235
2010-05-12 08:46:56 +02:00
Kay Sievers f712894dd4 libudev: add documentation for recently added functions 2010-05-07 23:04:42 +02:00