Commit graph

109 commits

Author SHA1 Message Date
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 d0d7b8d085 add info message when empty NAME is given 2010-05-07 22:57:20 +02:00
Kay Sievers 75cb1ac51e warn when renaming kernel-provided nodes instead of adding symlinks 2010-05-05 11:39:25 +02:00
Kay Sievers 6d80a7e83f remove debug output during rules parsing 2010-05-03 18:09:25 +02:00
Kay Sievers 1dbfbfbea6 use the usual TAG+=, TAG= logic 2010-04-22 19:03:11 +02:00
Kay Sievers 3f896a2abd all to match against a given TAG== 2010-04-22 18:33:24 +02:00
Kay Sievers 28460195c2 add TAG= to improve event filtering and device enumeration 2010-04-22 18:12:36 +02:00
Kay Sievers 5d69a34caf fix previous commit 2010-04-21 15:43:05 +02:00
Kay Sievers e9906fec71 remove left-over from ignore_remove and all_partitions 2010-04-21 15:11:57 +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 4b06c40935 replace "add|change" with "!remove" 2010-04-12 16:52:41 +02:00
Kay Sievers 5539f624e1 allow IMPORT{db}="KEY" 2010-04-12 15:58:05 +02:00
Kay Sievers fbb31cd6e1 libbudev-private: rename udev_list_entry_get_flag() 2010-03-10 14:52:42 +01:00
Kay Sievers 6d87ee2e00 print warning for BUS=, SYSFS{}=, ID= 2009-11-16 23:39:33 +01:00
Kay Sievers cdae488a3f remove "ignore_device"
There is no way to ignore an event these days. Libudev events can
not be suppressed. It only prevents RUN keys from being executed,
which results in an inconsistent behavior in current setups.
2009-11-16 15:22:17 +01:00
Kay Sievers 081be002ea udevd: create /dev/.udev/rules.d/ before watching it wit inotify
This should also address:

On Tue, Nov 3, 2009 at 16:21, Marco d'Itri <md@linux.it> wrote:
> udev_rules_new() in udev/udev-rules.c unconditionally creates the
> directory.
> This is a problem because the function is called also by e.g. udevadm
> test, and creating /dev/.udev/ when it does not exist is an unacceptable
> side effect which will break everything else that checks for its
> existence to know if udev is running.
2009-11-04 17:06:52 +01:00
Kay Sievers bfbf65aad0 remove "last_rule" option
Its use breaks too many things which expect to be run from independent
later rules, and is an idication that something needs to be fixed
properly instead.
2009-10-28 11:45:32 +01:00
Kay Sievers bcb8b2315b fix SYMLINK{} option parsing 2009-09-16 18:14:03 +02:00
Kay Sievers 6c29f2b942 simplify "symlink name stack"
With well defined and kernel-supplied node names, we no longer need
to support a possible stack of conflicting symlinks and node names.
Only symlinks with identical names can be claimed by multiple devices.

This shrinks the former /dev/.udev/names/ significantly.

Also the /dev/{block,char}/MAJ:MIN" links are excluded from the name
stack - they are unique and can not conflict.
2009-09-09 18:49:07 +02:00
Kay Sievers 78715f65c9 fix randonm findings from llvm-clang-analyzer
Thanks to Lennart for the log file!
2009-09-08 22:11:04 +02:00
Kay Sievers 335e316a71 fix whitespace 2009-09-07 12:15:29 +02:00
Jeremy Kerr d412a68573 util_run_program: restore signal mask before executing event RUN commands
External programs triggered by events (via RUN=) will inherit udev's
signal mask, which is set to block all but SIGALRM. For most utilities,
this is OK, but if we start daemons from RUN=, we run into trouble
(especially as SIGCHLD is blocked).

This change saves the original sigmask when udev starts, and restores it
just before we exec() the external command.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
2009-09-07 12:13:50 +02:00
Kay Sievers 77f89e9330 Revert "udev-rules.c: remove 'first_token' variable"
That was a mistake. The variable is needed to be set before
we parse the file. Thanks a lot to Alan Jenkins for spotting
this.

This reverts commit 710fdac1e4.
2009-09-07 12:13:49 +02:00
Florian Zumbiehl 6d691b2bd6 udev-rules.c: parse_file() - fix possible buffer overflow 2009-09-01 13:26:37 +02:00
Kay Sievers 710fdac1e4 udev-rules.c: remove 'first_token' variable 2009-09-01 13:16:48 +02:00
Florian Zumbiehl 9257ecfc19 ude_rules.c: fix possible NULL pointer dereference in get_key() 2009-09-01 12:15:54 +02:00
Daniel Mierswa 959e8b5dec use nanosleep() instead of usleep()
POSIX.1-2001 declares usleep() function obsolete and POSIX.1-2008
removes it.

[Kay Sievers]
  - include time.h
  - use const for timespec
  - scsi_id: drop rand() in retry loop
  - modem-probe: rename msuspend() to msleep()
2009-08-30 23:58:57 +02:00
Kay Sievers 24d1fea8bd warn about non-readable or empty rules file 2009-08-19 07:34:07 +02:00
Kay Sievers 8e2470d68e print warning for NAME="%k" - it breaks the kernel supplied DEVNAME 2009-08-19 07:31:39 +02:00
Alan Jenkins 214a6c791c fix spelling
Fix spelling in docbook comments, code comments, and a local variable
name.  Thanks to "ispell -h" for docbook HTML and "scspell" for source
code.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2009-08-08 15:42:05 +02:00
Kay Sievers 16dd0aa922 "record_failed" -> "fail_event_on_error" 2009-08-06 19:23:06 +02:00
Kay Sievers f7c5b04f69 re-enable failed event tracking
It did not work for the last couple of releases.

If RUN{record_failed}+="..." is given, a non-zero execution will mark
the event as failed. Recorded failed events can be re-triggered with:
  udevadm trigger --type=failed

The failed tracking _might_ be useful for things which might not be
ready to be executed at early bootup, but a bit later when the needed
dependencies are available. In many cases though, it indicates that
something is used in a way it should not.
2009-08-06 16:16:26 +02:00
Kay Sievers fc206fbe3e update a few years of copyright 2009-08-01 09:39:18 -04:00
Kay Sievers b25a94549c do not exports properties starting with a '.'
Private variables can be marked like:
  ENV{.FOO}="bar"
2009-06-28 02:21:58 +02:00
Kay Sievers 6133f3432f cleanup ./configure installation directory options 2009-06-17 02:25:07 +02:00
Kay Sievers 045a3bc89e USE_LOG -> ENABLE_LOGGING, DEBUG -> ENABLE_DEBUG, USE_SELINUX -> WITH_SELINUX 2009-06-14 17:53:15 +02:00
Kay Sievers 32028733ee allow format substitution in path of ATTR{<path>}=="<value>" 2009-06-06 04:52:52 +02:00
Kay Sievers a25d547dd4 udevd: use enum instead of char in struct declaration 2009-06-05 23:27:11 +02:00
Kay Sievers bd75fddbcb require key names in uppercase
Drop pretty expensive case-insensitive matching, and key names in
mixed or lowercase are not supported anyway.
2009-05-20 23:45:32 +02:00
Kay Sievers fb04513470 remove unused GL_FORMAT from rules parser 2009-05-20 23:12:22 +02:00
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
Scott James Remnant 055e40edc6 OWNER/GROUP: fix if logic
The introduction of the --resolve-names=early/never code introduced a
bug to the OWNER/GROUP lookup.  Previously if the name had contained $,
lookup would have been performed later; after the patch, the key ended
up being ignored!
2009-05-14 12:42:44 +01:00
Kay Sievers 0c37798916 fix possible endless loop for GOTO to non-existent LABEL
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526365
2009-05-13 18:01:32 +02:00
Kay Sievers e3196993f1 remove all PHYSDEVPATH handling and warning about 2009-05-04 22:08:05 +02:00
Kay Sievers 52761bb0a9 IMPORT: 2048 -> 4096 bytes buffer 2009-03-30 20:09:08 +02:00
Michael Prokop 2236ddae2d fix compile error in debug mode
When building with './configure --enable-debug && make' it fails with:
  udev-rules.c: In function ‘dump_token’:
  udev-rules.c:366: error: ‘struct <anonymous>’ has no member named ‘i’

Signed-off-by: Michael Prokop <mika@grml.org>
2009-03-03 17:27:00 +01:00
Kay Sievers 46f194cbde add "nowatch" to disable a default installed watch with a later rule 2009-02-25 11:18:15 +01:00
Scott James Remnant bd284db142 udevd: optionally watch device nodes with inotify
This allows you to re-process the rules if the content of the device
has been changed, most useful for block subsystem to cause vol_id to
be run again.
2009-02-11 17:38:56 +00:00