Package: udev
Version: 0.100-2.2
Severity: normal
Tags: patch

The below patch has two parts.  The first part fixes a minor bug in that
get_media() should not be called with devname==NULL.

The second is more serious, the current code will label the target of a
sym-link rather than the link itself.  This means that the link does not
get it's context set and the target gets the wrong context.
Incidentally this affects the labelling of hard disk device nodes and
can get in the way of booting.

This is the only bug that needs to be fixed for etch SE Linux support.

--- ../udev_selinux.c   2006-10-20 22:43:35.000000000 +1000
+++ udev_selinux.c      2006-12-05 23:14:55.000000000 +1100
@@ -90,10 +90,13 @@
                char *media;
                int ret = -1;
 
-               media = get_media(devname, mode);
-               if (media) {
-                       ret = matchmediacon(media, &scontext);
-                       free(media);
+               if(devname)
+               {
+                       media = get_media(devname, mode);
+                       if (media) {
+                               ret = matchmediacon(media, &scontext);
+                               free(media);
+                       }
                }
 
                if (ret < 0)
@@ -102,7 +105,7 @@
                                return;
                        } 
 
-               if (setfilecon(file, scontext) < 0)
+               if (lsetfilecon(file, scontext) < 0)
                        err("setfilecon %s failed: %s", file, strerror(errno));
 
                freecon(scontext);


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to