udev does not handle correctly multi links
Sorry for my English.
As Harald Hoyer request, I forward a fix (see attachment) for multi links in one rule.
The patch in attachment is again a vanilla udev-032.
I don't test this patch !
It also content some patch from Fedora (mainly udev-030-symlink.patch from udev-032-7).
My original patch is again udev-032-7 from Fedore Core rawhide. it can be find here :
https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=104682&action=view
or here :
http://feliciano.matias.free.fr/udev/ (udev-032-symlink2.patch) It only apply after all Red Hat patchs.
For the record :
bug in redhat bugzilla :
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=134478
An explanation in fedora-test-list mailing :
http://www.redhat.com/archives/fedora-test-list/2004-October/msg00202.html
Thanks for udev ;-)
dev_d.c +18 -0
@@ -65,21 +65,39 @@ {char dirname[256 ];char env_devname[NAME_SIZE ]; +char env_symlink[NAME_SIZE ];char *devname;char *temp;if (udev_dev_d ==0 )return ; + env_devname[0 ] =0 ; + env_symlink[0 ] =0 ; +if (dev->type =='b' || dev->type =='c' ) { +char *pos; +int len; +char namelink[NAME_SIZE ];strfieldcpy (env_devname, udev_root);strfieldcat (env_devname, dev->name); + foreach_strpart(dev->symlink, " ", pos, len) { +if (env_symlink[0 ] !='\0' ) { +strfieldcat (env_symlink," " ); + } +strfieldcat (env_symlink, udev_root); +strncpy (namelink, pos, len); + namelink[len] ='\0' ; +strfieldcat (env_symlink, namelink); + } }else if (dev->type =='n' ) {strfieldcpy (env_devname, dev->name);setenv ("DEVPATH" , devpath,1 ); }setenv ("DEVNAME" , env_devname,1 );dbg ("DEVNAME='%s'" , env_devname); +setenv ("SYMLINK" , env_symlink,1 ); +dbg ("SYMLINK='%s'" , env_symlink); devname =strdup (dev->name);if (!devname) {
namedev.c +10 -6
@@ -898,14 +898,18 @@if (dev->symlink[0 ] !='\0' ) {char temp[NAME_SIZE ]; - +char *p; +int len;info ("configured rule in '%s' at line %i applied, added symlink '%s'" , dev->config_file, dev->config_line, dev->symlink); -strfieldcpy (temp, dev->symlink); -apply_format (udev, temp,sizeof (temp), class_dev, sysfs_device); -if (udev->symlink[0 ] !='\0' ) -strfieldcat (udev->symlink," " ); -strfieldcat (udev->symlink, temp); + foreach_strpart(dev->symlink, " ", p, len) { +strncpy (temp, p, len); + temp[len] ='\0' ; +apply_format (udev, temp,sizeof (temp), class_dev, sysfs_device); +if (udev->symlink[0 ] !='\0' ) +strfieldcat (udev->symlink," " ); +strfieldcat (udev->symlink, temp); + } }if (dev->name[0 ] !='\0' ) {