]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Y2038 fixes (Issue #1592) master
authorMichael R Sweet <msweet@msweet.org>
Mon, 22 Jun 2026 21:23:05 +0000 (17:23 -0400)
committerMichael R Sweet <msweet@msweet.org>
Mon, 22 Jun 2026 21:23:05 +0000 (17:23 -0400)
- Use dateTime attribute variants.
- Use CUPS_LLFMT and CUPS_LLCAST for printing and saving time_t values.
- Use strtoll to read time_t values.
- Update web interface to request and display dateTime values.

20 files changed:
CHANGES.md
cgi-bin/ipp-var.c
cups/ppd-util.c
cups/tls-openssl.c
cups/util.c
scheduler/classes.c
scheduler/job.c
scheduler/printers.c
scheduler/subscriptions.c
systemv/lpstat.c
templates/da/jobs.tmpl
templates/de/jobs.tmpl
templates/es/jobs.tmpl
templates/fr/jobs.tmpl
templates/ja/jobs.tmpl
templates/jobs.tmpl
templates/pl/jobs.tmpl
templates/pt_BR/jobs.tmpl
templates/ru/jobs.tmpl
templates/sv/jobs.tmpl

index 50b979cc5b400e8c53c22e0a3c7d6894fd16a775..68224f0e87a9d03d5404ed2561194b3d5cfcf0ef 100644 (file)
@@ -96,6 +96,8 @@ v2.5b1 - YYYY-MM-DD
   pairs for custom boolean, integer, and keyword attributes.
 - Updated the default "cups.conf" policies to specify the Set-Printer-Attributes
   operation as an administrative operation.
+- Updated CUPS to rely on the dateTime variants of various IPP attributes to
+  avoid Y2038 issues (Issue #1592)
 - Deprecated the "page-border" Job Template attribute (Issue #1020)
 - Removed the `cups-config` utility (use `pkg-config` instead)
 - Fixed use-after-free in `cupsdAcceptClient()` when we log warning during error
index 566b3e49bd557a993757099ab9be29a0817e535b..cb042ba3517ae22a139bf793ad5f2fece4b1844a 100644 (file)
@@ -1183,6 +1183,10 @@ cgiSetIPPObjectVars(
 
       switch (attr->value_tag)
       {
+        case IPP_TAG_DATE :
+            _cupsStrDate(valptr, sizeof(value) - (size_t)(valptr - value), ippDateToTime(ippGetDate(attr, i)));
+            break;
+
        case IPP_TAG_INTEGER :
        case IPP_TAG_ENUM :
            if (strncmp(name, "time_at_", 8) == 0)
index 8001f334273cf7416944e485e26c74926a3a4dc9..28d70a512d267fbc063b1446c93c24ffa0e6f66c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PPD utilities for CUPS.
  *
- * Copyright © 2020-2025 by OpenPrinting.
+ * Copyright © 2020-2026 by OpenPrinting.
  * Copyright © 2007-2018 by Apple Inc.
  * Copyright © 1997-2006 by Easy Software Products.
  *
@@ -302,7 +302,7 @@ cupsGetPPD3(http_t     *http,               /* I  - HTTP connection or @code CUPS_HTTP_DEFAUL
       }
       else
       {
-        DEBUG_printf("2cupsGetPPD3: Returning ok, filename=\"%s\", modtime=%ld.", buffer, (long)ppdinfo.st_mtime);
+        DEBUG_printf("2cupsGetPPD3: Returning ok, filename=\"%s\", modtime=" CUPS_LLFMT ".", buffer, CUPS_LLCAST ppdinfo.st_mtime);
         *modtime = ppdinfo.st_mtime;
        return (HTTP_STATUS_OK);
       }
index 6396a03e2d97c8842a654954064a3b396b9edaa8..191dff3c7bba67bf79d93e3e5b26919266aa44fc 100644 (file)
@@ -1024,7 +1024,7 @@ cupsGetCredentialsTrust(
 
     time(&curtime);
 
-    DEBUG_printf("1cupsGetCredentialsTrust: curtime=%ld, notBefore=%ld, notAfter=%ld", (long)curtime, (long)openssl_get_date(cert, 0), (long)openssl_get_date(cert, 1));
+    DEBUG_printf("1cupsGetCredentialsTrust: curtime=" CUPS_LLFMT ", notBefore=" CUPS_LLFMT ", notAfter=" CUPS_LLFMT, CUPS_LLCAST curtime, CUPS_LLCAST openssl_get_date(cert, 0), CUPS_LLCAST openssl_get_date(cert, 1));
 
     if ((curtime + 86400) < openssl_get_date(cert, 0) || curtime > openssl_get_date(cert, 1))
     {
index 80063c2b7cff7a9d3689908d943d1ad80a899ab9..d1f0a7a2f4f47684963a00e43e195ed234cab029 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Printing utilities for CUPS.
  *
- * Copyright © 2020-2025 by OpenPrinting.
+ * Copyright © 2020-2026 by OpenPrinting.
  * Copyright © 2007-2018 by Apple Inc.
  * Copyright © 1997-2006 by Easy Software Products.
  *
@@ -440,6 +440,9 @@ cupsGetJobs2(http_t     *http,              /* I - Connection to server or @code CUPS_HTTP_D
   _cups_globals_t *cg = _cupsGlobals();        /* Pointer to library globals */
   static const char * const attrs[] =  /* Requested attributes */
                {
+                 "date-time-at-completed",
+                 "date-time-at-creation",
+                 "date-time-at-processing",
                  "document-format",
                  "job-id",
                  "job-k-octets",
@@ -447,10 +450,7 @@ cupsGetJobs2(http_t     *http,             /* I - Connection to server or @code CUPS_HTTP_D
                  "job-originating-user-name",
                  "job-printer-uri",
                  "job-priority",
-                 "job-state",
-                 "time-at-completed",
-                 "time-at-creation",
-                 "time-at-processing"
+                 "job-state"
                };
 
 
@@ -574,15 +574,12 @@ cupsGetJobs2(http_t     *http,            /* I - Connection to server or @code CUPS_HTTP_D
         else if (!strcmp(attr->name, "job-k-octets") &&
                 attr->value_tag == IPP_TAG_INTEGER)
          size = attr->values[0].integer;
-        else if (!strcmp(attr->name, "time-at-completed") &&
-                attr->value_tag == IPP_TAG_INTEGER)
-         completed_time = attr->values[0].integer;
-        else if (!strcmp(attr->name, "time-at-creation") &&
-                attr->value_tag == IPP_TAG_INTEGER)
-         creation_time = attr->values[0].integer;
-        else if (!strcmp(attr->name, "time-at-processing") &&
-                attr->value_tag == IPP_TAG_INTEGER)
-         processing_time = attr->values[0].integer;
+        else if (!strcmp(attr->name, "date-time-at-completed") && attr->value_tag == IPP_TAG_DATE)
+         completed_time = ippDateToTime(ippGetDate(attr, 0));
+        else if (!strcmp(attr->name, "date-time-at-creation") && attr->value_tag == IPP_TAG_DATE)
+         creation_time = ippDateToTime(ippGetDate(attr, 0));
+        else if (!strcmp(attr->name, "date-time-at-processing") && attr->value_tag == IPP_TAG_DATE)
+         processing_time = ippDateToTime(ippGetDate(attr, 0));
         else if (!strcmp(attr->name, "job-printer-uri") &&
                 attr->value_tag == IPP_TAG_URI)
        {
index cc785612031d40615919065344714c5a02ad9cdb..9c3c62bd0ca08a02f9ac9a637cd30aed01cf25c6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Printer class routines for the CUPS scheduler.
  *
- * Copyright © 2020-2025 by OpenPrinting.
+ * Copyright © 2020-2026 by OpenPrinting.
  * Copyright © 2007-2017 by Apple Inc.
  * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
  *
@@ -475,7 +475,7 @@ cupsdLoadAllClasses(void)
       */
 
       if (value)
-        p->state_time = atoi(value);
+        p->state_time = strtoll(value, NULL, 10);
     }
     else if (!_cups_strcasecmp(line, "Accepting"))
     {
@@ -756,7 +756,7 @@ cupsdSaveAllClasses(void)
     else
       cupsFilePuts(fp, "State Idle\n");
 
-    cupsFilePrintf(fp, "StateTime %d\n", (int)pclass->state_time);
+    cupsFilePrintf(fp, "StateTime " CUPS_LLFMT "\n", CUPS_LLCAST pclass->state_time);
 
     if (pclass->accepting)
       cupsFilePuts(fp, "Accepting Yes\n");
index 944195920db0c72364320263b8a72dd603b014d5..2e61d146424723cbf435a95ea6511174890e8fad 100644 (file)
@@ -226,19 +226,13 @@ cupsdCheckJobs(void)
 
   curtime = time(NULL);
 
-  cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdCheckJobs: %d active jobs, sleeping=%d, ac-power=%d, reload=%d, curtime=%ld", cupsArrayCount(ActiveJobs), Sleeping, ACPower, NeedReload, (long)curtime);
+  cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdCheckJobs: %d active jobs, sleeping=%d, ac-power=%d, reload=%d, curtime=" CUPS_LLFMT, cupsArrayCount(ActiveJobs), Sleeping, ACPower, NeedReload, CUPS_LLCAST curtime);
 
   for (job = (cupsd_job_t *)cupsArrayFirst(ActiveJobs);
        job;
        job = (cupsd_job_t *)cupsArrayNext(ActiveJobs))
   {
-    cupsdLogMessage(CUPSD_LOG_DEBUG2,
-                    "cupsdCheckJobs: Job %d - dest=\"%s\", printer=%p, "
-                    "state=%d, cancel_time=%ld, hold_until=%ld, kill_time=%ld, "
-                    "pending_cost=%d, pending_timeout=%ld", job->id, job->dest,
-                    (void *)job->printer, job->state_value, (long)job->cancel_time,
-                    (long)job->hold_until, (long)job->kill_time,
-                    job->pending_cost, (long)job->pending_timeout);
+    cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdCheckJobs: Job %d - dest=\"%s\", printer=%p, state=%d, cancel_time=" CUPS_LLFMT ", hold_until=" CUPS_LLFMT ", kill_time=" CUPS_LLFMT ", pending_cost=%d, pending_timeout=" CUPS_LLFMT, job->id, job->dest,(void *)job->printer, job->state_value, CUPS_LLCAST job->cancel_time, CUPS_LLCAST job->hold_until, CUPS_LLCAST job->kill_time, job->pending_cost, CUPS_LLCAST job->pending_timeout);
 
    /*
     * Kill jobs if they are unresponsive...
@@ -433,13 +427,13 @@ cupsdCleanJobs(void)
   curtime          = time(NULL);
   JobHistoryUpdate = 0;
 
-  cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdCleanJobs: curtime=%d", (int)curtime);
+  cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdCleanJobs: curtime=" CUPS_LLFMT, CUPS_LLCAST curtime);
 
   for (job = (cupsd_job_t *)cupsArrayFirst(Jobs);
        job;
        job = (cupsd_job_t *)cupsArrayNext(Jobs))
   {
-    cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdCleanJobs: Job %d, state=%d, printer=%p, history_time=%d, file_time=%d, num_files=%d", job->id, (int)job->state_value, (void *)job->printer, (int)job->history_time, (int)job->file_time, (int)job->num_files);
+    cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdCleanJobs: Job %d, state=%d, printer=%p, history_time=" CUPS_LLFMT ", file_time=" CUPS_LLFMT ", num_files=%d", job->id, (int)job->state_value, (void *)job->printer, CUPS_LLCAST job->history_time, CUPS_LLCAST job->file_time, (int)job->num_files);
 
     if ((job->history_time && job->history_time < JobHistoryUpdate) || !JobHistoryUpdate)
       JobHistoryUpdate = job->history_time;
@@ -1711,21 +1705,21 @@ cupsdLoadJob(cupsd_job_t *job)          /* I - Job */
     goto error;
   }
 
-  if ((attr = ippFindAttribute(job->attrs, "time-at-creation", IPP_TAG_INTEGER)) == NULL)
+  if ((attr = ippFindAttribute(job->attrs, "date-time-at-creation", IPP_TAG_DATE)) == NULL)
   {
     cupsdLogJob(job, CUPSD_LOG_ERROR,
                 "Missing or bad time-at-creation attribute in control file.");
     goto error;
   }
 
-  job->creation_time = attr->values[0].integer;
-  job->state_value  = (ipp_jstate_t)job->state->values[0].integer;
-  job->file_time    = 0;
-  job->history_time = 0;
+  job->creation_time = ippDateToTime(ippGetDate(attr, 0));
+  job->state_value   = (ipp_jstate_t)job->state->values[0].integer;
+  job->file_time     = 0;
+  job->history_time  = 0;
 
-  if (job->state_value >= IPP_JSTATE_CANCELED && (attr = ippFindAttribute(job->attrs, "time-at-completed", IPP_TAG_INTEGER)) != NULL)
+  if (job->state_value >= IPP_JSTATE_CANCELED && (attr = ippFindAttribute(job->attrs, "date-time-at-completed", IPP_TAG_DATE)) != NULL)
   {
-    job->completed_time = attr->values[0].integer;
+    job->completed_time = ippDateToTime(ippGetDate(attr, 0));
 
     if (JobHistory < INT_MAX)
       job->history_time = job->completed_time + JobHistory;
@@ -1743,7 +1737,7 @@ cupsdLoadJob(cupsd_job_t *job)            /* I - Job */
     else
       job->file_time = INT_MAX;
 
-    cupsdLogJob(job, CUPSD_LOG_DEBUG2, "cupsdLoadJob: job->file_time=%ld, time-at-completed=%ld, JobFiles=%d", (long)job->file_time, (long)attr->values[0].integer, JobFiles);
+    cupsdLogJob(job, CUPSD_LOG_DEBUG2, "cupsdLoadJob: job->file_time=" CUPS_LLFMT ", time-at-completed=" CUPS_LLFMT ", JobFiles=%d", CUPS_LLCAST job->file_time, CUPS_LLCAST attr->values[0].integer, JobFiles);
 
     if (job->file_time < JobHistoryUpdate || !JobHistoryUpdate)
       JobHistoryUpdate = job->file_time;
@@ -2236,12 +2230,12 @@ cupsdSaveAllJobs(void)
 
     cupsFilePrintf(fp, "<Job %d>\n", job->id);
     cupsFilePrintf(fp, "State %d\n", job->state_value);
-    cupsFilePrintf(fp, "Created %ld\n", (long)job->creation_time);
+    cupsFilePrintf(fp, "Created " CUPS_LLFMT "\n", CUPS_LLCAST job->creation_time);
     if (job->completed_time)
-      cupsFilePrintf(fp, "Completed %ld\n", (long)job->completed_time);
+      cupsFilePrintf(fp, "Completed " CUPS_LLFMT "\n", CUPS_LLCAST job->completed_time);
     cupsFilePrintf(fp, "Priority %d\n", job->priority);
     if (job->hold_until)
-      cupsFilePrintf(fp, "HoldUntil %ld\n", (long)job->hold_until);
+      cupsFilePrintf(fp, "HoldUntil " CUPS_LLFMT "\n", CUPS_LLCAST job->hold_until);
     cupsFilePrintf(fp, "Username %s\n", job->username);
     if (job->name)
       cupsFilePutConf(fp, "Name", job->name);
@@ -2489,8 +2483,8 @@ cupsdSetJobHoldUntil(cupsd_job_t *job,    /* I - Job */
       job->hold_until += 24 * 60 * 60;
   }
 
-  cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdSetJobHoldUntil: hold_until=%d",
-                  (int)job->hold_until);
+  cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdSetJobHoldUntil: hold_until=" CUPS_LLFMT,
+                  CUPS_LLCAST job->hold_until);
 }
 
 
@@ -2870,14 +2864,14 @@ cupsdUpdateJobs(void)
        job = (cupsd_job_t *)cupsArrayNext(Jobs))
   {
     if (job->state_value >= IPP_JSTATE_CANCELED &&
-        (attr = ippFindAttribute(job->attrs, "time-at-completed",
-                                 IPP_TAG_INTEGER)) != NULL)
+        (attr = ippFindAttribute(job->attrs, "date-time-at-completed",
+                                 IPP_TAG_DATE)) != NULL)
     {
      /*
       * Update history/file expiration times...
       */
 
-      job->completed_time = attr->values[0].integer;
+      job->completed_time = ippDateToTime(ippGetDate(attr, 0));
 
       if (JobHistory < INT_MAX)
        job->history_time = job->completed_time + JobHistory;
@@ -2898,15 +2892,14 @@ cupsdUpdateJobs(void)
       else
        job->file_time = INT_MAX;
 
-      cupsdLogJob(job, CUPSD_LOG_DEBUG2, "cupsdUpdateJobs: job->file_time=%ld, time-at-completed=%ld, JobFiles=%d", (long)job->file_time, (long)attr->values[0].integer, JobFiles);
+      cupsdLogJob(job, CUPSD_LOG_DEBUG2, "cupsdUpdateJobs: job->file_time=" CUPS_LLFMT ", time-at-completed=" CUPS_LLFMT ", JobFiles=%d", CUPS_LLCAST job->file_time, CUPS_LLCAST job->completed_time, JobFiles);
 
       if (job->file_time < JobHistoryUpdate || !JobHistoryUpdate)
        JobHistoryUpdate = job->file_time;
     }
   }
 
-  cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdUpdateJobs: JobHistoryUpdate=%ld",
-                  (long)JobHistoryUpdate);
+  cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdUpdateJobs: JobHistoryUpdate=" CUPS_LLFMT, CUPS_LLCAST JobHistoryUpdate);
 }
 
 
@@ -4496,15 +4489,15 @@ load_job_cache(const char *filename)    /* I - job.cache filename */
     }
     else if (!_cups_strcasecmp(line, "Created"))
     {
-      job->creation_time = strtol(value, NULL, 10);
+      job->creation_time = (time_t)strtoll(value, NULL, 10);
     }
     else if (!_cups_strcasecmp(line, "Completed"))
     {
-      job->completed_time = strtol(value, NULL, 10);
+      job->completed_time = (time_t)strtoll(value, NULL, 10);
     }
     else if (!_cups_strcasecmp(line, "HoldUntil"))
     {
-      job->hold_until = strtol(value, NULL, 10);
+      job->hold_until = (time_t)strtoll(value, NULL, 10);
     }
     else if (!_cups_strcasecmp(line, "Priority"))
     {
index 90f76e17fb984f3634927b82899b68cb9d1376fc..efa4923f47a5bf89ca189b5235ba8027a19b8939 100644 (file)
@@ -1179,7 +1179,7 @@ cupsdLoadAllPrinters(void)
       */
 
       if (value)
-        p->state_time = (time_t)strtol(value, NULL, 10);
+        p->state_time = (time_t)strtoll(value, NULL, 10);
     }
     else if (!_cups_strcasecmp(line, "ConfigTime"))
     {
@@ -1188,7 +1188,7 @@ cupsdLoadAllPrinters(void)
       */
 
       if (value)
-        p->config_time = (time_t)strtol(value, NULL, 10);
+        p->config_time = (time_t)strtoll(value, NULL, 10);
     }
     else if (!_cups_strcasecmp(line, "Accepting"))
     {
@@ -1367,7 +1367,7 @@ cupsdLoadAllPrinters(void)
          cupsdSetPrinterAttrs(p);
 
         if (!strcmp(value, "marker-change-time"))
-         p->marker_time = (time_t)strtol(valueptr, NULL, 10);
+         p->marker_time = (time_t)strtoll(valueptr, NULL, 10);
        else
           cupsdSetPrinterAttr(p, value, valueptr);
       }
@@ -1586,8 +1586,8 @@ cupsdSaveAllPrinters(void)
     else
       cupsFilePuts(fp, "State Idle\n");
 
-    cupsFilePrintf(fp, "StateTime %d\n", (int)printer->state_time);
-    cupsFilePrintf(fp, "ConfigTime %d\n", (int)printer->config_time);
+    cupsFilePrintf(fp, "StateTime " CUPS_LLFMT "\n", CUPS_LLCAST printer->state_time);
+    cupsFilePrintf(fp, "ConfigTime " CUPS_LLFMT "\n", CUPS_LLCAST printer->config_time);
 
     for (j = 0; j < printer->num_reasons; j ++)
       if (strcmp(printer->reasons[j], "connecting-to-device") &&
@@ -1733,8 +1733,7 @@ cupsdSaveAllPrinters(void)
     }
 
     if (printer->marker_time)
-      cupsFilePrintf(fp, "Attribute marker-change-time %ld\n",
-                     (long)printer->marker_time);
+      cupsFilePrintf(fp, "Attribute marker-change-time " CUPS_LLFMT "\n", CUPS_LLCAST printer->marker_time);
 
     if (printer == DefaultPrinter)
       cupsFilePuts(fp, "</DefaultPrinter>\n");
index ef8ea0bd04a03f1acc76585dbea3ebf11a48927f..a65ea18d0eed17f2ce26d04b4aaed5e3a69fbbc3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Subscription routines for the CUPS scheduler.
  *
- * Copyright © 2020-2025 by OpenPrinting.
+ * Copyright © 2020-2026 by OpenPrinting.
  * Copyright © 2007-2019 by Apple Inc.
  * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
  *
@@ -1019,7 +1019,7 @@ cupsdLoadAllSubscriptions(void)
       */
 
       if (value && isdigit(*value & 255))
-       sub->expire = atoi(value);
+       sub->expire = (time_t)strtoll(value, NULL, 10);
       else
       {
        cupsdLogMessage(CUPSD_LOG_ERROR,
@@ -1179,7 +1179,7 @@ cupsdSaveAllSubscriptions(void)
 
     cupsFilePrintf(fp, "LeaseDuration %d\n", sub->lease);
     cupsFilePrintf(fp, "Interval %d\n", sub->interval);
-    cupsFilePrintf(fp, "ExpirationTime %ld\n", (long)sub->expire);
+    cupsFilePrintf(fp, "ExpirationTime " CUPS_LLFMT "\n", CUPS_LLCAST sub->expire);
     cupsFilePrintf(fp, "NextEventId %d\n", sub->next_event_id);
 
     cupsFilePuts(fp, "</Subscription>\n");
index 57a90e99b025a4d70df2ffd27c1761e8b4187aa7..38bafb5616b378dc26a03fc5441aa28bbdd2cd0c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * "lpstat" command for CUPS.
  *
- * Copyright © 2020-2024 by OpenPrinting.
+ * Copyright © 2020-2026 by OpenPrinting.
  * Copyright © 2007-2018 by Apple Inc.
  * Copyright © 1997-2006 by Easy Software Products.
  *
@@ -685,7 +685,7 @@ show_accepting(const char  *printers,       /* I - Destinations */
   static const char *pattrs[] =                /* Attributes we need for printers... */
                {
                  "printer-name",
-                 "printer-state-change-time",
+                 "printer-state-change-date-time",
                  "printer-state-message",
                  "printer-is-accepting-jobs"
                };
@@ -773,9 +773,9 @@ show_accepting(const char  *printers,       /* I - Destinations */
         if (!strcmp(attr->name, "printer-name") &&
            attr->value_tag == IPP_TAG_NAME)
          printer = attr->values[0].string.text;
-        else if (!strcmp(attr->name, "printer-state-change-time") &&
-                attr->value_tag == IPP_TAG_INTEGER)
-         ptime = (time_t)attr->values[0].integer;
+        else if (!strcmp(attr->name, "printer-state-change-date-time") &&
+                attr->value_tag == IPP_TAG_DATE)
+         ptime = ippDateToTime(ippGetDate(attr, 0));
         else if (!strcmp(attr->name, "printer-state-message") &&
                 attr->value_tag == IPP_TAG_TEXT)
          message = attr->values[0].string.text;
@@ -1318,15 +1318,15 @@ show_jobs(const char *dests,            /* I - Destinations */
                date[255];              /* Date buffer */
   static const char *jattrs[] =                /* Attributes we need for jobs... */
                {
+                 "date-time-at-creation",
+                 "date-time-at-completed",
                  "job-id",
                  "job-k-octets",
                  "job-name",
                  "job-originating-user-name",
                  "job-printer-state-message",
                  "job-printer-uri",
-                 "job-state-reasons",
-                 "time-at-creation",
-                 "time-at-completed"
+                 "job-state-reasons"
                };
 
 
@@ -1398,9 +1398,9 @@ show_jobs(const char *dests,              /* I - Destinations */
         !strcmp(which, "canceled") ||
         !strcmp(which, "successful") ||
         !strcmp(which, "completed"))
-      time_at = "time-at-completed";
+      time_at = "date-time-at-completed";
     else
-      time_at = "time-at-creation";
+      time_at = "date-time-at-creation";
 
     rank = -1;
 
@@ -1436,8 +1436,8 @@ show_jobs(const char *dests,              /* I - Destinations */
         else if (!strcmp(attr->name, "job-k-octets") &&
                 attr->value_tag == IPP_TAG_INTEGER)
          size = attr->values[0].integer;
-        else if (!strcmp(attr->name, time_at) && attr->value_tag == IPP_TAG_INTEGER)
-         jobtime = attr->values[0].integer;
+        else if (!strcmp(attr->name, time_at) && attr->value_tag == IPP_TAG_DATE)
+         jobtime = ippDateToTime(ippGetDate(attr, 0));
         else if (!strcmp(attr->name, "job-printer-state-message") &&
                 attr->value_tag == IPP_TAG_TEXT)
          message = attr->values[0].string.text;
@@ -1501,7 +1501,7 @@ show_jobs(const char *dests,              /* I - Destinations */
          if (reasons)
          {
            char        alerts[1024],   /* Alerts string */
-                     *aptr;            /* Pointer into alerts string */
+                       *aptr;          /* Pointer into alerts string */
 
            for (i = 0, aptr = alerts; i < reasons->num_values; i ++)
            {
@@ -1570,7 +1570,7 @@ show_printers(const char  *printers,      /* I - Destinations */
                  "printer-state",
                  "printer-state-message",
                  "printer-state-reasons",
-                 "printer-state-change-time",
+                 "printer-state-change-date-time",
                  "printer-type",
                  "printer-info",
                   "printer-location",
@@ -1687,9 +1687,9 @@ show_printers(const char  *printers,      /* I - Destinations */
         else if (!strcmp(attr->name, "printer-state-message") &&
                 attr->value_tag == IPP_TAG_TEXT)
          message = attr->values[0].string.text;
-        else if (!strcmp(attr->name, "printer-state-change-time") &&
-                attr->value_tag == IPP_TAG_INTEGER)
-         ptime = (time_t)attr->values[0].integer;
+        else if (!strcmp(attr->name, "printer-state-change-date-time") &&
+                attr->value_tag == IPP_TAG_DATE)
+         ptime = ippDateToTime(ippGetDate(attr, 0));
        else if (!strcmp(attr->name, "printer-info") &&
                 attr->value_tag == IPP_TAG_TEXT)
          description = attr->values[0].string.text;
index db4a0c072ff4c86a83de9d97c8f24fbb6dcd714f..f287b40b33efbea402db2edb656ef34bc53b664a 100644 (file)
@@ -11,9 +11,9 @@
 <TD>{?job_originating_user_name=?Tilbageholdt:{job_originating_user_name}}&nbsp;</TD>
 <TD>{job_k_octets}k&nbsp;</TD>
 <TD>{job_impressions_completed=0?Ukendt:{?job_impressions_completed}}&nbsp;</TD>
-<TD>{job_state=3?afventer siden<BR>{?time_at_creation=?Ukendt:{time_at_creation}}:{job_state=4?tilbageholdt siden<BR>{?time_at_creation=?Ukendt:{time_at_creation}}:
-{job_state=5?behandler siden<BR>{?time_at_processing=?Ukendt:{time_at_processing}}:{job_state=6?stoppet:
-{job_state=7?annulleret ved<BR>{?time_at_completed=?Ukendt:{time_at_completed}}:{job_state=8?afbrudt:fuldtført ved<BR>{?time_at_completed=?Ukendt:{time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
+<TD>{job_state=3?afventer siden<BR>{?date_time_at_creation=?Ukendt:{date_time_at_creation}}:{job_state=4?tilbageholdt siden<BR>{?date_time_at_creation=?Ukendt:{date_time_at_creation}}:
+{job_state=5?behandler siden<BR>{?date_time_at_processing=?Ukendt:{date_time_at_processing}}:{job_state=6?stoppet:
+{job_state=7?annulleret ved<BR>{?date_time_at_completed=?Ukendt:{date_time_at_completed}}:{job_state=8?afbrudt:fuldtført ved<BR>{?date_time_at_completed=?Ukendt:{date_time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
 <EM>"{job_printer_state_message}"</EM>:}</TD>
 <TD>
 {job_preserved>0?{job_state>5?
index 52eff2bf3bff593a2e386228988b8a7701284cd8..75ff9b96e836cb4a9ef29e823fb965ea569c2b5c 100644 (file)
@@ -11,9 +11,9 @@
 <TD>{?job_originating_user_name=?Zurückbehalten:{job_originating_user_name}}&nbsp;</TD>
 <TD>{job_k_octets}k&nbsp;</TD>
 <TD>{job_impressions_completed=0?Unbekannt:{?job_impressions_completed}}&nbsp;</TD>
-<TD>{job_state=3?unerledigt seit<BR>{?time_at_creation=?Unknown:{time_at_creation}}:{job_state=4?angehalten seit<BR>{?time_at_creation=?Unknown:{time_at_creation}}:
-{job_state=5?verarbeitet seit<BR>{?time_at_processing=?Unknown:{time_at_processing}}:{job_state=6?angehalten:
-{job_state=7?gelöscht am<BR>{?time_at_completed=?Unknown:{time_at_completed}}:{job_state=8?abgebrochen:beendet am<BR>{?time_at_completed=?Unknown:{time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
+<TD>{job_state=3?unerledigt seit<BR>{?date_time_at_creation=?Unknown:{date_time_at_creation}}:{job_state=4?angehalten seit<BR>{?date_time_at_creation=?Unknown:{date_time_at_creation}}:
+{job_state=5?verarbeitet seit<BR>{?date_time_at_processing=?Unknown:{date_time_at_processing}}:{job_state=6?angehalten:
+{job_state=7?gelöscht am<BR>{?date_time_at_completed=?Unknown:{date_time_at_completed}}:{job_state=8?abgebrochen:beendet am<BR>{?date_time_at_completed=?Unknown:{date_time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
 <EM>"{job_printer_state_message}"</EM>:}</TD>
 <TD>
 {job_preserved>0?{job_state>5?
index aba2c518ec07657feccbc3efb3330b6a054f377f..0af3ad89676ce1753aa40679ecec40d77f860bd7 100644 (file)
@@ -11,9 +11,9 @@
 <TD>{?job_originating_user_name=?Retenido:{job_originating_user_name}}&nbsp;</TD>
 <TD>{job_k_octets}k&nbsp;</TD>
 <TD>{job_impressions_completed=0?Desconocido:{?job_impressions_completed}}&nbsp;</TD>
-<TD>{job_state=3?pendiente desde<BR>{?time_at_creation=?Unknown:{time_at_creation}}:{job_state=4?retenido desde<BR>{?time_at_creation=?Unknown:{time_at_creation}}:
-{job_state=5?en proceso desde<BR>{?time_at_processing=?Unknown:{time_at_processing}}:{job_state=6?parado:
-{job_state=7?cancelado el<BR>{?time_at_completed=?Unknown:{time_at_completed}}:{job_state=8?interrumpido:completado el<BR>{?time_at_completed=?Unknown:{time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
+<TD>{job_state=3?pendiente desde<BR>{?date_time_at_creation=?Unknown:{date_time_at_creation}}:{job_state=4?retenido desde<BR>{?date_time_at_creation=?Unknown:{date_time_at_creation}}:
+{job_state=5?en proceso desde<BR>{?date_time_at_processing=?Unknown:{date_time_at_processing}}:{job_state=6?parado:
+{job_state=7?cancelado el<BR>{?date_time_at_completed=?Unknown:{date_time_at_completed}}:{job_state=8?interrumpido:completado el<BR>{?date_time_at_completed=?Unknown:{date_time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
 <EM>"{job_printer_state_message}"</EM>:}</TD>
 <TD>
 {job_preserved>0?{job_state>5?
index d10e68bb95d541ed14e42618a4038c23e2e2be2c..3e1afb19815a3a662bf412f0fb844762a5b6a88b 100644 (file)
@@ -11,9 +11,9 @@
 <TD>{?job_originating_user_name=?Caché:{job_originating_user_name}}&nbsp;</TD>
 <TD>{job_k_octets}k&nbsp;</TD>
 <TD>{job_impressions_completed=0?Inconnu:{?job_impressions_completed}}&nbsp;</TD>
-<TD>{job_state=3?en attente depuis<BR>{?time_at_creation=?Inconnu:{time_at_creation}}:{job_state=4?retenu depuis le<BR>{?time_at_creation=?Inconnu:{time_at_creation}}:
-{job_state=5?en cours d'impression depuis<BR>{?time_at_processing=?Inconnu:{time_at_processing}}:{job_state=6?arr&ecirc;t&eacute;:
-{job_state=7?annul&eacute; depuis<BR>{?time_at_completed=?Inconnu:{time_at_completed}}:{job_state=8?annul&eacute;:termin&eacute; depuis<BR>{?time_at_completed=?Inconnu:{time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
+<TD>{job_state=3?en attente depuis<BR>{?date_time_at_creation=?Inconnu:{date_time_at_creation}}:{job_state=4?retenu depuis le<BR>{?date_time_at_creation=?Inconnu:{date_time_at_creation}}:
+{job_state=5?en cours d'impression depuis<BR>{?date_time_at_processing=?Inconnu:{date_time_at_processing}}:{job_state=6?arr&ecirc;t&eacute;:
+{job_state=7?annul&eacute; depuis<BR>{?date_time_at_completed=?Inconnu:{date_time_at_completed}}:{job_state=8?annul&eacute;:termin&eacute; depuis<BR>{?date_time_at_completed=?Inconnu:{date_time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
 <EM>"{job_printer_state_message}"</EM>:}</TD>
 <TD>
 {job_preserved>0?{job_state>5?
index a420f0aeba6079f447b67da6a4fb3a627cee3745..640bc16e03e48cd77bd6eb107282d99c4cc8c679 100644 (file)
@@ -11,9 +11,9 @@
 <TD>{?job_originating_user_name=?隠匿:{job_originating_user_name}}&nbsp;</TD>
 <TD>{job_k_octets}k&nbsp;</TD>
 <TD>{job_impressions_completed=0?不明:{?job_impressions_completed}}&nbsp;</TD>
-<TD>{job_state=3?{?time_at_creation=?Unknown:{time_at_creation}}<BR>から保留中:{job_state=4?{?time_at_creation=?Unknown:{time_at_creation}}<BR>から保留中:
-{job_state=5?{?time_at_processing=?Unknown:{time_at_processing}}<BR>から処理中:{job_state=6?に停止:
-{job_state=7?{?time_at_completed=?Unknown:{time_at_completed}}<BR>にキャンセル:{job_state=8?に中断:{?time_at_completed=?Unknown:{time_at_completed}}<BR>に完了}}}}}}&nbsp;{job_printer_state_message?<BR>
+<TD>{job_state=3?{?date_time_at_creation=?Unknown:{date_time_at_creation}}<BR>から保留中:{job_state=4?{?date_time_at_creation=?Unknown:{date_time_at_creation}}<BR>から保留中:
+{job_state=5?{?date_time_at_processing=?Unknown:{date_time_at_processing}}<BR>から処理中:{job_state=6?に停止:
+{job_state=7?{?date_time_at_completed=?Unknown:{date_time_at_completed}}<BR>にキャンセル:{job_state=8?に中断:{?date_time_at_completed=?Unknown:{date_time_at_completed}}<BR>に完了}}}}}}&nbsp;{job_printer_state_message?<BR>
 <EM>"{job_printer_state_message}"</EM>:}</TD>
 <TD>
 {job_preserved>0?{job_state>5?
index 353767cbab58a5f628ba05291132546cfce43d3c..e56c369c84e1e277dc9aaf2b7255e3fb45278283 100644 (file)
@@ -11,9 +11,9 @@
 <TD>{?job_originating_user_name=?Withheld:{job_originating_user_name}}&nbsp;</TD>
 <TD>{job_k_octets}k&nbsp;</TD>
 <TD>{job_impressions_completed=0?Unknown:{?job_impressions_completed}}&nbsp;</TD>
-<TD>{job_state=3?pending since<BR>{?time_at_creation=?Unknown:{time_at_creation}}:{job_state=4?held since<BR>{?time_at_creation=?Unknown:{time_at_creation}}:
-{job_state=5?processing since<BR>{?time_at_processing=?Unknown:{time_at_processing}}:{job_state=6?stopped:
-{job_state=7?canceled at<BR>{?time_at_completed=?Unknown:{time_at_completed}}:{job_state=8?aborted:completed at<BR>{?time_at_completed=?Unknown:{time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
+<TD>{job_state=3?pending since<BR>{?date_time_at_creation=?Unknown:{date_time_at_creation}}:{job_state=4?held since<BR>{?date_time_at_creation=?Unknown:{date_time_at_creation}}:
+{job_state=5?processing since<BR>{?date_time_at_processing=?Unknown:{date_time_at_processing}}:{job_state=6?stopped:
+{job_state=7?canceled at<BR>{?date_time_at_completed=?Unknown:{date_time_at_completed}}:{job_state=8?aborted:completed at<BR>{?date_time_at_completed=?Unknown:{date_time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
 <EM>"{job_printer_state_message}"</EM>:}</TD>
 <TD>
 {job_preserved>0?{job_state>5?
index 2f0aa5cc86b0a52081d374fbe809b19e0e4857ab..925243cc20c8d2971e557099caeb266c7bf071fa 100644 (file)
@@ -11,9 +11,9 @@
 <TD>{?job_originating_user_name=?Nie podano:{job_originating_user_name}}&nbsp;</TD>
 <TD>{job_k_octets}k&nbsp;</TD>
 <TD>{job_impressions_completed=0?Niewiadoma:{?job_impressions_completed}}&nbsp;</TD>
-<TD>{job_state=3?czeka od<BR>{?time_at_creation=?Nieznany:{time_at_creation}}:{job_state=4?wstrzymany od<BR>{?time_at_creation=?Nieznany:{time_at_creation}}:
-{job_state=5?przetwarzany od<BR>{?time_at_processing=?Nieznany:{time_at_processing}}:{job_state=6?zatrzymany:
-{job_state=7?anulowany o<BR>{?time_at_completed=?Nieznany:{time_at_completed}}:{job_state=8?przerwany:zakończony o<BR>{?time_at_completed=?Nieznany:{time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
+<TD>{job_state=3?czeka od<BR>{?date_time_at_creation=?Nieznany:{date_time_at_creation}}:{job_state=4?wstrzymany od<BR>{?date_time_at_creation=?Nieznany:{date_time_at_creation}}:
+{job_state=5?przetwarzany od<BR>{?date_time_at_processing=?Nieznany:{date_time_at_processing}}:{job_state=6?zatrzymany:
+{job_state=7?anulowany o<BR>{?date_time_at_completed=?Nieznany:{date_time_at_completed}}:{job_state=8?przerwany:zakończony o<BR>{?date_time_at_completed=?Nieznany:{date_time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
 <EM>"{job_printer_state_message}"</EM>:}</TD>
 <TD>
 {job_preserved>0?{job_state>5?
index c52be24ed2569603bb9243647eea8fffcd63c4d9..6c4b6fe11a708dd5b3a865840e77e90f11a49724 100644 (file)
@@ -11,9 +11,9 @@
 <TD>{?job_originating_user_name=?Retido:{job_originating_user_name}}&nbsp;</TD>
 <TD>{job_k_octets}k&nbsp;</TD>
 <TD>{job_impressions_completed=0?Desconhecido:{?job_impressions_completed}}&nbsp;</TD>
-<TD>{job_state=3?Pendente desde<BR>{?time_at_creation=?Unknown:{time_at_creation}}:{job_state=4?Retido desde<BR>{?time_at_creation=?Unknown:{time_at_creation}}:
-{job_state=5?Processando desde<BR>{?time_at_processing=?Unknown:{time_at_processing}}:{job_state=6?parado:
-{job_state=7?Cancelado em<BR>{?time_at_completed=?Unknown:{time_at_completed}}:{job_state=8?Abortado:Conclu&iacute;do em<BR>{?time_at_completed=?Unknown:{time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
+<TD>{job_state=3?Pendente desde<BR>{?date_time_at_creation=?Unknown:{date_time_at_creation}}:{job_state=4?Retido desde<BR>{?date_time_at_creation=?Unknown:{date_time_at_creation}}:
+{job_state=5?Processando desde<BR>{?date_time_at_processing=?Unknown:{date_time_at_processing}}:{job_state=6?parado:
+{job_state=7?Cancelado em<BR>{?date_time_at_completed=?Unknown:{date_time_at_completed}}:{job_state=8?Abortado:Conclu&iacute;do em<BR>{?date_time_at_completed=?Unknown:{date_time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
 <EM>"{job_printer_state_message}"</EM>:}</TD>
 <TD>
 {job_preserved>0?{job_state>5?
index 9340f1cea824be48ddf8e1e44eaf97a3730ac0a1..07a18fb19cc10f9945c79c945d65a07cf28e7fa6 100644 (file)
@@ -11,9 +11,9 @@
 <TD>{?job_originating_user_name=?Приостановлено пользователем:{job_originating_user_name}}&nbsp;</TD>
 <TD>{job_k_octets}k&nbsp;</TD>
 <TD>{job_impressions_completed=0?Неизвестно:{?job_impressions_completed}}&nbsp;</TD>
-<TD>{job_state=3?В очереди<BR>{?time_at_creation=?Unknown:{time_at_creation}}:{job_state=4?Приостановлено с<BR>{?time_at_creation=?Unknown:{time_at_creation}}:
-{job_state=5?Создано<BR>{?time_at_processing=?Unknown:{time_at_processing}}:{job_state=6?Остановлено:
-{job_state=7?Отменено<BR>{?time_at_completed=?Unknown:{time_at_completed}}:{job_state=8?Прервано:Завершено<BR>{?time_at_completed=?Unknown:{time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
+<TD>{job_state=3?В очереди<BR>{?date_time_at_creation=?Unknown:{date_time_at_creation}}:{job_state=4?Приостановлено с<BR>{?date_time_at_creation=?Unknown:{date_time_at_creation}}:
+{job_state=5?Создано<BR>{?date_time_at_processing=?Unknown:{date_time_at_processing}}:{job_state=6?Остановлено:
+{job_state=7?Отменено<BR>{?date_time_at_completed=?Unknown:{date_time_at_completed}}:{job_state=8?Прервано:Завершено<BR>{?date_time_at_completed=?Unknown:{date_time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
 <EM>"{job_printer_state_message}"</EM>:}</TD>
 <TD>
 {job_preserved>0?{job_state>5?
index f1388da6a0dfddaf23bbb6f1e9321cb69d198869..09c3cad2fc60d6146fc0ce7e5447eeaa852cc7f9 100644 (file)
@@ -11,9 +11,9 @@
 <TD>{?job_originating_user_name=?Withheld:{job_originating_user_name}}&nbsp;</TD>
 <TD>{job_k_octets}k&nbsp;</TD>
 <TD>{job_impressions_completed=0?Unknown:{?job_impressions_completed}}&nbsp;</TD>
-<TD>{job_state=3?pending since<BR>{?time_at_creation=?Unknown:{time_at_creation}}:{job_state=4?held since<BR>{?time_at_creation=?Unknown:{time_at_creation}}:
-{job_state=5?processing since<BR>{?time_at_processing=?Unknown:{time_at_processing}}:{job_state=6?stopped:
-{job_state=7?canceled at<BR>{?time_at_completed=?Unknown:{time_at_completed}}:{job_state=8?aborted:completed at<BR>{?time_at_completed=?Unknown:{time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
+<TD>{job_state=3?pending since<BR>{?date_time_at_creation=?Unknown:{date_time_at_creation}}:{job_state=4?held since<BR>{?date_time_at_creation=?Unknown:{date_time_at_creation}}:
+{job_state=5?processing since<BR>{?date_time_at_processing=?Unknown:{date_time_at_processing}}:{job_state=6?stopped:
+{job_state=7?canceled at<BR>{?date_time_at_completed=?Unknown:{date_time_at_completed}}:{job_state=8?aborted:completed at<BR>{?date_time_at_completed=?Unknown:{date_time_at_completed}}}}}}}}&nbsp;{job_printer_state_message?<BR>
 <EM>"{job_printer_state_message}"</EM>:}</TD>
 <TD>
 {job_preserved>0?{job_state>5?