1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 08:26:52 +03:00
Commit Graph

172 Commits

Author SHA1 Message Date
Kay Sievers
e6c1a2bde7 use openat(), unlinkat(), fstatat() 2009-05-20 18:58:52 +02:00
Kay Sievers
065db05221 use more efficient string copying 2009-05-20 17:57:52 +02:00
Kay Sievers
e3196993f1 remove all PHYSDEVPATH handling and warning about 2009-05-04 22:08:05 +02:00
Kay Sievers
cb14f4543a handle devtmpfs nodes
UDev follows the kernel given name, and re-uses the kernel created
device node. If the kernel and spcecified udev rules disagree, the
udev specified node node is created and the kernel-created on is
deleted.
2009-05-04 04:52:31 +02:00
Kay Sievers
37ed4f5619 drop "extern" keyword from non-static function 2009-04-26 13:59:39 +02:00
Kay Sievers
19d7e87cc0 libudev: monitor - export filter_update() 2009-04-23 18:05:10 +02:00
Kay Sievers
34f55e1dc7 libudev: queue - clarify comments 2009-04-23 15:16:26 +02:00
Kay Sievers
8c3ae78546 libudev: queue - fix get_seqnum_is_finished()
On Thu, Apr 23, 2009 at 11:39, Alan Jenkins <alan-jenkins@tuffmail.co.uk> wrote:
> I'm puzzled by this function:
>
>        /* if we have not seen this seqnum, check if it is/was already queued */
>        if (seqnum < udev_queue->last_seen_udev_seqnum) {
>                udev_queue_get_udev_seqnum(udev_queue);
>                if (seqnum < udev_queue->last_seen_udev_seqnum)
>
> Shouldn't the test be (seqnum > udev_queue->last_seen_udev_seqnum) ?
2009-04-23 13:23:45 +02:00
Kay Sievers
08a7a795f6 libudev: monitor - add udev_monitor_filter_remove 2009-04-23 04:07:51 +02:00
Kay Sievers
e93c38c3a2 libudev: monitor - do not filter messages with wrong magic 2009-04-23 03:33:58 +02:00
Kay Sievers
dacea9ff6b libudev: monitor - switch to filter_add_match_subsystem_devtype() 2009-04-23 03:24:38 +02:00
Kay Sievers
c7dff03e05 libudev: monitor - use simpler hash 2009-04-22 18:38:16 +02:00
Kay Sievers
4277453fd2 update TODO 2009-04-22 04:32:25 +02:00
Kay Sievers
e14bdd88e9 libudev: monitor - add client socket filter for subsystem value
Messages send back by the udev daemon to the netlink socket are
multiplexed by the kernel and delivered to multiple clients. The
clients can upload a socket filter to let the kernel drop messages
not belonging to a certain subsystem. This prevent needless wakeups
and message processing for users who are only interested in a
subset of available events.

Recent kernels allow untrusted users to listen to the netlink
messages.

The messages send by the udev daemon are versioned, to prevent any
custom software reading them without libudev. The message wire format
may change with any udev version update.
2009-04-22 03:50:11 +02:00
Kay Sievers
540f46698d udevd: at startup create /dev/null, /dev/console, /dev/kmsg 2009-04-19 03:25:04 +02:00
Kay Sievers
f1986e09fc test-libudev: update monitor source 2009-04-18 13:23:10 +02:00
Kay Sievers
ff109b8ded libudev: monitor - clarify socket handling documentation 2009-04-16 01:49:16 +02:00
Kay Sievers
3e5bafc98a libudev: path_encode - always return 0 if encoded string does not fit into size 2009-04-15 21:47:04 +02:00
Scott James Remnant
e86a923d50 libudev: monitor - ignore messages from unusual sources
For added protection, ignore any unicast message received on the
netlink socket or any multicast message on the kernel group not
received from the kernel.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2009-04-08 16:16:14 -07:00
Kay Sievers
e2b362d9f2 libudev: monitor - unify socket message handling 2009-04-08 07:46:54 -07:00
Kay Sievers
662c311080 path_encode: fix max length calculation
Sebastian Krahmer wrote:
> it should reserve 4 times not 3 times len :)
2009-04-08 06:06:01 -07:00
Alan Jenkins
4b09a2fc43 avoid leaking netlink socket fd to external programs
The netlink socket is now used by udev event processes. We should take
care not to pass it to the programs they execute. This is the same way
the inotify fd was handled.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2009-04-06 07:23:35 -07:00
Kay Sievers
f2b937440c "UDEV_MONITOR_KERNEL/UDEV" -> "kernel/udev" 2009-03-29 20:08:52 +02:00
Kay Sievers
116254097a send monitor events back to netlink socket
Instead of of our own private monitor socket, we send the
processed event back to our netlink socket, to the multicast
group 2 -- so any number of users can listen to udev events,
just like they can listen to kernel emitted events on group 1.
2009-03-29 04:24:39 +02:00
Kay Sievers
4061ab9f4b libudev: GPL -> LGPL 2009-03-26 19:29:36 +01:00
Kay Sievers
f454f6708a udevadm: test - handling trailing '/' in devpath
On Wed, Mar 18, 2009 at 16:00, Matthias Schwarzott <zzam@gentoo.org> wrote:
found out how the error occurs:
It is a difference between
A. udevadm test /sys/class/mem/null/
and
B. udevadm test /sys/class/mem/null

Case A was the case that showed the error behaviour. It seems udevadm is
confused by the trailing slash. This behaviour seems to be there since ages.
2009-03-18 18:42:16 +01:00
Scott James Remnant
bb38678e3c udevadm: settle - synchronise with the udev daemon
There's still a slight race condition when using udevadm settle, if the
udev daemon has a pending inotify event but hasn't yet generated the
"change" uevent for it, the kernel and udev sequence numbers will match
and settle will exit.

Now udevadm settle will send a control message to udevd, which will
respond by sending SIGUSR1 back to the waiting udevadm settle once it
has completed the main loop iteration in which it received the control
message.

If there were no pending inotify events, this will simply wake up the
udev daemon and allow settle to continue.  If there are pending inotify
events, they are handled first in the main loop so when settle is
continued they will have been turned into uevents and the kernel
sequence number will have been incremented.

Since the inotify event is pending for udevd when the close() system
call returns (it's queued as part of the kernel handling for that system
call), and since the kernel sequence number is incremented by writing to
the uevent file (as udevd does), this solves the race.

When the settle continues, if there were pending inotify events that
udevd had not read, they are now pending uevents which settle can wait
for.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2009-03-12 10:02:37 +00:00
Kay Sievers
89d080c3ae libudev: ctrl - return error after sending ctrl message 2009-03-11 13:32:39 +01:00
Kay Sievers
a5d8cffad9 libudev: queue - use lstat() to check existence of symlink 2009-03-04 23:32:16 +01:00
Scott James Remnant
d7ce7539d3 Allow watch handle to be stored in the udevdb. 2009-02-23 17:31:26 +00:00
Kay Sievers
affed87af1 libudev: use 4096 bytes buffer for attribute reading 2009-01-14 21:54:31 +01:00
Kay Sievers
56c141eceb libudev: test - add udev_device_get_property_value() 2009-01-06 16:52:40 +01:00
Kay Sievers
3d7b2831cd libudev: device - add udev_device_get_property_value() 2009-01-06 00:26:28 +01:00
Kay Sievers
58d882a6d7 libudev: subsytem -> subsystem 2009-01-03 15:24:59 +01:00
Marcel Holtmann
61ee8cc92d libudev: device - remove udev_device_get_parent_with_subsystem 2009-01-03 15:12:28 +01:00
Marcel Holtmann
883012d49b libudev: device - lookup subsystem and devtype together 2009-01-03 15:12:17 +01:00
Kay Sievers
b92511747a libudev: device - read "uevent" only if info is not already loaded 2009-01-03 04:55:15 +01:00
Marcel Holtmann
bf8b2ae177 libudev: device - add devtype support 2009-01-02 04:37:04 +01:00
Kay Sievers
f089350234 libudev: enumerate - add lookup by property 2008-12-29 07:42:19 +01:00
Kay Sievers
1028fe14b6 if needed, store database entries also for devices which do not have a device node 2008-12-28 01:49:01 +01:00
Kay Sievers
4f06aaa9d8 libudev: include <sys/types.h> 2008-12-16 14:48:33 +01:00
Kay Sievers
bbfaec2b2f libudev: accept NULL whitelist in util_replace_chars() 2008-11-20 02:43:34 +01:00
Kay Sievers
096e59edc9 limit $attr(<symlink>) magic to well-known links only 2008-11-17 02:01:37 +01:00
Kay Sievers
f454ecf754 libudev: device - handle disk "device" link for partitions in deprecated sysfs layout
Thanks to Mikhail Kolesnik <mike@openbunker.org> for finding this.
2008-11-14 18:26:49 +01:00
Kay Sievers
11d5eec2cb udevadm: settle - exit if udevd exits 2008-11-06 19:41:58 +01:00
Kay Sievers
92f4313665 unify string replacement 2008-11-05 21:49:52 +01:00
Kay Sievers
77b852f333 do not import the "uevent" file when we only read the db to get old symlinks 2008-11-05 12:23:06 +01:00
Kay Sievers
6e0cb78c9d fix cleanup of possible left-over symlinks 2008-11-05 04:45:23 +01:00
Kay Sievers
1e78dcbe51 fix list handling in enumerate and rules file sorting 2008-11-04 20:19:01 +01:00
Kay Sievers
86b5778857 move some info() to dbg() 2008-11-01 20:16:24 +01:00