rpms/udev/devel udev-084-pg.patch, NONE, 1.1 udev-rules.patch, 1.2, 1.3 udev.spec, 1.150, 1.151

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Feb 22 08:19:09 UTC 2006


Author: harald

Update of /cvs/dist/rpms/udev/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv26583

Modified Files:
	udev-rules.patch udev.spec 
Added Files:
	udev-084-pg.patch 
Log Message:
- fixed group issue with vol_id (bz #181432)
- fixed dvb permissions (bz #179993)
- added support for scsi media changer (bz #181911)
- fixed pktcdvd device creation (bz #161268)


udev-084-pg.patch:
 extras/volume_id/vol_id.c |    2 +-
 udev_libc_wrapper.c       |   44 +++++++++++++++++++++++++++++++++++++++++---
 udev_libc_wrapper.h       |    1 +
 3 files changed, 43 insertions(+), 4 deletions(-)

--- NEW FILE udev-084-pg.patch ---
If we're looking for a user's primary GID, look up the primary GID instead of
guessing the name of the user's primary group.

--- udev-084/udev_libc_wrapper.h	2006-01-30 02:51:38.000000000 -0500
+++ udev-084/udev_libc_wrapper.h	2006-02-13 17:22:56.000000000 -0500
@@ -139,6 +139,7 @@
 #endif
 
 extern uid_t lookup_user(const char *user);
+extern gid_t lookup_user_primary_group(const char *user);
 extern gid_t lookup_group(const char *group);
 
 extern size_t strlcpy(char *dst, const char *src, size_t size);
--- udev-084/udev_libc_wrapper.c	2006-01-30 02:51:38.000000000 -0500
+++ udev-084/udev_libc_wrapper.c	2006-02-13 17:38:48.000000000 -0500
@@ -106,6 +106,20 @@
 	return uid;
 }
 
+gid_t lookup_user_primary_group(const char *user)
+{
+	struct passwd *pw;
+	gid_t gid = 0;
+
+	pw = getpwnam(user);
+	if (pw == NULL)
+		info("specified user unknown '%s'", user);
+	else
+		gid = pw->pw_gid;
+
+	return gid;
+}
+
 gid_t lookup_group(const char *group)
 {
 	struct group *gr;
@@ -126,7 +140,8 @@
 #define GROUP_FILE		"/etc/group"
 
 /* return the id of a passwd style line, selected by the users name */
-static unsigned long get_id_by_name(const char *uname, const char *dbfile)
+static unsigned long get_id_field_by_name(const char *uname, const char *dbfile,
+					  int field)
 {
 	unsigned long id = 0;
 	char line[LINE_SIZE];
@@ -165,8 +180,14 @@
 		if (name == NULL)
 			continue;
 
-		/* skip pass */
-		if (strsep(&pos, ":") == NULL)
+		/* skip password and n other fields */
+		field -= 2;
+		while (field > 0) {
+			if ((pos == NULL) || (strsep(&pos, ":") == NULL))
+				continue;
+			field--;
+		}
+		if (pos == NULL)
 			continue;
 
 		/* get id */
@@ -189,6 +210,15 @@
 	return id;
 }
 
+static unsigned long get_id_by_name(const char *uname, const char *dbfile)
+{
+	return get_id_field_by_name(uname, dbfile, 3);
+}
+static unsigned long get_second_id_by_name(const char *uname, const char *dbfile)
+{
+	return get_id_field_by_name(uname, dbfile, 4);
+}
+
 uid_t lookup_user(const char *user)
 {
 	unsigned long id;
@@ -197,6 +227,14 @@
 	return (uid_t) id;
 }
 
+gid_t lookup_user_primary_group(const char *user)
+{
+	unsigned long id;
+
+	id = get_second_id_by_name(user, PASSWD_FILE);
+	return (gid_t) id;
+}
+
 gid_t lookup_group(const char *group)
 {
 	unsigned long id;
--- udev-084/extras/volume_id/vol_id.c	2006-01-30 02:51:38.000000000 -0500
+++ udev-084/extras/volume_id/vol_id.c	2006-02-13 17:22:56.000000000 -0500
@@ -151,7 +151,7 @@
 
 	/* drop all privileges */
 	nobody_uid = lookup_user("nobody");
-	nobody_gid = lookup_group("nogroup");
+	nobody_gid = lookup_user_primary_group("nobody");
 	if (nobody_uid > 0 && nobody_gid > 0) {
 		if (setgroups(0, NULL) != 0 ||
 		    setgid(nobody_gid) != 0 ||

udev-rules.patch:
 05-udev-early.rules  |    9 +++
 95-pam-console.rules |    1 
 hotplug.rules        |   13 +++--
 udev.rules           |  129 ++++++++++++++++++++++++++++-----------------------
 4 files changed, 91 insertions(+), 61 deletions(-)

Index: udev-rules.patch
===================================================================
RCS file: /cvs/dist/rpms/udev/devel/udev-rules.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- udev-rules.patch	7 Feb 2006 11:13:42 -0000	1.2
+++ udev-rules.patch	22 Feb 2006 08:19:05 -0000	1.3
@@ -1,11 +1,6 @@
---- /dev/null	2006-02-07 10:47:25.401206250 +0100
-+++ udev-084/etc/udev/redhat/95-pam-console.rules	2006-02-07 11:30:42.000000000 +0100
-@@ -0,0 +1 @@
-+ACTION=="add", SYSFS{dev}="?*", KERNEL=="?*", RUN+="/sbin/pam_console_apply $env{DEVNAME} $env{DEVLINKS}"
-
---- udev-084/etc/udev/redhat/hotplug.rules.redhat	2006-01-30 08:51:38.000000000 +0100
-+++ udev-084/etc/udev/redhat/hotplug.rules	2006-02-07 10:58:51.000000000 +0100
-@@ -1,9 +1,16 @@
+--- udev-084/etc/udev/redhat/hotplug.rules.rhrules	2006-01-30 08:51:38.000000000 +0100
++++ udev-084/etc/udev/redhat/hotplug.rules	2006-02-22 09:13:38.000000000 +0100
+@@ -1,8 +1,15 @@
  # do not call hotplug.d and dev.d for "drivers" and "module" events
 -SUBSYSTEM=="drivers",	OPTIONS="last_rule"
 -SUBSYSTEM=="module",	OPTIONS="last_rule"
@@ -24,12 +19,15 @@
  
 +
 +LABEL="hotplug_end"
-
---- /dev/null	2006-02-07 10:47:25.401206250 +0100
-+++ udev-084/etc/udev/redhat/05-udev-early.rules	2006-02-07 11:30:42.000000000 +0100
+--- /dev/null	2006-02-15 18:27:05.942547250 +0100
++++ udev-084/etc/udev/redhat/95-pam-console.rules	2006-02-22 09:13:38.000000000 +0100
+@@ -0,0 +1 @@
++ACTION=="add", SYSFS{dev}="?*", KERNEL=="?*", RUN+="/sbin/pam_console_apply $env{DEVNAME} $env{DEVLINKS}"
+--- /dev/null	2006-02-15 18:27:05.942547250 +0100
++++ udev-084/etc/udev/redhat/05-udev-early.rules	2006-02-22 09:13:38.000000000 +0100
 @@ -0,0 +1,9 @@
 +# sysfs is populated after the event is sent
-+ACTION=="add", DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
++ACTION=="add", DEVPATH=="/devices/*", DEVPATH!="*usb*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
 +ACTION=="add", SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"
 +
 +# ignore these events until someone needs them
@@ -37,8 +35,8 @@
 +SUBSYSTEM=="module",		OPTIONS="ignore_device"
 +
 +ACTION=="add", SUBSYSTEM=="firmware", ENV{FIRMWARE}=="*", RUN="/sbin/firmware_helper", OPTIONS="last_rule"
---- udev-084/etc/udev/redhat/udev.rules.redhat	2006-01-30 08:51:38.000000000 +0100
-+++ udev-084/etc/udev/redhat/udev.rules	2006-02-07 11:30:42.000000000 +0100
+--- udev-084/etc/udev/redhat/udev.rules.rhrules	2006-01-30 08:51:38.000000000 +0100
++++ udev-084/etc/udev/redhat/udev.rules	2006-02-22 09:15:39.000000000 +0100
 @@ -3,6 +3,7 @@
  #
  # default is OWNER="root" GROUP="root", MODE="0600"
@@ -138,7 +136,20 @@
  
  # audio devices
  KERNEL=="dsp*",			MODE="0660"
-@@ -209,7 +220,7 @@
+@@ -142,9 +153,10 @@
+ KERNEL=="z90crypt",		MODE="0666"
+ 
+ # DVB
+-KERNEL=="dvb/*",		MODE="0660"
+ KERNEL=="dvb",			MODE="0660"
+-KERNEL=="dvb/adapter*",		MODE="0660"
++SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", NAME="%c", MODE="0660"
++
++
+ 
+ # create a symlink named after the device map name
+ # note devmap_name comes with extras/multipath
+@@ -209,7 +221,7 @@
  KERNEL=="fd[0-9]*",		SYMLINK+="floppy%e"
  KERNEL=="nst[0-9]", BUS=="scsi", 	SYMLINK+="tape%e", MODE="0660"
  KERNEL=="nosst[0-9]", BUS=="scsi", 	SYMLINK+="tape%e", MODE="0660"
@@ -147,9 +158,16 @@
  
  KERNEL=="umad*", 		NAME="infiniband/%k"
  KERNEL=="issm*", 		NAME="infiniband/%k"
-@@ -224,24 +235,25 @@
+@@ -221,28 +233,30 @@
+ KERNEL=="zappseudo",  		NAME="zap/pseudo"
+ KERNEL=="zap[0-9]*",  		NAME="zap/%n"
+ 
++KERNEL="pktcdvd", NAME="%k/control"
++
  BUS=="scsi", KERNEL=="sg[0-9]*", SYSFS{type}=="6", NAME="%k", SYMLINK="scanner%e", MODE="0660"
  
++BUS=="scsi", KERNEL=="sg[0-9]*", SYSFS{type}=="8", SYMLINK+="changer%e", MODE="0660"
++
  # do not seperate the next 2 lines!!
 -KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", PROGRAM=="/lib/udev/ide-media.sh %k", RESULT=="floppy", SYMLINK+="floppy%e", NAME{ignore_remove, all_partitions}="%k"
 +KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", PROGRAM=="ide-media.sh %k", RESULT=="floppy", SYMLINK+="floppy%e", NAME{ignore_remove, all_partitions}="%k"
@@ -176,17 +194,19 @@
  KERNEL=="hd[a-z]*", BUS=="ide", SYSFS{removable}=="1", NAME{ignore_remove}="%k"
  
 -KERNEL=="dvb*", PROGRAM=="/lib/udev/dvb.sh %k", NAME="%c"
-+# dvb
-+SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", NAME="%c"
- 
+-
  #######################################
  # Persistent block device stuff - begin
-@@ -297,37 +309,31 @@
+ #######################################
+@@ -297,37 +311,36 @@
  # Persistent block device stuff - end
  #####################################
  
 -ACTION=="add", SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'X=%k X=$${X#usbdev} B=$${X%%%%.*} D=$${X#*.}; echo bus/usb/$$B/$$D'", SYMLINK+="%c"
--
++# workaround for devices which do not report media changes
++BUS=="ide", KERNEL=="hd[a-z]", SYSFS{removable}=="1", \
++        ENV{ID_MODEL}=="IOMEGA_ZIP*",   NAME="%k", OPTIONS+="all_partitions"
+ 
 +ACTION=="add", SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", MODE="0644"
  
  # Perhaps this should just be for all subsystems?
@@ -210,14 +230,15 @@
 +ACTION=="add", SUBSYSTEM="scsi" , SYSFS{type}=="1", RUN+="/bin/sh -c 'echo 900 > /sys$$DEVPATH/timeout'"
  
 -ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="[07]", \
+-	RUN+="/sbin/modprobe sd_mod"
+-ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="14", \
 +ACTION=="add", SUBSYSTEM=="scsi_device", SYSFS{type}=="0|7|14", \
  	RUN+="/sbin/modprobe sd_mod"
--ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="14", \
--	RUN+="/sbin/modprobe sd_mod"
 -ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="[45]", \
 +ACTION=="add", SUBSYSTEM=="scsi_device", SYSFS{type}=="[45]", \
  	RUN+="/sbin/modprobe sr_mod"
 -ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="1", SYSFS{vendor}=="On[sS]tream", \
++
 +ACTION=="add", SUBSYSTEM=="scsi_device", SYSFS{type}=="1", SYSFS{device/vendor}=="On[sS]tream", \
  	SYSFS{model}!="ADR*", RUN+="/sbin/modprobe osst"
 -ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="1", SYSFS{vendor}=="On[sS]tream", \


Index: udev.spec
===================================================================
RCS file: /cvs/dist/rpms/udev/devel/udev.spec,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -r1.150 -r1.151
--- udev.spec	21 Feb 2006 19:47:51 -0000	1.150
+++ udev.spec	22 Feb 2006 08:19:05 -0000	1.151
@@ -5,7 +5,7 @@
 Summary: A userspace implementation of devfs
 Name: udev
 Version: 084
-Release: 3
+Release: 4
 License: GPL
 Group: System Environment/Base
 Provides: udev-persistent = 0:%{version}-%{release}
@@ -22,6 +22,7 @@
 Patch3: udevstart2.patch
 Patch4: udev-084-floppy.patch
 Patch5: udev-extras.patch
+Patch6: udev-084-pg.patch
 
 ExclusiveOS: Linux
 URL: http://kernel.org/pub/linux/utils/kernel/hotplug/
@@ -46,6 +47,7 @@
 %patch3 -p1 -b .rhudevstart
 %patch4 -p1 -b .rhfloppy
 %patch5 -p1 -b .rhextras
+%patch6 -p1 -b .pg
 
 %build
 
@@ -274,6 +276,12 @@
 %attr(0644,root,root) %{_mandir}/man8/vol_id*.8*
 
 %changelog
+* Wed Feb 22 2006 Harald Hoyer <harald at redhat.com> - 084-4
+- fixed group issue with vol_id (bz #181432)
+- fixed dvb permissions (bz #179993)
+- added support for scsi media changer (bz #181911)
+- fixed pktcdvd device creation (bz #161268)
+
 * Tue Feb 21 2006 Florian La Roche <laroche at redhat.com> - 084-3
 - also output the additional space char as part of the startup message
 




More information about the fedora-cvs-commits mailing list