]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/cups-deviced.c
Load cups into easysw/current.
[thirdparty/cups.git] / scheduler / cups-deviced.c
index fd0101acd48564f5d719d7ebd18dd4234b1de6c3..00ad8b8608ac05fad77610ad56c4db17b1ddd443 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: cups-deviced.c 5044 2006-02-01 21:35:30Z mike $"
+ * "$Id: cups-deviced.c 5244 2006-03-08 12:12:12Z mike $"
  *
  *   Device scanning mini-daemon for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2005 by Easy Software Products.
+ *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
 #include <cups/array.h>
 #include <cups/dir.h>
 
+#ifdef __hpux
+#  define seteuid(uid) setresuid(-1, (uid), -1)
+#endif /* __hpux */
+
 
 /*
  * Device information structure...
@@ -130,15 +134,6 @@ main(int  argc,                            /* I - Number of command-line args */
   {
     fputs("Usage: cups-deviced request-id limit user-id options\n", stderr);
 
-    cupsdSendIPPHeader(IPP_BAD_REQUEST, request_id);
-    cupsdSendIPPGroup(IPP_TAG_OPERATION);
-    cupsdSendIPPString(IPP_TAG_CHARSET, "attributes-charset", "utf-8");
-    cupsdSendIPPString(IPP_TAG_LANGUAGE, "attributes-natural-language",
-                       "en-US");
-    cupsdSendIPPString(IPP_TAG_TEXT, "status-message",
-                       "Bad command-line arguments passed to cups-deviced!");
-    cupsdSendIPPTrailer();
-
     return (1);
   }
 
@@ -146,15 +141,6 @@ main(int  argc,                            /* I - Number of command-line args */
   {
     fprintf(stderr, "cups-deviced: Bad request ID %d!\n", request_id);
 
-    cupsdSendIPPHeader(IPP_BAD_REQUEST, request_id);
-    cupsdSendIPPGroup(IPP_TAG_OPERATION);
-    cupsdSendIPPString(IPP_TAG_CHARSET, "attributes-charset", "utf-8");
-    cupsdSendIPPString(IPP_TAG_LANGUAGE, "attributes-natural-language",
-                       "en-US");
-    cupsdSendIPPString(IPP_TAG_TEXT, "status-message",
-                       "Bad request ID argument passed to cups-deviced!");
-    cupsdSendIPPTrailer();
-
     return (1);
   }
 
@@ -163,15 +149,6 @@ main(int  argc,                            /* I - Number of command-line args */
   {
     fprintf(stderr, "cups-deviced: Bad user %d!\n", normal_user);
 
-    cupsdSendIPPHeader(IPP_BAD_REQUEST, request_id);
-    cupsdSendIPPGroup(IPP_TAG_OPERATION);
-    cupsdSendIPPString(IPP_TAG_CHARSET, "attributes-charset", "utf-8");
-    cupsdSendIPPString(IPP_TAG_LANGUAGE, "attributes-natural-language",
-                       "en-US");
-    cupsdSendIPPString(IPP_TAG_TEXT, "status-message",
-                       "Bad user ID argument passed to cups-deviced!");
-    cupsdSendIPPTrailer();
-
     return (1);
   }
 
@@ -209,16 +186,6 @@ main(int  argc,                            /* I - Number of command-line args */
     fprintf(stderr, "ERROR: [cups-deviced] Unable to open backend directory "
                     "\"%s\": %s", backends, strerror(errno));
 
-    snprintf(line, sizeof(line), "Unable to open backend directory \"%s\": %s",
-             backends, strerror(errno));
-    cupsdSendIPPHeader(IPP_BAD_REQUEST, request_id);
-    cupsdSendIPPGroup(IPP_TAG_OPERATION);
-    cupsdSendIPPString(IPP_TAG_CHARSET, "attributes-charset", "utf-8");
-    cupsdSendIPPString(IPP_TAG_LANGUAGE, "attributes-natural-language",
-                       "en-US");
-    cupsdSendIPPString(IPP_TAG_TEXT, "status-message", line);
-    cupsdSendIPPTrailer();
-
     return (1);
   }
 
@@ -309,7 +276,7 @@ main(int  argc,                             /* I - Number of command-line args */
         if (!strncasecmp(line, "Usage", 5))
          compat = 1;
         else if (sscanf(line,
-                       "%63s%1023s%*[ \t]\"%255[^\"]\"%*[ \t]\"%127[^\"]"
+                       "%63s%1023s%*[ \t]\"%255[^\"]\"%*[ \t]\"%127[^\"]\""
                        "%*[ \t]\"%1023[^\"]",
                        dclass, uri, make_model, info, device_id) < 4)
         {
@@ -533,5 +500,5 @@ sigalrm_handler(int sig)            /* I - Signal number */
 
 
 /*
- * End of "$Id: cups-deviced.c 5044 2006-02-01 21:35:30Z mike $".
+ * End of "$Id: cups-deviced.c 5244 2006-03-08 12:12:12Z mike $".
  */