]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/cups-deviced.c
Update svn:keyword properties.
[thirdparty/cups.git] / scheduler / cups-deviced.c
index 912109f1b985e9b7607ab0e19785438c49aa9bf9..0cd5b8ea8c4042065ae87a2c5c315a40cffb6871 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: cups-deviced.c 7816 2008-07-30 20:53:31Z mike $"
+ * "$Id$"
  *
- *   Device scanning mini-daemon for the Common UNIX Printing System (CUPS).
+ *   Device scanning mini-daemon for CUPS.
  *
- *   Copyright 2007-2008 by Apple Inc.
+ *   Copyright 2007-2011 by Apple Inc.
  *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -313,11 +313,22 @@ main(int  argc,                           /* I - Number of command-line args */
     {
       for (i = 0; i < num_backends; i ++)
         if (backend_fds[i].revents && backends[i].pipe)
-         if (get_device(backends + i))
+       {
+         cups_file_t *bpipe = backends[i].pipe;
+                                       /* Copy of pipe for backend... */
+
+         do
          {
-           backend_fds[i].fd     = 0;
-           backend_fds[i].events = 0;
+           if (get_device(backends + i))
+           {
+             backend_fds[i].fd     = 0;
+             backend_fds[i].events = 0;
+             break;
+           }
          }
+         while (bpipe->ptr &&
+                memchr(bpipe->ptr, '\n', bpipe->end - bpipe->ptr));
+        }
     }
 
    /*
@@ -446,10 +457,10 @@ compare_devices(cupsd_device_t *d0,       /* I - First device */
 
   if ((diff = cupsdCompareNames(d0->device_info, d1->device_info)) != 0)
     return (diff);
-  else if ((diff = strcasecmp(d0->device_class, d1->device_class)) != 0)
+  else if ((diff = _cups_strcasecmp(d0->device_class, d1->device_class)) != 0)
     return (diff);
   else
-    return (strcasecmp(d0->device_uri, d1->device_uri));
+    return (_cups_strcasecmp(d0->device_uri, d1->device_uri));
 }
 
 
@@ -756,6 +767,10 @@ start_backend(const char *name,            /* I - Backend to run */
 
   snprintf(program, sizeof(program), "%s/backend/%s", server_bin, name);
 
+  if (_cupsFileCheck(program, _CUPS_FILE_CHECK_PROGRAM, !geteuid(),
+                     _cupsFileCheckFilter, NULL))
+    return (-1);
+
   backend = backends + num_backends;
 
   argv[0] = (char *)name;
@@ -791,5 +806,5 @@ start_backend(const char *name,             /* I - Backend to run */
 
 
 /*
- * End of "$Id: cups-deviced.c 7816 2008-07-30 20:53:31Z mike $".
+ * End of "$Id$".
  */