1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 11:55:44 +03:00
Commit Graph

135 Commits

Author SHA1 Message Date
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
Kay Sievers
2793f4e34b export udev_device_get_tags_list_entry() 2010-04-23 16:05:38 +02:00
Kay Sievers
2a34f9c31e export tag functions 2010-04-23 10:46:00 +02:00
Kay Sievers
65f099c721 libudev: accept NULL in udev_device_get_tags_list_entry() 2010-04-23 09:22:42 +02:00
Kay Sievers
c1dbe11dc3 delete old tags when configuration changes 2010-04-23 09:01:56 +02:00
Kay Sievers
bfd88b1d7b fix logic on-demand loading logic for db and uevent 2010-04-22 18:50:43 +02:00
Kay Sievers
28460195c2 add TAG= to improve event filtering and device enumeration 2010-04-22 18:12:36 +02:00
Kay Sievers
60067cc75a more readlink buffer size handling 2010-04-21 14:44:33 +02:00
Kay Sievers
a89d342dfb remove "ignore_remove" option 2010-04-13 12:45:38 +02:00
Kay Sievers
1f084fe581 remove "all_partitions" option
We can not predict the major/minor of non-existing devices:
  $ grep . /sys/class/block/sd*/dev
  /sys/class/block/sda1/dev:259:524288
  /sys/class/block/sda2/dev:259:262144
  /sys/class/block/sda3/dev:259:786432
  /sys/class/block/sda4/dev:259:131072
  /sys/class/block/sda/dev:259:0
  /sys/class/block/sdb/dev:259:655360
  /sys/class/block/sdc/dev:259:393216

If this functionality is still needed for some broken hardware, it needs to be
solved with a tool not part of the udev package. Because such option is unreliable
and unsafe to use.
2010-04-13 08:52:48 +02:00
Kay Sievers
dbba7e4029 libudev: update documentation 2010-03-25 16:45:48 +01:00