1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-30 14:55:26 +03:00
Commit Graph

36 Commits

Author SHA1 Message Date
kay.sievers@vrfy.org
09e52d5126 [PATCH] apply permissions.conf support for wildcard and default name
Permissions given in udev.permissions are not applied if no METHOD from
udev.config is found. I've added do_kernelname() to scan for known
permissions if we only use the default method.

Simple support for wildcards is also added:

#name:user:group:mode
hdb*:2702:2702:0660

results in:

drwxr-xr-x    2 root     root          240 Nov 19 03:45 .
drwxr-xr-x   23 root     root          528 Nov 17 03:36 ..
brw-r--r--    1 root     root       3,   0 Nov 19 03:45 hda
brw-r--r--    1 root     root       3,   1 Nov 19 03:45 hda1
brw-r--r--    1 root     root       3,   2 Nov 19 03:45 hda2
brw-r--r--    1 root     root       3,   4 Nov 19 03:45 hda4
brw-r-----    1 kay      kay        3,  64 Nov 19 03:45 hdb
brw-r-----    1 kay      kay        3,  65 Nov 19 03:45 hdb1
brw-r--r--    1 root     root      22,   0 Nov 19 03:45 hdc
crw-r--r--    1 root     root      81,   0 Nov 19 03:34 webcam0
2005-04-26 21:06:25 -07:00
greg@kroah.com
a43180955a [PATCH] turn DEBUG_PARSER off by default. 2005-04-26 21:06:24 -07:00
arnd@arndb.de
70033702cd [PATCH] more robust config file parsing in namedev.c
After getting a number of different crashes for udev reading broken
udev.config files, I decided to try to make the parser a little
more robust.

The behaviour is changed to stop reading the configuration file
and logging the broken entry instead of silently ignoring it (is
that good? It's easy to just print and continue).
All strcpy()'s to a fixed length string are now implicitly limited
to the bounds of the target string.

I kept the -ENODEV return code for now, not sure if there should be
different ones.
2005-04-26 21:06:24 -07:00
arnd@arndb.de
ae2859df40 [PATCH] add bus id modifier
On Tuesday 18 November 2003 02:14, Greg KH wrote:
> On Mon, Nov 17, 2003 at 06:33:32PM +0100, Arnd Bergmann wrote:
> > That would at least be part of the solution I'm looking for. How about
> > extra format characters for bus_id and for the result of a callout
> > program?
>
> Sure, I can see the use for that.  Want to send a patch?  :)

> Take a look at the current bk tree (which has moved to
> bk://linuxusb.bkbits.net/udev/ )  I've made finding that device a lot
> easier now, and it works for all rule types.

Great, just what I was missing. I didn't see the any link to the bk
repository. Here's the patch for the bus_id. I'll need to think about
the handling of callout results a bit more.
2005-04-26 21:06:24 -07:00
greg@kroah.com
5e6e29fd35 [PATCH] change debug level on printf values for now. 2005-04-26 21:06:24 -07:00
greg@kroah.com
7408a7fbb5 [PATCH] fix up printf-like functionality due to previous changes. 2005-04-26 21:06:24 -07:00
kay.sievers@vrfy.org
98b88dbf70 [PATCH] implement printf-like placeholder support for NAME
> Problem is, if you use the LABEL rule to match a device, like a SCSI
> vendor, then all of the partitions, as well as the main block device,
> will end up with the same name.  That's why I added the "add the number"
> hack to the LABEL rule.
>
> So yes, your patch is correct in that we shouldn't always be adding the
> number to any match for LABEL (like for char devices), but if we do
> that, then we break partitions.  Your '%' patch fixes this, but I'd just
> like to extend it a bit.  Let me see what I can come up with...

Oh, I see. Do you mean something like this:

LABEL, BUS="usb", model="Creative Labs WebCam 3", NAME="webcam%n-%M:%m-test"

results in: "webcam0-81:0-test"

Nov 15 16:51:53 pim udev[16193]: get_class_dev: looking at /sys/class/video4linux/video0
Nov 15 16:51:53 pim udev[16193]: get_class_dev: class_dev->name = video0
Nov 15 16:51:53 pim udev[16193]: get_major_minor: dev = 81:0
Nov 15 16:51:53 pim udev[16193]: get_major_minor: found major = 81, minor = 0
Nov 15 16:51:53 pim udev[16193]: udev_add_device: name = webcam0-81:0-test
Nov 15 16:51:53 pim udev[16193]: create_node: mknod(/udev/webcam0-81:0-test, 020666, 81, 0)



  implement printf-like placeholder support for NAME
  %n-kernel number, %M-major number, %m-minor number
2005-04-26 21:06:24 -07:00
greg@kroah.com
20ff86bd71 [PATCH] trailing whitespace cleanups. 2005-04-26 21:06:24 -07:00
greg@kroah.com
ca1cc0fe74 [PATCH] splig LABEL and NUMBER into separate functions.
Now items are processed in priority order, fixing that bug.
2005-04-26 21:06:24 -07:00
greg@kroah.com
8c51bbfe5f [PATCH] move TOPOLOGY rule to it's own function. 2005-04-26 21:06:23 -07:00
greg@kroah.com
8a0c11d360 [PATCH] fix bug where NUMBER and TOPOLOGY would not work for partitions. 2005-04-26 21:06:23 -07:00
greg@kroah.com
7bd22a78a1 [PATCH] clean up the way we find the sysdevice for a block device for namedev. 2005-04-26 21:06:23 -07:00
greg@kroah.com
120d45d0a1 [PATCH] split REPLACE and CALLOUT into separate functions
Finally starting to process this in priority order, not config file order.
2005-04-26 21:06:23 -07:00
greg@kroah.com
07b80e6d55 [PATCH] add debug line for REPLACE call. 2005-04-26 21:06:23 -07:00
greg@kroah.com
6c5c770ac6 [PATCH] turn off debugging in namedev 2005-04-26 21:06:22 -07:00
greg@kroah.com
1e959a4b05 [PATCH] klibc specific tweaks 2005-04-26 21:06:22 -07:00
greg@kroah.com
64455bfc69 [PATCH] fix LABEL bug for device files (not class files.) 2005-04-26 21:04:10 -07:00
greg@kroah.com
9d496c74f3 [PATCH] got rid of struct device_attr
namedev.c is still a mess, that's up next after testing...
2005-04-26 21:04:10 -07:00
kay@vrfy.org
c2ec26b928 [PATCH] namedev.c comments + debug patch
and a patch for namdev.c comments + debug
o correct 'device device'
o correct permission file to config file
2005-04-26 21:04:09 -07:00
greg@kroah.com
116176b0bd [PATCH] fix dbg line in namedev.c
Thanks to Kay Sievers <kay@vrfy.org> for pointing this out.
2005-04-26 21:04:09 -07:00
greg@kroah.com
c056c5141b [PATCH] make config files, sysfs root, and udev root configurable from config variables
This will make running tests a lot simpler.
2005-04-26 21:01:42 -07:00
dsteklof@us.ibm.com
fe3fe3b29f [PATCH] new version of libsysfs patch
Here's the patch applying the latest libsysfs.
	- adds the latest libsysfs code to udev
		* new code includes dlist implementation, a generic linked list
			implementation. Needed our own because LGPL
		* rearranged structures
		* provided more functions for accessing directory and attributes
	- gets rid of ->directory->path references in namedev.c
	- replaces sysfs_get_value_from_attributes with sysfs_get_classdev_attr
2005-04-26 21:01:42 -07:00
rml@tech9.net
c2405f502c [PATCH] udev: mode should be mode_t
Unix file modes should be stored in a mode_t, not a standard type.  At
the moment it is actually unsigned, in fact, not a signed integer.

Attached patch does an s/int mode/mode_t mode/ and cleans up the
results.
2005-04-26 21:01:41 -07:00
greg@kroah.com
5ef7b7992a [PATCH] add dbg_parse() to cut down on parse file debugging statements
Can be turned on by hand in the namedev.c file.
2005-04-26 21:01:41 -07:00
patmans@us.ibm.com
c27e69116d [PATCH] add callout config type to udev
This patch adds a callout config type to udev, so external programs can be
called to get serial numbers or id's that are not available as a sysfs
attribute.
2005-04-26 21:01:40 -07:00
greg@kroah.com
149f210617 [PATCH] clean up some debugging stuff in namedev.c 2005-04-26 21:01:40 -07:00
greg@kroah.com
615e05f84a [PATCH] oops, everything was getting created as 000 mode, try to fix this up, 2005-04-26 21:01:40 -07:00
greg@kroah.com
03e64c8f8c [PATCH] start working on label support, and fix some segfaults for block devices. 2005-04-26 21:01:40 -07:00
greg@kroah.com
8a6fbab6dd [PATCH] add NUMBER support (basically same logic as TOPOLOGY, perhaps we should merge this...) 2005-04-26 21:01:40 -07:00
greg@kroah.com
20051a5be9 [PATCH] added topology support. 2005-04-26 21:01:40 -07:00
greg@kroah.com
c18d70b447 [PATCH] got REPLACE to work properly. 2005-04-26 21:01:40 -07:00
greg@kroah.com
cb32ac946f [PATCH] make struct config_device contain a struct device_attr instead of duplicating the mess. 2005-04-26 21:01:40 -07:00
greg@kroah.com
19dc5d4ce1 [PATCH] Clean up the namedev interface a bit, making the code smaller... 2005-04-26 21:01:39 -07:00
greg@kroah.com
185a35a403 [PATCH] add initial libsysfs support...
needs lots more cleanup, but is much nicer than doing this by hand...
2005-04-26 21:01:39 -07:00
greg@kroah.com
469c7cff3b [PATCH] namedev config files are fully parsed.
now to do something with the data...
2005-04-26 21:01:39 -07:00
greg@kroah.com
2232cac825 [PATCH] Initial namedev parsing of config files
.permission parsing works, .config needs more work.
2005-04-26 21:01:38 -07:00