From: Michael R Sweet Date: Mon, 22 Jun 2026 21:23:05 +0000 (-0400) Subject: Y2038 fixes (Issue #1592) X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fcups.git Y2038 fixes (Issue #1592) - 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. --- diff --git a/CHANGES.md b/CHANGES.md index 50b979cc5b..68224f0e87 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/cgi-bin/ipp-var.c b/cgi-bin/ipp-var.c index 566b3e49bd..cb042ba351 100644 --- a/cgi-bin/ipp-var.c +++ b/cgi-bin/ipp-var.c @@ -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) diff --git a/cups/ppd-util.c b/cups/ppd-util.c index 8001f33427..28d70a512d 100644 --- a/cups/ppd-util.c +++ b/cups/ppd-util.c @@ -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); } diff --git a/cups/tls-openssl.c b/cups/tls-openssl.c index 6396a03e2d..191dff3c7b 100644 --- a/cups/tls-openssl.c +++ b/cups/tls-openssl.c @@ -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)) { diff --git a/cups/util.c b/cups/util.c index 80063c2b7c..d1f0a7a2f4 100644 --- a/cups/util.c +++ b/cups/util.c @@ -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) { diff --git a/scheduler/classes.c b/scheduler/classes.c index cc78561203..9c3c62bd0c 100644 --- a/scheduler/classes.c +++ b/scheduler/classes.c @@ -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"); diff --git a/scheduler/job.c b/scheduler/job.c index 944195920d..2e61d14642 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -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, "\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")) { diff --git a/scheduler/printers.c b/scheduler/printers.c index 90f76e17fb..efa4923f47 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -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, "\n"); diff --git a/scheduler/subscriptions.c b/scheduler/subscriptions.c index ef8ea0bd04..a65ea18d0e 100644 --- a/scheduler/subscriptions.c +++ b/scheduler/subscriptions.c @@ -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, "\n"); diff --git a/systemv/lpstat.c b/systemv/lpstat.c index 57a90e99b0..38bafb5616 100644 --- a/systemv/lpstat.c +++ b/systemv/lpstat.c @@ -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; diff --git a/templates/da/jobs.tmpl b/templates/da/jobs.tmpl index db4a0c072f..f287b40b33 100644 --- a/templates/da/jobs.tmpl +++ b/templates/da/jobs.tmpl @@ -11,9 +11,9 @@ {?job_originating_user_name=?Tilbageholdt:{job_originating_user_name}}  {job_k_octets}k  {job_impressions_completed=0?Ukendt:{?job_impressions_completed}}  -{job_state=3?afventer siden
{?time_at_creation=?Ukendt:{time_at_creation}}:{job_state=4?tilbageholdt siden
{?time_at_creation=?Ukendt:{time_at_creation}}: -{job_state=5?behandler siden
{?time_at_processing=?Ukendt:{time_at_processing}}:{job_state=6?stoppet: -{job_state=7?annulleret ved
{?time_at_completed=?Ukendt:{time_at_completed}}:{job_state=8?afbrudt:fuldtført ved
{?time_at_completed=?Ukendt:{time_at_completed}}}}}}}} {job_printer_state_message?
+{job_state=3?afventer siden
{?date_time_at_creation=?Ukendt:{date_time_at_creation}}:{job_state=4?tilbageholdt siden
{?date_time_at_creation=?Ukendt:{date_time_at_creation}}: +{job_state=5?behandler siden
{?date_time_at_processing=?Ukendt:{date_time_at_processing}}:{job_state=6?stoppet: +{job_state=7?annulleret ved
{?date_time_at_completed=?Ukendt:{date_time_at_completed}}:{job_state=8?afbrudt:fuldtført ved
{?date_time_at_completed=?Ukendt:{date_time_at_completed}}}}}}}} {job_printer_state_message?
"{job_printer_state_message}":} {job_preserved>0?{job_state>5? diff --git a/templates/de/jobs.tmpl b/templates/de/jobs.tmpl index 52eff2bf3b..75ff9b96e8 100644 --- a/templates/de/jobs.tmpl +++ b/templates/de/jobs.tmpl @@ -11,9 +11,9 @@ {?job_originating_user_name=?Zurückbehalten:{job_originating_user_name}}  {job_k_octets}k  {job_impressions_completed=0?Unbekannt:{?job_impressions_completed}}  -{job_state=3?unerledigt seit
{?time_at_creation=?Unknown:{time_at_creation}}:{job_state=4?angehalten seit
{?time_at_creation=?Unknown:{time_at_creation}}: -{job_state=5?verarbeitet seit
{?time_at_processing=?Unknown:{time_at_processing}}:{job_state=6?angehalten: -{job_state=7?gelöscht am
{?time_at_completed=?Unknown:{time_at_completed}}:{job_state=8?abgebrochen:beendet am
{?time_at_completed=?Unknown:{time_at_completed}}}}}}}} {job_printer_state_message?
+{job_state=3?unerledigt seit
{?date_time_at_creation=?Unknown:{date_time_at_creation}}:{job_state=4?angehalten seit
{?date_time_at_creation=?Unknown:{date_time_at_creation}}: +{job_state=5?verarbeitet seit
{?date_time_at_processing=?Unknown:{date_time_at_processing}}:{job_state=6?angehalten: +{job_state=7?gelöscht am
{?date_time_at_completed=?Unknown:{date_time_at_completed}}:{job_state=8?abgebrochen:beendet am
{?date_time_at_completed=?Unknown:{date_time_at_completed}}}}}}}} {job_printer_state_message?
"{job_printer_state_message}":} {job_preserved>0?{job_state>5? diff --git a/templates/es/jobs.tmpl b/templates/es/jobs.tmpl index aba2c518ec..0af3ad8967 100644 --- a/templates/es/jobs.tmpl +++ b/templates/es/jobs.tmpl @@ -11,9 +11,9 @@ {?job_originating_user_name=?Retenido:{job_originating_user_name}}  {job_k_octets}k  {job_impressions_completed=0?Desconocido:{?job_impressions_completed}}  -{job_state=3?pendiente desde
{?time_at_creation=?Unknown:{time_at_creation}}:{job_state=4?retenido desde
{?time_at_creation=?Unknown:{time_at_creation}}: -{job_state=5?en proceso desde
{?time_at_processing=?Unknown:{time_at_processing}}:{job_state=6?parado: -{job_state=7?cancelado el
{?time_at_completed=?Unknown:{time_at_completed}}:{job_state=8?interrumpido:completado el
{?time_at_completed=?Unknown:{time_at_completed}}}}}}}} {job_printer_state_message?
+{job_state=3?pendiente desde
{?date_time_at_creation=?Unknown:{date_time_at_creation}}:{job_state=4?retenido desde
{?date_time_at_creation=?Unknown:{date_time_at_creation}}: +{job_state=5?en proceso desde
{?date_time_at_processing=?Unknown:{date_time_at_processing}}:{job_state=6?parado: +{job_state=7?cancelado el
{?date_time_at_completed=?Unknown:{date_time_at_completed}}:{job_state=8?interrumpido:completado el
{?date_time_at_completed=?Unknown:{date_time_at_completed}}}}}}}} {job_printer_state_message?
"{job_printer_state_message}":} {job_preserved>0?{job_state>5? diff --git a/templates/fr/jobs.tmpl b/templates/fr/jobs.tmpl index d10e68bb95..3e1afb1981 100644 --- a/templates/fr/jobs.tmpl +++ b/templates/fr/jobs.tmpl @@ -11,9 +11,9 @@ {?job_originating_user_name=?Caché:{job_originating_user_name}}  {job_k_octets}k  {job_impressions_completed=0?Inconnu:{?job_impressions_completed}}  -{job_state=3?en attente depuis
{?time_at_creation=?Inconnu:{time_at_creation}}:{job_state=4?retenu depuis le
{?time_at_creation=?Inconnu:{time_at_creation}}: -{job_state=5?en cours d'impression depuis
{?time_at_processing=?Inconnu:{time_at_processing}}:{job_state=6?arrêté: -{job_state=7?annulé depuis
{?time_at_completed=?Inconnu:{time_at_completed}}:{job_state=8?annulé:terminé depuis
{?time_at_completed=?Inconnu:{time_at_completed}}}}}}}} {job_printer_state_message?
+{job_state=3?en attente depuis
{?date_time_at_creation=?Inconnu:{date_time_at_creation}}:{job_state=4?retenu depuis le
{?date_time_at_creation=?Inconnu:{date_time_at_creation}}: +{job_state=5?en cours d'impression depuis
{?date_time_at_processing=?Inconnu:{date_time_at_processing}}:{job_state=6?arrêté: +{job_state=7?annulé depuis
{?date_time_at_completed=?Inconnu:{date_time_at_completed}}:{job_state=8?annulé:terminé depuis
{?date_time_at_completed=?Inconnu:{date_time_at_completed}}}}}}}} {job_printer_state_message?
"{job_printer_state_message}":} {job_preserved>0?{job_state>5? diff --git a/templates/ja/jobs.tmpl b/templates/ja/jobs.tmpl index a420f0aeba..640bc16e03 100644 --- a/templates/ja/jobs.tmpl +++ b/templates/ja/jobs.tmpl @@ -11,9 +11,9 @@ {?job_originating_user_name=?隠匿:{job_originating_user_name}}  {job_k_octets}k  {job_impressions_completed=0?不明:{?job_impressions_completed}}  -{job_state=3?{?time_at_creation=?Unknown:{time_at_creation}}
から保留中:{job_state=4?{?time_at_creation=?Unknown:{time_at_creation}}
から保留中: -{job_state=5?{?time_at_processing=?Unknown:{time_at_processing}}
から処理中:{job_state=6?に停止: -{job_state=7?{?time_at_completed=?Unknown:{time_at_completed}}
にキャンセル:{job_state=8?に中断:{?time_at_completed=?Unknown:{time_at_completed}}
に完了}}}}}} {job_printer_state_message?
+{job_state=3?{?date_time_at_creation=?Unknown:{date_time_at_creation}}
から保留中:{job_state=4?{?date_time_at_creation=?Unknown:{date_time_at_creation}}
から保留中: +{job_state=5?{?date_time_at_processing=?Unknown:{date_time_at_processing}}
から処理中:{job_state=6?に停止: +{job_state=7?{?date_time_at_completed=?Unknown:{date_time_at_completed}}
にキャンセル:{job_state=8?に中断:{?date_time_at_completed=?Unknown:{date_time_at_completed}}
に完了}}}}}} {job_printer_state_message?
"{job_printer_state_message}":} {job_preserved>0?{job_state>5? diff --git a/templates/jobs.tmpl b/templates/jobs.tmpl index 353767cbab..e56c369c84 100644 --- a/templates/jobs.tmpl +++ b/templates/jobs.tmpl @@ -11,9 +11,9 @@ {?job_originating_user_name=?Withheld:{job_originating_user_name}}  {job_k_octets}k  {job_impressions_completed=0?Unknown:{?job_impressions_completed}}  -{job_state=3?pending since
{?time_at_creation=?Unknown:{time_at_creation}}:{job_state=4?held since
{?time_at_creation=?Unknown:{time_at_creation}}: -{job_state=5?processing since
{?time_at_processing=?Unknown:{time_at_processing}}:{job_state=6?stopped: -{job_state=7?canceled at
{?time_at_completed=?Unknown:{time_at_completed}}:{job_state=8?aborted:completed at
{?time_at_completed=?Unknown:{time_at_completed}}}}}}}} {job_printer_state_message?
+{job_state=3?pending since
{?date_time_at_creation=?Unknown:{date_time_at_creation}}:{job_state=4?held since
{?date_time_at_creation=?Unknown:{date_time_at_creation}}: +{job_state=5?processing since
{?date_time_at_processing=?Unknown:{date_time_at_processing}}:{job_state=6?stopped: +{job_state=7?canceled at
{?date_time_at_completed=?Unknown:{date_time_at_completed}}:{job_state=8?aborted:completed at
{?date_time_at_completed=?Unknown:{date_time_at_completed}}}}}}}} {job_printer_state_message?
"{job_printer_state_message}":} {job_preserved>0?{job_state>5? diff --git a/templates/pl/jobs.tmpl b/templates/pl/jobs.tmpl index 2f0aa5cc86..925243cc20 100644 --- a/templates/pl/jobs.tmpl +++ b/templates/pl/jobs.tmpl @@ -11,9 +11,9 @@ {?job_originating_user_name=?Nie podano:{job_originating_user_name}}  {job_k_octets}k  {job_impressions_completed=0?Niewiadoma:{?job_impressions_completed}}  -{job_state=3?czeka od
{?time_at_creation=?Nieznany:{time_at_creation}}:{job_state=4?wstrzymany od
{?time_at_creation=?Nieznany:{time_at_creation}}: -{job_state=5?przetwarzany od
{?time_at_processing=?Nieznany:{time_at_processing}}:{job_state=6?zatrzymany: -{job_state=7?anulowany o
{?time_at_completed=?Nieznany:{time_at_completed}}:{job_state=8?przerwany:zakończony o
{?time_at_completed=?Nieznany:{time_at_completed}}}}}}}} {job_printer_state_message?
+{job_state=3?czeka od
{?date_time_at_creation=?Nieznany:{date_time_at_creation}}:{job_state=4?wstrzymany od
{?date_time_at_creation=?Nieznany:{date_time_at_creation}}: +{job_state=5?przetwarzany od
{?date_time_at_processing=?Nieznany:{date_time_at_processing}}:{job_state=6?zatrzymany: +{job_state=7?anulowany o
{?date_time_at_completed=?Nieznany:{date_time_at_completed}}:{job_state=8?przerwany:zakończony o
{?date_time_at_completed=?Nieznany:{date_time_at_completed}}}}}}}} {job_printer_state_message?
"{job_printer_state_message}":} {job_preserved>0?{job_state>5? diff --git a/templates/pt_BR/jobs.tmpl b/templates/pt_BR/jobs.tmpl index c52be24ed2..6c4b6fe11a 100644 --- a/templates/pt_BR/jobs.tmpl +++ b/templates/pt_BR/jobs.tmpl @@ -11,9 +11,9 @@ {?job_originating_user_name=?Retido:{job_originating_user_name}}  {job_k_octets}k  {job_impressions_completed=0?Desconhecido:{?job_impressions_completed}}  -{job_state=3?Pendente desde
{?time_at_creation=?Unknown:{time_at_creation}}:{job_state=4?Retido desde
{?time_at_creation=?Unknown:{time_at_creation}}: -{job_state=5?Processando desde
{?time_at_processing=?Unknown:{time_at_processing}}:{job_state=6?parado: -{job_state=7?Cancelado em
{?time_at_completed=?Unknown:{time_at_completed}}:{job_state=8?Abortado:Concluído em
{?time_at_completed=?Unknown:{time_at_completed}}}}}}}} {job_printer_state_message?
+{job_state=3?Pendente desde
{?date_time_at_creation=?Unknown:{date_time_at_creation}}:{job_state=4?Retido desde
{?date_time_at_creation=?Unknown:{date_time_at_creation}}: +{job_state=5?Processando desde
{?date_time_at_processing=?Unknown:{date_time_at_processing}}:{job_state=6?parado: +{job_state=7?Cancelado em
{?date_time_at_completed=?Unknown:{date_time_at_completed}}:{job_state=8?Abortado:Concluído em
{?date_time_at_completed=?Unknown:{date_time_at_completed}}}}}}}} {job_printer_state_message?
"{job_printer_state_message}":} {job_preserved>0?{job_state>5? diff --git a/templates/ru/jobs.tmpl b/templates/ru/jobs.tmpl index 9340f1cea8..07a18fb19c 100644 --- a/templates/ru/jobs.tmpl +++ b/templates/ru/jobs.tmpl @@ -11,9 +11,9 @@ {?job_originating_user_name=?Приостановлено пользователем:{job_originating_user_name}}  {job_k_octets}k  {job_impressions_completed=0?Неизвестно:{?job_impressions_completed}}  -{job_state=3?В очереди
{?time_at_creation=?Unknown:{time_at_creation}}:{job_state=4?Приостановлено с
{?time_at_creation=?Unknown:{time_at_creation}}: -{job_state=5?Создано
{?time_at_processing=?Unknown:{time_at_processing}}:{job_state=6?Остановлено: -{job_state=7?Отменено
{?time_at_completed=?Unknown:{time_at_completed}}:{job_state=8?Прервано:Завершено
{?time_at_completed=?Unknown:{time_at_completed}}}}}}}} {job_printer_state_message?
+{job_state=3?В очереди
{?date_time_at_creation=?Unknown:{date_time_at_creation}}:{job_state=4?Приостановлено с
{?date_time_at_creation=?Unknown:{date_time_at_creation}}: +{job_state=5?Создано
{?date_time_at_processing=?Unknown:{date_time_at_processing}}:{job_state=6?Остановлено: +{job_state=7?Отменено
{?date_time_at_completed=?Unknown:{date_time_at_completed}}:{job_state=8?Прервано:Завершено
{?date_time_at_completed=?Unknown:{date_time_at_completed}}}}}}}} {job_printer_state_message?
"{job_printer_state_message}":} {job_preserved>0?{job_state>5? diff --git a/templates/sv/jobs.tmpl b/templates/sv/jobs.tmpl index f1388da6a0..09c3cad2fc 100644 --- a/templates/sv/jobs.tmpl +++ b/templates/sv/jobs.tmpl @@ -11,9 +11,9 @@ {?job_originating_user_name=?Withheld:{job_originating_user_name}}  {job_k_octets}k  {job_impressions_completed=0?Unknown:{?job_impressions_completed}}  -{job_state=3?pending since
{?time_at_creation=?Unknown:{time_at_creation}}:{job_state=4?held since
{?time_at_creation=?Unknown:{time_at_creation}}: -{job_state=5?processing since
{?time_at_processing=?Unknown:{time_at_processing}}:{job_state=6?stopped: -{job_state=7?canceled at
{?time_at_completed=?Unknown:{time_at_completed}}:{job_state=8?aborted:completed at
{?time_at_completed=?Unknown:{time_at_completed}}}}}}}} {job_printer_state_message?
+{job_state=3?pending since
{?date_time_at_creation=?Unknown:{date_time_at_creation}}:{job_state=4?held since
{?date_time_at_creation=?Unknown:{date_time_at_creation}}: +{job_state=5?processing since
{?date_time_at_processing=?Unknown:{date_time_at_processing}}:{job_state=6?stopped: +{job_state=7?canceled at
{?date_time_at_completed=?Unknown:{date_time_at_completed}}:{job_state=8?aborted:completed at
{?date_time_at_completed=?Unknown:{date_time_at_completed}}}}}}}} {job_printer_state_message?
"{job_printer_state_message}":} {job_preserved>0?{job_state>5?