]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Merge changes from CUPS 1.5rc1-r9833.
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 15 Jun 2011 00:37:13 +0000 (00:37 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 15 Jun 2011 00:37:13 +0000 (00:37 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@3318 a1ca3aef-8c08-0410-bb20-df032aa958be

20 files changed:
CHANGES.txt
INSTALL.txt
README.txt
backend/ieee1284.c
backend/runloop.c
backend/usb-libusb.c
config-scripts/cups-common.m4
config-scripts/cups-compiler.m4
cups/conflicts.c
cups/http-support.c
cups/transcode.c
packaging/cups.spec.in
scheduler/client.c
scheduler/conf.c
scheduler/cups-driverd.cxx
scheduler/ipp.c
scheduler/job.c
scheduler/sysman.c
test/ipp-1.1.test
test/ipptool.c

index e79e4884bcb56ee1df96983324b2271bbde761ca..0ae200933fb941f8359dc6d10f36ac80607b7b04 100644 (file)
@@ -1,8 +1,19 @@
-CHANGES.txt - 2011-06-05
+CHANGES.txt - 2011-06-14
 ------------------------
 
 CHANGES IN CUPS V1.5rc1
 
+       - Compile fixes (STR #3849, STR #3850)
+       - The scheduler didn't check for empty values for several configuration
+         directives (STR #3861)
+       - ipptool didn't generate valid XML when a test was skipped.
+       - Added additional error checking to the 1284 device ID code (STR #3858)
+       - Fixed some compatibility issues migrating from the old usblp backend
+         to the libusb backend (STR #3860)
+       - Fixed the wake-from-sleep printing behavior on Mac OS X.
+       - The scheduler incorrectly allowed jobs to be held from a terminating
+         state.
+       - The cups-driverd program could crash when a PPD was renamed.
        - The dnssd backend took too long to discover printers on large or busy
          networks with the new default timeout used by lpinfo and the web
          interface. This resulted in "lost" printers.
index cc97983432ad3d8dd62f439588c4b78a23d874f8..06b718db03c33cfa034107e30363550605a5a4cc 100644 (file)
@@ -1,4 +1,4 @@
-INSTALL - CUPS v1.5rc1 - 2011-06-05
+INSTALL - CUPS v1.5rc1 - 2011-06-14
 -----------------------------------
 
 This file describes how to compile and install CUPS from source code. For more
index bb9497e82cc858fa5bb1e631a9b14c90bc69c24e..42892ce758ed7bb42263e4c24dea36ae0ec4ca52 100644 (file)
@@ -1,4 +1,4 @@
-README - CUPS v1.5rc1 - 2011-06-05
+README - CUPS v1.5rc1 - 2011-06-14
 ----------------------------------
 
 Looking for compile instructions?  Read the file "INSTALL.txt"
index a9346d7a52bd9d3cd696138778ac89a05c75b383..a837325f08e628f0997e62d66e751ad6aae17bbd 100644 (file)
@@ -65,6 +65,7 @@ backendGetDeviceID(
 #  if defined(__sun) && defined(ECPPIOC_GETDEVID)
   struct ecpp_device_id did;           /* Device ID buffer */
 #  endif /* __sun && ECPPIOC_GETDEVID */
+  char *ptr;                           /* Pointer into device ID */
 
 
   DEBUG_printf(("backendGetDeviceID(fd=%d, device_id=%p, device_id_size=%d, "
@@ -186,7 +187,7 @@ backendGetDeviceID(
       * and then limit the length to the size of our buffer...
       */
 
-      if (length > device_id_size)
+      if (length > device_id_size || length < 14)
        length = (((unsigned)device_id[1] & 255) << 8) +
                 ((unsigned)device_id[0] & 255);
 
@@ -224,11 +225,12 @@ backendGetDeviceID(
        device_id[length] = '\0';
       }
     }
-#    ifdef DEBUG
     else
+    {
       DEBUG_printf(("backendGetDeviceID: ioctl failed - %s\n",
                     strerror(errno)));
-#    endif /* DEBUG */
+      *device_id = '\0';
+    }
 #  endif /* __linux */
 
 #   if defined(__sun) && defined(ECPPIOC_GETDEVID)
@@ -256,6 +258,22 @@ backendGetDeviceID(
 #  endif /* __sun && ECPPIOC_GETDEVID */
   }
 
+ /*
+  * Check whether device ID is valid. Turn line breaks and tabs to spaces and
+  * reject device IDs with non-printable characters.
+  */
+
+  for (ptr = device_id; *ptr; ptr ++)
+    if (_cups_isspace(*ptr))
+      *ptr = ' ';
+    else if ((*ptr & 255) < ' ' || *ptr == 127)
+    {
+      DEBUG_printf(("backendGetDeviceID: Bad device_id character %d.",
+                    *ptr & 255));
+      *device_id = '\0';
+      break;
+    }
+
   DEBUG_printf(("backendGetDeviceID: device_id=\"%s\"\n", device_id));
 
   if (scheme && uri)
index 43b83999639d1760fdca3276ddaaa398f96661fe..227883bfa27969ceeadc2afa8a6b2e185ee21466 100644 (file)
@@ -436,10 +436,7 @@ backendWaitLoop(
 {
   fd_set       input;                  /* Input set for reading */
   time_t       curtime,                /* Current time */
-               snmp_update = 0;
-#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
-  struct sigaction action;             /* Actions for POSIX signals */
-#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
+               snmp_update = 0;        /* Last SNMP status update */
 
 
   fprintf(stderr, "DEBUG: backendWaitLoop(snmp_fd=%d, addr=%p, side_cb=%p)\n",
index 7f8c74a082f5f0d683d3972b2f04828f0671d879..4a36ca4839856a01e40bf289e26f592f4eb2e63f 100644 (file)
@@ -505,6 +505,7 @@ make_device_uri(
                *mdl,                   /* Model */
                *des,                   /* Description */
                *sern;                  /* Serial number */
+  size_t       mfglen;                 /* Length of manufacturer string */
   char         tempmfg[256],           /* Temporary manufacturer string */
                tempsern[256],          /* Temporary serial number string */
                *tempptr;               /* Pointer into temp string */
@@ -584,6 +585,16 @@ make_device_uri(
     mfg = tempmfg;
   }
 
+  mfglen = strlen(mfg);
+
+  if (!strncasecmp(mdl, mfg, mfglen) && _cups_isspace(mdl[mfglen]))
+  {
+    mdl += mfglen + 1;
+
+    while (_cups_isspace(*mdl))
+      mdl ++;
+  }
+
  /*
   * Generate the device URI from the manufacturer, model, serial number,
   * and interface number...
@@ -736,7 +747,87 @@ print_cb(usb_printer_t *printer,   /* I - Printer */
          const char    *device_id,     /* I - IEEE-1284 device ID */
          const void    *data)          /* I - User data (make, model, S/N) */
 {
-  return (!strcmp((char *)data, device_uri));
+  char requested_uri[1024],            /* Requested URI */
+       *requested_ptr,                 /* Pointer into requested URI */
+       detected_uri[1024],             /* Detected URI */
+       *detected_ptr;                  /* Pointer into detected URI */
+
+
+ /*
+  * If we have an exact match, stop now...
+  */
+
+  if (!strcmp((char *)data, device_uri))
+    return (1);
+
+ /*
+  * Work on copies of the URIs...
+  */
+
+  strlcpy(requested_uri, (char *)data, sizeof(requested_uri));
+  strlcpy(detected_uri, device_uri, sizeof(detected_uri));
+
+ /*
+  * libusb-discovered URIs can have an "interface" specification and this
+  * never happens for usblp-discovered URIs, so remove the "interface"
+  * specification from the URI which we are checking currently. This way a
+  * queue for a usblp-discovered printer can now be accessed via libusb.
+  *
+  * Similarly, strip "?serial=NNN...NNN" as needed.
+  */
+
+  if ((requested_ptr = strstr(requested_uri, "?interface=")) == NULL)
+    requested_ptr = strstr(requested_uri, "&interface=");
+  if ((detected_ptr = strstr(detected_uri, "?interface=")) == NULL)
+    detected_ptr = strstr(detected_uri, "&interface=");
+
+  if (!requested_ptr && detected_ptr)
+  {
+   /*
+    * Strip "[?&]interface=nnn" from the detected printer.
+    */
+
+    *detected_ptr = '\0';
+  }
+  else if (requested_ptr && !detected_ptr)
+  {
+   /*
+    * Strip "[?&]interface=nnn" from the requested printer.
+    */
+
+    *requested_ptr = '\0';
+  }
+
+  if ((requested_ptr = strstr(requested_uri, "?serial=?")) != NULL)
+  {
+   /*
+    * Strip "?serial=?" from the requested printer.  This is a special
+    * case, as "?serial=?" means no serial number and not the serial
+    * number '?'.  This is not covered by the checks below...
+    */
+
+    *requested_ptr = '\0';
+  }
+
+  if ((requested_ptr = strstr(requested_uri, "?serial=")) == NULL &&
+      (detected_ptr = strstr(detected_uri, "?serial=")) != NULL)
+  {
+   /*
+    * Strip "?serial=nnn" from the detected printer.
+    */
+
+    *detected_ptr = '\0';
+  }
+  else if (requested_ptr && !detected_ptr)
+  {
+   /*
+    * Strip "?serial=nnn" from the requested printer.
+    */
+
+    *requested_ptr = '\0';
+  }
+
+  return (!strcmp(requested_uri, detected_uri));
 }
 
 
index 06dce8181a670f66c5193afcc082d0d94e20438f..4c6c5262f5125c63e7e53e1b62e38b90df174af8 100644 (file)
@@ -406,7 +406,7 @@ AC_ARG_WITH(components, [  --with-components       set components to build:
 
 case "$COMPONENTS" in
        all)
-               BUILDDIRS="filter backend berkeley cgi-bin driver monitor notifier ppdc scheduler systemv conf data locale man doc examples templates"
+               BUILDDIRS="filter backend berkeley cgi-bin driver monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates"
                ;;
 
        core)
index 7a1d453c823550c3acc2e0bd7fd1f169e259f173..8699f6e55dc77923f395e51211cded7fa9f162a2 100644 (file)
@@ -162,7 +162,7 @@ if test -n "$GCC"; then
                else
                        AC_MSG_CHECKING(if GCC supports -Wno-tautological-compare)
                        OLDCFLAGS="$CFLAGS"
-                       CFLAGS="$CFLAGS -Wno-tautological-compare"
+                       CFLAGS="$CFLAGS -Werror -Wno-tautological-compare"
                        AC_TRY_COMPILE(,,
                                [OPTIM="$OPTIM -Wno-tautological-compare"
                                AC_MSG_RESULT(yes)],
index dd1bf3deb8cb1efc1e3c29203bc66bb18a95dc90..cded4585eec3ecea16b8da23d2a1e386fc4b2c47 100644 (file)
@@ -270,7 +270,7 @@ cupsResolveConflicts(
          * Resolver loop!
          */
 
-         DEBUG_printf(("1ppdResolveConflicts: Resolver loop with %s!",
+         DEBUG_printf(("1cupsResolveConflicts: Resolver loop with %s!",
                        consts->resolver));
           goto error;
        }
@@ -278,14 +278,14 @@ cupsResolveConflicts(
         if ((resolver = ppdFindAttr(ppd, "cupsUIResolver",
                                    consts->resolver)) == NULL)
         {
-         DEBUG_printf(("1ppdResolveConflicts: Resolver %s not found!",
+         DEBUG_printf(("1cupsResolveConflicts: Resolver %s not found!",
                        consts->resolver));
          goto error;
        }
 
         if (!resolver->value)
        {
-         DEBUG_printf(("1ppdResolveConflicts: Resolver %s has no value!",
+         DEBUG_printf(("1cupsResolveConflicts: Resolver %s has no value!",
                        consts->resolver));
          goto error;
        }
@@ -507,7 +507,7 @@ cupsResolveConflicts(
 
     if (!changed)
     {
-      DEBUG_puts("1ppdResolveConflicts: Unable to automatically resolve "
+      DEBUG_puts("1cupsResolveConflicts: Unable to automatically resolve "
                 "constraint!");
       goto error;
     }
index 677dbfd56c9a5d6bdaff2c639a8ea3bea00c56a1..c6ca6c2a566359c2d1336278dee3d242571be9b4 100644 (file)
@@ -466,7 +466,7 @@ _httpAssembleUUID(const char *server,       /* I - Server name */
 
   snprintf(data, sizeof(data), "%s:%d:%s:%d:%04x:%04x", server,
            port, name ? name : server, number,
-          CUPS_RAND() & 0xffff, CUPS_RAND() & 0xffff);
+          (unsigned)CUPS_RAND() & 0xffff, (unsigned)CUPS_RAND() & 0xffff);
 
   _cupsMD5Init(&md5state);
   _cupsMD5Append(&md5state, (unsigned char *)data, strlen(data));
index f9736029a850afa6816803633f9d62c8e643dbbc..8c58dab6fd791c2c217c381887de090e51a89ce6 100644 (file)
@@ -171,16 +171,17 @@ cupsCharsetToUTF8(
 
   if (map_to_utf8 != (iconv_t)-1)
   {
+    char *altdestptr = (char *)dest;   /* Silence bogus GCC type-punned */
+
     srclen       = strlen(src);
     outBytesLeft = maxout - 1;
 
-    iconv(map_to_utf8, (char **)&src, &srclen, (char **)&destptr,
-         &outBytesLeft);
-    *destptr = '\0';
+    iconv(map_to_utf8, (char **)&src, &srclen, &altdestptr, &outBytesLeft);
+    *altdestptr = '\0';
 
     _cupsMutexUnlock(&map_mutex);
 
-    return ((int)(destptr - dest));
+    return ((int)(altdestptr - (char *)dest));
   }
 
   _cupsMutexUnlock(&map_mutex);
@@ -295,10 +296,12 @@ cupsUTF8ToCharset(
 
   if (map_from_utf8 != (iconv_t)-1)
   {
+    char *altsrc = (char *)src;                /* Silence bogus GCC type-punned */
+
     srclen       = strlen((char *)src);
     outBytesLeft = maxout - 1;
 
-    iconv(map_from_utf8, (char **)&src, &srclen, &destptr, &outBytesLeft);
+    iconv(map_from_utf8, &altsrc, &srclen, &destptr, &outBytesLeft);
     *destptr = '\0';
 
     _cupsMutexUnlock(&map_mutex);
index 7289b570b002f330cc03c4c9ff0201c06abc8b4e..5a023054041fc5a175a8cc2ca5a6f7b88ff49afd 100644 (file)
@@ -5,7 +5,7 @@
 #
 #   Original version by Jason McMullan <jmcc@ontv.com>.
 #
-#   Copyright 2007-2010 by Apple Inc.
+#   Copyright 2007-2011 by Apple Inc.
 #   Copyright 1999-2007 by Easy Software Products, all rights reserved.
 #
 #   These coded instructions, statements, and computer programs are the
@@ -79,7 +79,7 @@ Requires: %{name}-libs = %{epoch}:%{version}
 
 %description
 CUPS is the standards-based, open source printing system developed by
-Apple Inc. for Mac OS¨ X and other UNIX¨-like operating systems.
+Apple Inc. for Mac OS® X and other UNIX®-like operating systems.
 
 %description devel
 This package provides the CUPS headers and development environment.
@@ -190,10 +190,11 @@ rm -rf $RPM_BUILD_ROOT
 %dir /usr/lib/cups
 %dir /usr/lib/cups/backend
 /usr/lib/cups/backend/http
+/usr/lib/cups/backend/https
 %attr(0700,root,root) /usr/lib/cups/backend/ipp
+/usr/lib/cups/backend/ipps
 %attr(0700,root,root) /usr/lib/cups/backend/lpd
 /usr/lib/cups/backend/parallel
-/usr/lib/cups/backend/scsi
 /usr/lib/cups/backend/serial
 /usr/lib/cups/backend/snmp
 /usr/lib/cups/backend/socket
@@ -203,6 +204,7 @@ rm -rf $RPM_BUILD_ROOT
 %dir /usr/lib/cups/daemon
 /usr/lib/cups/daemon/cups-deviced
 /usr/lib/cups/daemon/cups-driverd
+/usr/lib/cups/daemon/cups-exec
 /usr/lib/cups/daemon/cups-polld
 %dir /usr/lib/cups/driver
 %dir /usr/lib/cups/filter
@@ -288,8 +290,6 @@ rm -rf $RPM_BUILD_ROOT
 /usr/share/man/man5/*.conf.5.gz
 /usr/share/man/man5/ipptoolfile.5.gz
 /usr/share/man/man5/mime.*.5.gz
-%dir /usr/share/man/man7
-/usr/share/man/man7/drv*
 %dir /usr/share/man/man8
 /usr/share/man/man8/accept.8.gz
 /usr/share/man/man8/cupsaddsmb.8.gz
index 8e8395fae5842187a2a3910a572db26d270e1e2b..162822b0040ba43d188bb74bd245adf4569297dc 100644 (file)
@@ -3220,7 +3220,7 @@ encrypt_client(cupsd_client_t *con)       /* I - Client to encrypt */
   gnutls_certificate_set_x509_key_file(*credentials, ServerCertificate,
                                       ServerKey, GNUTLS_X509_FMT_PEM);
 
-  gnutls_init(&con->http.tls), GNUTLS_SERVER);
+  gnutls_init(&con->http.tls, GNUTLS_SERVER);
   gnutls_set_default_priority(con->http.tls);
   gnutls_credentials_set(con->http.tls, GNUTLS_CRD_CERTIFICATE, *credentials);
   gnutls_transport_set_ptr(con->http.tls, (gnutls_transport_ptr)HTTP(con));
index b2f3719d839011471db802e516845f8c50a07405..d45b6ed302f76c9bbc46f0525345c995c16cb2f2 100644 (file)
@@ -2593,11 +2593,11 @@ read_configuration(cups_file_t *fp)     /* I - File to read from */
                      "FaxRetryLimit is deprecated; use "
                      "JobRetryLimit on line %d.", linenum);
     }
-    else if (!_cups_strcasecmp(line, "Port") || !_cups_strcasecmp(line, "Listen")
+    else if ((!_cups_strcasecmp(line, "Port") || !_cups_strcasecmp(line, "Listen")
 #ifdef HAVE_SSL
              || !_cups_strcasecmp(line, "SSLPort") || !_cups_strcasecmp(line, "SSLListen")
 #endif /* HAVE_SSL */
-            )
+            ) && value)
     {
      /*
       * Add listening address(es) to the list...
@@ -3740,6 +3740,12 @@ read_location(cups_file_t *fp,           /* I - Configuration file */
     else if (!_cups_strcasecmp(line, "</Limit>") ||
              !_cups_strcasecmp(line, "</LimitExcept>"))
       loc = parent;
+    else if (!value)
+    {
+      cupsdLogMessage(CUPSD_LOG_ERROR, "Missing value on line %d.", linenum);
+      if (FatalErrors & CUPSD_FATAL_CONFIG)
+       return (0);
+    }
     else if (!parse_aaa(loc, line, value, linenum))
     {
       cupsdLogMessage(CUPSD_LOG_ERROR,
@@ -3889,6 +3895,12 @@ read_policy(cups_file_t *fp,             /* I - Configuration file */
 
       op = NULL;
     }
+    else if (!value)
+    {
+      cupsdLogMessage(CUPSD_LOG_ERROR, "Missing value on line %d.", linenum);
+      if (FatalErrors & CUPSD_FATAL_CONFIG)
+       return (0);
+    }
     else if (!_cups_strcasecmp(line, "JobPrivateAccess") ||
             !_cups_strcasecmp(line, "JobPrivateValues") ||
             !_cups_strcasecmp(line, "SubscriptionPrivateAccess") ||
index 9e0e020050cf47853a720de6c4d86d0f82dfc542..abe02628771990d776d099e4eaa106a3a1b41e81 100644 (file)
@@ -750,8 +750,11 @@ compare_ppds(const ppd_info_t *p0, /* I - First PPD file */
   else if ((diff = cupsdCompareNames(p0->record.make_and_model,
                                      p1->record.make_and_model)) != 0)
     return (diff);
+  else if ((diff = strcmp(p0->record.languages[0],
+                          p1->record.languages[0])) != 0)
+    return (diff);
   else
-    return (strcmp(p0->record.languages[0], p1->record.languages[0]));
+    return (compare_names(p0, p1));
 }
 
 
@@ -1408,7 +1411,9 @@ load_drv(const char  *filename,           /* I - Actual filename */
   * Add a dummy entry for the file...
   */
 
-  add_ppd(name, name, "", "", "", "", "", "", mtime, size, 0,
+  httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "drv", "", "", 0,
+                  "/%s", name);
+  add_ppd(name, uri, "", "", "", "", "", "", mtime, size, 0,
           PPD_TYPE_DRV, "drv");
   ChangedPPD = 1;
 
index 00a016ddb9111b9479f2ec76190bae6b33db5d4e..a2e2a13f73fff3765a99ba9ae5cec5c3e02f6f76 100644 (file)
@@ -8885,6 +8885,22 @@ hold_job(cupsd_client_t  *con,           /* I - Client connection */
     return;
   }
 
+ /*
+  * See if the job is in a state that allows holding...
+  */
+
+  if (job->state_value > IPP_JOB_STOPPED)
+  {
+   /*
+    * Return a "not-possible" error...
+    */
+
+    send_ipp_status(con, IPP_NOT_POSSIBLE,
+                   _("Job #%d is finished and cannot be altered."),
+                   job->id);
+    return;
+  }
+
  /*
   * Hold the job and return...
   */
index 595656edc02427eb8fd05a9628032c1815c3e284..749f7fcc1c9dd2ef5326e3e04ec676dacba7a5f5 100644 (file)
@@ -2330,14 +2330,14 @@ cupsdSetJobState(
   if (!cupsdLoadJob(job))
     return;
 
 /*
-   * Don't do anything if the state is unchanged and we aren't purging the
-   * job...
-   */
-
-   oldstate = job->state_value;
-   if (newstate == oldstate && action != CUPSD_JOB_PURGE)
-     return;
+ /*
+  * Don't do anything if the state is unchanged and we aren't purging the
+  * job...
+  */
+
+  oldstate = job->state_value;
+  if (newstate == oldstate && action != CUPSD_JOB_PURGE)
+    return;
 
  /*
   * Stop any processes that are working on the current job...
index 2df34921fa23cbb777ebf236bacd41d5ff2841a4..0bab7172781c583f93c505b66650bce2708ea762 100644 (file)
@@ -196,6 +196,10 @@ cupsdSetBusyState(void)
   if (job)
     newbusy |= 2;
 
+  cupsdLogMessage(CUPSD_LOG_DEBUG,
+                  "cupsdSetBusyState: newbusy=\"%s\", busy=\"%s\"",
+                  busy_text[newbusy], busy_text[busy]);
+
  /*
   * Manage state changes...
   */
@@ -213,25 +217,23 @@ cupsdSetBusyState(void)
       vtran = 0;
     }
 #endif /* HAVE_VPROC_TRANSACTION_BEGIN */
+  }
 
 #ifdef kIOPMAssertionTypeDenySystemSleep
-    if ((busy & 2) && !dark_wake)
-    {
-      cupsdLogMessage(CUPSD_LOG_DEBUG2, "Asserting dark wake.");
-      IOPMAssertionCreateWithName(kIOPMAssertionTypeDenySystemSleep,
-                                 kIOPMAssertionLevelOn,
-                                 CFSTR("org.cups.cupsd"), &dark_wake);
-    }
-    else if (!(busy & 2) && dark_wake)
-    {
-      cupsdLogMessage(CUPSD_LOG_DEBUG2, "Releasing dark wake assertion.");
-      IOPMAssertionRelease(dark_wake);
-      dark_wake = 0;
-    }
-#endif /* kIOPMAssertionTypeDenySystemSleep */
-
-    cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdSetBusyState: %s", busy_text[busy]);
+  if (cupsArrayCount(PrintingJobs) > 0 && !dark_wake)
+  {
+    cupsdLogMessage(CUPSD_LOG_DEBUG, "Asserting dark wake.");
+    IOPMAssertionCreateWithName(kIOPMAssertionTypeDenySystemSleep,
+                               kIOPMAssertionLevelOn,
+                               CFSTR("org.cups.cupsd"), &dark_wake);
   }
+  else if (cupsArrayCount(PrintingJobs) == 0 && dark_wake)
+  {
+    cupsdLogMessage(CUPSD_LOG_DEBUG, "Releasing dark wake assertion.");
+    IOPMAssertionRelease(dark_wake);
+    dark_wake = 0;
+  }
+#endif /* kIOPMAssertionTypeDenySystemSleep */
 }
 
 
index 8f1dcb4aebbcf8c31c0aac261856e0048bb8de22..0809aab19cd9215af81df8fd938ba40c9de8e89e 100644 (file)
@@ -3,7 +3,7 @@
 #
 #   IPP/1.1 test suite.
 #
-#   Copyright 2007-2010 by Apple Inc.
+#   Copyright 2007-2011 by Apple Inc.
 #   Copyright 2001-2006 by Easy Software Products. All rights reserved.
 #
 #   These coded instructions, statements, and computer programs are the
 #   ./ipptool -f filename -t printer-uri ipp-1.1.test
 #
 
+# Regular expression for IPP URI schemes
+# Matches strings beginning with ipp:// or ipps://
+DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
+
 # Test that a request-id value of 0 is not accepted.
 #
 # Required by: RFC 2911 section 3.1.1
@@ -87,7 +91,7 @@
        ATTR uri printer-uri $uri
 
        STATUS successful-ok
-       EXPECT printer-uri-supported OF-TYPE uri
+       EXPECT printer-uri-supported OF-TYPE uri WITH-VALUE "$IPP_URI_SCHEME"
 }
 
 
 
        STATUS successful-ok
        STATUS client-error-document-format-not-supported
-       EXPECT job-uri OF-TYPE uri COUNT 1 IN-GROUP job-attributes-tag
+       EXPECT job-uri OF-TYPE uri COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE "$IPP_URI_SCHEME"
        EXPECT job-id OF-TYPE integer COUNT 1 IN-GROUP job-attributes-tag
               WITH-VALUE >0
        EXPECT job-state OF-TYPE enum COUNT 1 IN-GROUP job-attributes-tag
        EXPECT printer-state OF-TYPE enum IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE 3,4,5
        EXPECT printer-state-reasons OF-TYPE keyword IN-GROUP printer-attributes-tag
        EXPECT printer-up-time OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE >0
-       EXPECT printer-uri-supported OF-TYPE uri IN-GROUP printer-attributes-tag SAME-COUNT-AS uri-security-supported
+       EXPECT printer-uri-supported OF-TYPE uri IN-GROUP printer-attributes-tag SAME-COUNT-AS uri-security-supported WITH-VALUE "$IPP_URI_SCHEME"
        EXPECT queued-job-count OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
        EXPECT uri-authentication-supported OF-TYPE keyword IN-GROUP printer-attributes-tag
        EXPECT uri-security-supported OF-TYPE keyword IN-GROUP printer-attributes-tag SAME-COUNT-AS uri-authentication-supported
 
        STATUS successful-ok
 
-       EXPECT printer-uri-supported OF-TYPE uri IN-GROUP printer-attributes-tag
+       EXPECT printer-uri-supported OF-TYPE uri IN-GROUP printer-attributes-tag WITH-VALUE "$IPP_URI_SCHEME"
        EXPECT !printer-name
 }
 
 
        STATUS successful-ok
        EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
-       EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
+       EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
        EXPECT !job-printer-uri
        EXPECT !job-more-info
        EXPECT !job-name
 
        STATUS successful-ok
        EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
-       EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
+       EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
        EXPECT job-printer-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
        EXPECT ?job-more-info OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
        EXPECT job-name OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
 
        STATUS successful-ok
        EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
-       EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
+       EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
        EXPECT !job-printer-uri
        EXPECT !job-more-info
        EXPECT !job-name
 
        STATUS successful-ok
        EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
-       EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
+       EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
        EXPECT !job-printer-uri
        EXPECT !job-more-info
        EXPECT !job-name
 
        STATUS successful-ok
        EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
-       EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
+       EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
        EXPECT !job-printer-uri
        EXPECT !job-more-info
        EXPECT !job-name
 
        STATUS successful-ok
        STATUS client-error-document-format-not-supported
-       EXPECT job-uri OF-TYPE uri COUNT 1 IN-GROUP job-attributes-tag
+       EXPECT job-uri OF-TYPE uri COUNT 1 IN-GROUP job-attributes-tag WITH-VALUE "$IPP_URI_SCHEME"
        EXPECT job-id OF-TYPE integer COUNT 1 IN-GROUP job-attributes-tag
               WITH-VALUE >0
        EXPECT job-state OF-TYPE enum COUNT 1 IN-GROUP job-attributes-tag
 
        STATUS successful-ok
        EXPECT job-id OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
-       EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
+       EXPECT job-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE "$IPP_URI_SCHEME"
        EXPECT job-printer-uri OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
        EXPECT ?job-more-info OF-TYPE uri IN-GROUP job-attributes-tag COUNT 1
        EXPECT job-name OF-TYPE name IN-GROUP job-attributes-tag COUNT 1
index e2bbe9f4d292f2245352e3a2cb1de11df806cdf7..81c663d5a4cbea37bbbf81a94f7beedbf4245f69 100644 (file)
@@ -2569,11 +2569,11 @@ do_tests(_cups_vars_t *vars,            /* I - Variables */
        puts("</array>");
     }
 
+    skip_error:
+
     if (Output == _CUPS_OUTPUT_PLIST)
       puts("</dict>");
 
-    skip_error:
-
     ippDelete(response);
     response = NULL;