1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-11-01 00:51:08 +03:00
Commit Graph

102 Commits

Author SHA1 Message Date
Greg KH
1e50c2dee7 Update permissions on test scripts so they will run properly now.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-05-10 10:22:56 -07:00
tklauser@access.unizh.ch
15139b8a62 [PATCH] fix stupid all_partitions bug
> On Mon, 2005-04-11 at 14:55 +0200, Norbert Preining wrote:
> > On Mon, 11 Apr 2005, Kay Sievers wrote:
> > > > brw-rw----  1 root root 8, 0 2005-04-10 14:58 /dev/sdcard
> > > > brw-rw----  1 root root 8, 1 2005-04-10 14:58 /dev/sdcard1
> > > > brw-rw----  1 root root 8, 1 2005-04-10 14:58 /dev/sdcard2
> > > > brw-rw----  1 root root 8, 1 2005-04-10 14:58 /dev/sdcard3
> > > 
> > > This looks broken.
> > 
> > Good to hear.

Yeah, I guess it's broken. In create_node() in udev_add.c there is
always added 1 to the minor number, thus the error. The attached patch
should fix this.
2005-04-26 23:55:01 -07:00
kay.sievers@vrfy.org
f040a4a271 [PATCH] udev-test.pl: add test for DEVNAME export to RUN environment 2005-04-26 23:55:00 -07:00
kay.sievers@vrfy.org
821d0ec803 [PATCH] add RUN key to be able to run rule based notification
SUBSYSTEM=="block", RUN="/sbin/program"
  will execute the program only for block device events.

ACTION="remove", SUBSYSTEM=="block", RUN"/sbin/program"
  will execute the program, if a block device is removed.
2005-04-26 23:55:00 -07:00
kay.sievers@vrfy.org
db949b0248 [PATCH] allow to match against empty key values 2005-04-26 23:55:00 -07:00
kay.sievers@vrfy.org
98bbc835f5 [PATCH] read %s{}-sysfs values at any device in the chain 2005-04-26 23:55:00 -07:00
kay.sievers@vrfy.org
18614ab25d [PATCH] remove untrusted chars read from sysfs-values or returned by PROGRAM
Better remove characters that are useless in a device node name.
It may be a security risk to pass any character read from e.g. a
sysfs attribute to a shell script we execute later.
  
Prevent the modification of the libsysfs attribute value
cache.

Clear PROGRAM result if the execution encountered an error.
2005-04-26 23:54:59 -07:00
kay.sievers@vrfy.org
65005a7f81 [PATCH] test-suite: remove UDEV_TEST, it's not needed anymore 2005-04-26 23:54:59 -07:00
kay.sievers@vrfy.org
0bb4387707 [PATCH] udev-test.pl: use more common user/group names 2005-04-26 23:54:59 -07:00
kay.sievers@vrfy.org
c827876312 [PATCH] udev-test.pl: add a test where the group cannot be found in /etc/passwd 2005-04-26 23:54:59 -07:00
kay.sievers@vrfy.org
9b434de102 [PATCH] udev-test.pl: add check for textual uid/gid 2005-04-26 23:53:54 -07:00
kay.sievers@vrfy.org
3e5958dee5 [PATCH] add ENV{} key to match agains environment variables 2005-04-26 23:53:18 -07:00
kay.sievers@vrfy.org
38285d23d7 [PATCH] add a test and simplify debug statement 2005-04-26 23:53:17 -07:00
kay.sievers@vrfy.org
28ce66de17 [PATCH] support =, ==, !=, += for the key match and assignment 2005-04-26 23:53:17 -07:00
kay.sievers@vrfy.org
3b6ed8bb06 [PATCH] add OPTION="last_rule" to skip any later rule 2005-04-26 23:53:17 -07:00
kay.sievers@vrfy.org
882af735ec [PATCH] remove PLACE key match
ID should do the same, cause we walk up the chain of devices on the
physical device and can match for the name of every device there with
the ID key.
2005-04-26 23:51:00 -07:00
kay.sievers@vrfy.org
51015808da [PATCH] udev-test.pl: remove useless tests 2005-04-26 23:48:48 -07:00
kay.sievers@vrfy.org
77313cd0d1 [PATCH] namedev: skip backslashes only if followed by newline
Fix from: Hannes Reinecke <hare@suse.de>
namedev_parse is a bit overzealous when in comes to handling backspaces;
it always eats up backspaces regardless of anything beyond that. This
means it is impossible to enter '\t' in a rule. Quite a bit of fun when
you're trying to write regexps.
2005-04-26 23:39:48 -07:00
kay.sievers@vrfy.org
1cec1c2416 [PATCH] remove the device node only if the major/minor number matches 2005-04-26 23:36:13 -07:00
kay.sievers@vrfy.org
fd9efc00a2 [PATCH] introduce OPTIONS=ignore_device, ignore_remove, all_partitions" key
Here we move all possible options into a own key to make it possible
to have options-only rules.

The options on the NAME key are removed from the man page and will
be removed from a future version of udev.

For ignore rules, OPTIONS="ignore" should be used.

The rule:
  SUBSYSTEM="block", SYSFS{removable}="1", OPTIONS="all_partitions"

will create all partitions for a block device which is known to have
removable media (a check for cdrom drives would be needed too).
2005-04-26 23:36:12 -07:00
patmans@us.ibm.com
fd42f6a170 [PATCH] fix test for temporary nodes 2005-04-26 23:34:01 -07:00
kay.sievers@vrfy.org
6a24dc7477 [PATCH] fix special file mode mask for temporary device node 2005-04-26 23:33:50 -07:00
kay.sievers@vrfy.org
f22e9686fd [PATCH] udevstart: simplify "dev" file searching
Just stat() the "dev" file in the device directory instead of
opening the directory and iterating over all entries.

Make udevstart work with the settings in with udev.conf so we can
run a test program.

Add a test for udevstart.

Remove changelog stuff from code. We should never start with this
silly thing.
2005-04-26 23:31:07 -07:00
kay.sievers@vrfy.org
69aa6dfb70 [PATCH] add %P modifier to query the node name of the parent device
Events for partition devies may want to read the main block device
name to compose it's own name or read a disklabel from the main device.

SUBSYSTEM="block", KERNEL="*[1-9]", NAME="%P-p%n"
will append the partition number to the name of the main block device.
2005-04-26 23:31:03 -07:00
kay.sievers@vrfy.org
c1ab046124 [PATCH] provide temporary device node for callouts to access the device
%N will create a temporary node for a callout a be sustituted with the
name of the node.
2005-04-26 23:27:32 -07:00
kay.sievers@vrfy.org
b9a8c4821a [PATCH] remove default_* permissions from udev.conf file
With the "permissions only rules" we can just place:
 
   MODE="0660", OWNER="root", GROUP="root"
 
at the beginning of the rules file and get exactly the same behavior.
If no values are given the compiled-in defaults are used.
2005-04-26 23:19:09 -07:00
kay.sievers@vrfy.org
eb8700908c [PATCH] update Fedora config files and add some more tests 2005-04-26 23:19:09 -07:00
kay.sievers@vrfy.org
e93901468c [PATCH] allow permissions only rules
On Mon, 2004-12-20 at 15:03 +0100, Marco d'Itri wrote:
> +# all block devices
> > +SUBSYSTEM="block",   NAME="%k", GROUP="disk"
> > +
> NAME="%k" here and in similar rules does not add any new information,
> what about making it optional, like it is for SYMLINK-only rules?
2005-04-26 23:19:09 -07:00
kay.sievers@vrfy.org
87da5b2c65 [PATCH] add SUBSYSTEM rule to catch all block devices and apply the disk permissions 2005-04-26 23:19:09 -07:00
kay.sievers@vrfy.org
9f8dfa19cf [PATCH] allow multiline rules by backslash at the end of the line
On Sun, 2004-12-19 at 18:31 +0100, Marco d'Itri wrote:
> > On Dec 19, Kay Sievers <kay.sievers@vrfy.org> wrote:
> 
> > (Feature request: would it be possible to extend the rules files parser
> > to support continuation lines? I'd like it to consider lines starting
> > with white space as part of the previous line.)
> 
> How about the usual backslash at the end of the line. Here is a simple
> patch.
2005-04-26 23:19:09 -07:00
kay.sievers@vrfy.org
4ae6d03f39 [PATCH] simplify rules file by setting default mode to 0660
On Sun, 2004-12-19 at 18:31 +0100, Marco d'Itri wrote:
> It may be better to use default_mode="0660", I do not think that there
> are any mode 600 devices. This would allow setting only the group for
> most of them.
2005-04-26 23:19:09 -07:00
kay.sievers@vrfy.org
8b36cc0f17 [PATCH] complete removal of explicit udev permissions config file 2005-04-26 23:17:47 -07:00
Greg KH
18ebc43050 bleah, more merge fixes... 2005-04-26 23:15:56 -07:00
kay.sievers@vrfy.org
16ac31aaee [PATCH] don't call the hotplug scripts with a test run 2005-04-26 23:00:29 -07:00
Greg KH
b1e95455d2 fixups to get back to proper patch order
Damm, it's hard to merge a multi-line tree into one flat line at times...
2005-04-26 22:52:57 -07:00
greg@kroah.com
ad89f2be3b [PATCH] comment out ability to run udev-test.pl with valgrind 2005-04-26 22:43:27 -07:00
kay.sievers@vrfy.org
7efa217db0 [PATCH] add NAME{ignore_remove} attribute
Some broken ide drivers are generating high event traffic, with
add/remove events. With this attribute, it can be specified,
that the node is always available. It may be used in conjunction
with the new DRIVER= match to catch specific kernel device drivers.
2005-04-26 22:27:34 -07:00
kay.sievers@vrfy.org
2092fbcdeb [PATCH] support DRIVER as a rule key
Match with a rule against a device with a specific kernel driver.
2005-04-26 22:26:25 -07:00
kay.sievers@vrfy.org
6818c51d7a [PATCH] support SUBSYSTEM as a rule key
This should make it easier to catch e.g all block or net devices with
a single rule.
2005-04-26 22:25:38 -07:00
kay.sievers@vrfy.org
2b41e68a08 [PATCH] replace tdb database by simple lockless file database
This makes the udev operation completely lockless by storing a
file for every node in /dev/.udevdb/* This solved the problem
with deadlocking concurrent udev processes waiting for each other
to release the file lock under heavy load.
2005-04-26 22:16:40 -07:00
greg@kroah.com
800ab95bd5 [PATCH] make udev-test.pl test for root permissions before running
Should prevent false error reports from happening.
2005-04-26 22:09:26 -07:00
kay.sievers@vrfy.org
091215a597 [PATCH] Apply the default permissions even if we found a entry in 2005-04-26 22:08:27 -07:00
kay.sievers@vrfy.org
2b0f835ccc [PATCH] add test for format chars in multiple symlinks to replace 2005-04-26 22:08:27 -07:00
kay.sievers@vrfy.org
7a947ce515 [PATCH] big cleanup of internal udev api
Here is the first patch to cleanup the internal processing of the
various stages of an udev event. It should not change any behavior,
but if your system depends on udev, please always test it before reboot :)

We pass only one generic structure around between add, remove,
namedev, db and dev_d handling and make all relevant data available
to all internal stages. All udev structures are renamed to "udev".

We replace the fake parameter by a flag in the udev structure.

We open the class device in the main binaries and not in udev_add, to
make it possible to use libsysfs for udevstart directory crawling.

The last sleep parameters are removed.
2005-04-26 22:02:46 -07:00
kay.sievers@vrfy.org
f608f8ac16 [PATCH] fix problems using scsi_id with udevstart
when udevstart was running we didn't set the environment and the
subsystem argument for the callouts the dev.d/ scripts.

Here is a fix, that sets that with every udevstart iteration, corrects
argv[0] to be the basename() only not the whole path  and adds a test
for invoking callouts without arguments.
2005-04-26 21:37:03 -07:00
kay.sievers@vrfy.org
0345b86235 [PATCH] add enum tests
On Fri, Sep 10, 2004 at 01:09:07PM -0700, Greg KH wrote:
> On Tue, Sep 07, 2004 at 01:19:34PM +0200, David Zeuthen wrote:
> >
> >         KERNEL="sr*", NAME="%k", SYMLINK="cdrom%e"
> >         KERNEL="scd*", NAME="%k", SYMLINK="cdrom%e"
> >         KERNEL="pcd*", NAME="%k", SYMLINK="cdrom%e"
> >         KERNEL="hd[a-z]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="cdrom", NAME="\%k", SYMLINK="cdrom%e"
> >         KERNEL="fd[0-9]", NAME="%k", SYMLINK="floppy%e"
> >         KERNEL="hd[a-z]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="floppy", NAME=\"%k", SYMLINK="floppy%e"
> >
> > New patch is attached.
>
> Nice, I've applied this.
>
> How about sending a patch for the test/udev-test.pl script that adds a
> test for this new paramater, so we make sure to not break it in the
> future.

Here are the tests for the enumeration character %e. I've added a option
string to be able to do a whole sequence of tests without node removal,
so we can skip the "remove" event and get an increasing number to append
to the name. After the sequence test the whole directory is cleaned for
the next tests.
2005-04-26 21:37:01 -07:00
kay.sievers@vrfy.org
3db7fa2702 [PATCH] fix udev segfaults with bad permissions file
On Tue, Sep 14, 2004 at 02:53:12PM +0200, Loleslaw wrote:
> Hi,
> Since I started using udev-031 on my gentoo udevstart would just segfault
> (udev-030 worked). As it turned out I had a file in /etc/udev/permissions.d
> with a single space in one line. I've cleaned the file and it works all
> right, but I thought you could be interested.
> I've traced it to function namedev_init_permissions in namedev_parse.c
> I don't know C well enough to suggest a patch.

Yeah, thanks for pointing that out. It only happens if the file ends with
whitespace-only lines. Here is a fix and a test for udev-test.pl to
cover that case.
2005-04-26 21:37:01 -07:00
greg@kroah.com
0f36e68e8a [PATCH] add test for ! in partition name 2005-04-26 21:35:47 -07:00
greg@kroah.com
b86691919a [PATCH] Added expanded tests to the test framework from Leann Ogasawara <ogasawara@osdl.org> 2005-04-26 21:35:15 -07:00
kay.sievers@vrfy.org
bbbe503ec1 [PATCH] netdev - udevdb+dev.d changes
Here is a patch to change the netdev handling in the database and for
the dev.d/ calls. I applies on top of the udevd.patch, cause klibc has
no sysinfo().

 o netdev's are also put into our database now. I want this for the
   udevruler gui to get a list of all handled devices.
   All devices in the db are stamped with the system uptime value at
   the creation time. 'udevinfo -d' prints it.

 o the DEVPATH value is the key for udevdb, but if we rename
   a netdev, the name is replaced in the kernel, so we add
   the changed name to the db to match with the remove event.

   NOTE: The dev.d/ scripts still get the original name from the
   hotplug call. Should we replace DEVPATH with the new name too?

 o We now only add a device to the db, if we have successfully created
   the main node or successfully renamed a netdev. This is the main part
   of the patch, cause I needed to clean the retval passing trough all
   the functions used for node creation.

 o DEVNODE sounds a bit ugly for netdev's so I exported DEVNAME too.
   Can we change the name?

 o I've added a UDEV_NO_DEVD to possibly skip the script execution
   and used it in udev-test.pl.
   udevstart is the same horror now, if you have scripts with logging
   statements in dev.d/ it takes minutes to finish, can we skip the
   scripts here too?

 o The get_device_type() function is changed to be more strict, cause
   'udevinfo -a -p /block/' gets a class device for it and tries to
   print the major/minor values.

 o bugfix, the RESULT value has now a working newline removal and a test
   for this case.
2005-04-26 21:35:13 -07:00