2be1413
commit 91cbd80ad6f86af2d5696caeab2be0c404c4663c
357a0bb
Author: Nils Philippsen <nils@redhat.com>
2be1413
Date:   Thu Oct 22 14:29:41 2009 +0200
357a0bb
357a0bb
    patch: udev
357a0bb
    
357a0bb
    Squashed commit of the following:
357a0bb
    
2be1413
    commit e385558cf214d263af93147995f1f8b729d2dabe
2be1413
    Author: Nils Philippsen <nils@redhat.com>
2be1413
    Date:   Thu Oct 22 14:19:53 2009 +0200
2be1413
    
2be1413
        fix device file ownership and mode
2be1413
    
357a0bb
    commit fe874d6f9873598e8bcd9201508bc2c89365e821
357a0bb
    Author: Nils Philippsen <nils@redhat.com>
357a0bb
    Date:   Thu Oct 22 11:16:16 2009 +0200
357a0bb
    
357a0bb
        adapt generated udev rules for Fedora
357a0bb
357a0bb
diff --git a/tools/sane-desc.c b/tools/sane-desc.c
2be1413
index c317700..07f3a2b 100644
357a0bb
--- a/tools/sane-desc.c
357a0bb
+++ b/tools/sane-desc.c
2be1413
@@ -56,9 +56,9 @@
2be1413
 #define COLOR_NEW          "\"#F00000\""
2be1413
 #define COLOR_UNKNOWN      "\"#000000\""
2be1413
 
2be1413
-#define DEVMODE  "0664"
2be1413
+#define DEVMODE  "0644"
2be1413
 #define DEVOWNER "root"
2be1413
-#define DEVGROUP "scanner"
2be1413
+#define DEVGROUP "root"
2be1413
 
2be1413
 #ifndef PATH_MAX
2be1413
 # define PATH_MAX 1024
2be1413
@@ -3475,8 +3475,8 @@ print_udev (void)
2be1413
 	    }
2be1413
 	}
2be1413
       printf ("\n");
2be1413
-      printf ("ATTR{idVendor}==\"%s\", ATTR{idProduct}==\"%s\", MODE=\"%s\", GROUP=\"%s\", ENV{libsane_matched}=\"yes\"\n",
2be1413
-	      usbid->usb_vendor_id + 2,  usbid->usb_product_id + 2, DEVMODE, DEVGROUP);
2be1413
+      printf ("ATTR{idVendor}==\"%s\", ATTR{idProduct}==\"%s\", MODE=\"%s\", OWNER=\"%s\", GROUP=\"%s\", ENV{libsane_matched}=\"yes\"\n",
2be1413
+	      usbid->usb_vendor_id + 2,  usbid->usb_product_id + 2, DEVMODE, DEVOWNER, DEVGROUP);
2be1413
       usbid = usbid->next;
2be1413
     }
2be1413
 
2be1413
@@ -3488,7 +3488,8 @@ print_udev (void)
357a0bb
   printf ("SUBSYSTEMS!=\"scsi\", GOTO=\"libsane_scsi_rules_end\"\n\n");
357a0bb
   printf ("LABEL=\"libsane_scsi_rules_begin\"\n");
357a0bb
   printf ("# Generic: SCSI device type 6 indicates a scanner\n");
357a0bb
-  printf ("KERNEL==\"sg[0-9]*\", NAME=\"%%k\", ATTRS{type}==\"6\", MODE=\"%s\", GROUP=\"%s\"\n", DEVMODE, DEVGROUP);
2be1413
+  printf ("KERNEL==\"sg[0-9]*\", ATTRS{type}==\"6\", MODE=\"%s\", OWNER=\"%s\", GROUP=\"%s\", ENV{libsane_matched}=\"yes\"\n",
2be1413
+          DEVMODE, DEVOWNER, DEVGROUP);
357a0bb
   printf ("# Some scanners advertise themselves as SCSI device type 3\n");
357a0bb
 
357a0bb
   while (scsiid)
2be1413
@@ -3521,8 +3522,8 @@ print_udev (void)
357a0bb
 	    }
357a0bb
         }
357a0bb
       printf ("\n");
357a0bb
-      printf ("KERNEL==\"sg[0-9]*\", NAME=\"%%k\", ATTRS{type}==\"3\", ATTRS{vendor}==\"%s\", ATTRS{model}==\"%s\", MODE=\"%s\", GROUP=\"%s\"\n",
357a0bb
-	      scsiid->scsi_vendor_id, scsiid->scsi_product_id, DEVMODE, DEVGROUP);
2be1413
+      printf ("KERNEL==\"sg[0-9]*\", ATTRS{type}==\"3\", ATTRS{vendor}==\"%s\", ATTRS{model}==\"%s\", MODE=\"%s\", OWNER=\"%s\", GROUP=\"%s\", ENV{libsane_matched}=\"yes\"\n",
2be1413
+	      scsiid->scsi_vendor_id, scsiid->scsi_product_id, DEVMODE, DEVOWNER, DEVGROUP);
357a0bb
       scsiid = scsiid->next;
357a0bb
     }
357a0bb
   printf ("LABEL=\"libsane_scsi_rules_end\"\n\n");