Accepting request 229702 from Printing
cups-1.5.4-strftime.patch fixes STR #4388 (bnc#873030) (forwarded request 229700 from jsmeix) OBS-URL: https://build.opensuse.org/request/show/229702 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cups?expand=0&rev=118
This commit is contained in:
288
cups-1.5.4-strftime.patch
Normal file
288
cups-1.5.4-strftime.patch
Normal file
@@ -0,0 +1,288 @@
|
||||
diff -Nur cups-1.5.4.dist/cgi-bin/ipp-var.c cups-1.5.4/cgi-bin/ipp-var.c
|
||||
--- cups-1.5.4.dist/cgi-bin/ipp-var.c 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5.4/cgi-bin/ipp-var.c 2014-03-09 13:21:20.065678625 +0100
|
||||
@@ -1192,7 +1192,7 @@
|
||||
t = (time_t)attr->values[i].integer;
|
||||
date = localtime(&t);
|
||||
|
||||
- strftime(valptr, sizeof(value) - (valptr - value), "%c", date);
|
||||
+ _cupsstrftime(valptr, sizeof(value) - (valptr - value), "%c", date);
|
||||
}
|
||||
else
|
||||
snprintf(valptr, sizeof(value) - (valptr - value),
|
||||
diff -Nur cups-1.5.4.dist/cups/language-private.h cups-1.5.4/cups/language-private.h
|
||||
--- cups-1.5.4.dist/cups/language-private.h 2010-11-20 02:03:46.000000000 +0100
|
||||
+++ cups-1.5.4/cups/language-private.h 2014-03-09 13:21:20.073680045 +0100
|
||||
@@ -79,6 +79,7 @@
|
||||
extern const char *_cupsMessageLookup(cups_array_t *a, const char *m);
|
||||
extern void _cupsSetLocale(char *argv[]);
|
||||
|
||||
+extern size_t _cupsstrftime(char *s, size_t max, const char *format, const struct tm *tm);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
diff -Nur cups-1.5.4.dist/cups/libcups2.def cups-1.5.4/cups/libcups2.def
|
||||
--- cups-1.5.4.dist/cups/libcups2.def 2011-09-09 23:55:11.000000000 +0200
|
||||
+++ cups-1.5.4/cups/libcups2.def 2014-03-09 13:21:20.077680723 +0100
|
||||
@@ -9,6 +9,7 @@
|
||||
_cupsLangPrintf
|
||||
_cupsLangPuts
|
||||
_cupsLangString
|
||||
+_cupsstrftime
|
||||
_cupsMD5Append
|
||||
_cupsMD5Finish
|
||||
_cupsMD5Init
|
||||
diff -Nur cups-1.5.4.dist/cups/libcups_s.exp cups-1.5.4/cups/libcups_s.exp
|
||||
--- cups-1.5.4.dist/cups/libcups_s.exp 2011-04-16 01:38:13.000000000 +0200
|
||||
+++ cups-1.5.4/cups/libcups_s.exp 2014-03-09 13:21:20.085681923 +0100
|
||||
@@ -7,6 +7,7 @@
|
||||
_cupsLangPrintf
|
||||
_cupsLangPuts
|
||||
_cupsLangString
|
||||
+_cupsstrftime
|
||||
_cupsMD5Append
|
||||
_cupsMD5Finish
|
||||
_cupsMD5Init
|
||||
diff -Nur cups-1.5.4.dist/cups/Makefile cups-1.5.4/cups/Makefile
|
||||
--- cups-1.5.4.dist/cups/Makefile 2011-09-09 18:34:29.000000000 +0200
|
||||
+++ cups-1.5.4/cups/Makefile 2014-03-09 13:21:20.089682442 +0100
|
||||
@@ -63,6 +63,7 @@
|
||||
snmp.o \
|
||||
snprintf.o \
|
||||
string.o \
|
||||
+ strftime.o \
|
||||
tempfile.o \
|
||||
thread.o \
|
||||
transcode.o \
|
||||
diff -Nur cups-1.5.4.dist/cups/strftime.c cups-1.5.4/cups/strftime.c
|
||||
--- cups-1.5.4.dist/cups/strftime.c 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ cups-1.5.4/cups/strftime.c 2014-03-09 13:21:20.093682921 +0100
|
||||
@@ -0,0 +1,56 @@
|
||||
+/*
|
||||
+ * "$Id$"
|
||||
+ *
|
||||
+ * Localized strftime function for CUPS.
|
||||
+ *
|
||||
+ *
|
||||
+ * Contents:
|
||||
+ *
|
||||
+ * _cupsstrftime() - format date and time
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * Include necessary headers...
|
||||
+ */
|
||||
+
|
||||
+#include "cups-private.h"
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * '_cupsstrftime()' - format date and time in current locale and convert to UTF8
|
||||
+ */
|
||||
+
|
||||
+size_t
|
||||
+_cupsstrftime(char *s, size_t max, const char *format, const struct tm *tm)
|
||||
+{
|
||||
+ size_t size=0;
|
||||
+ char date[256]; /* Date buffer */
|
||||
+ cups_utf8_t utf8[256]; /* Date in utf8 */
|
||||
+ _cups_globals_t *cg; /* Global data */
|
||||
+
|
||||
+ cg = _cupsGlobals();
|
||||
+
|
||||
+ if (!cg->lang_default)
|
||||
+ cg->lang_default = cupsLangDefault();
|
||||
+
|
||||
+ if ((size=strftime(date, max, format, tm))!=0)
|
||||
+ {
|
||||
+
|
||||
+ if (cg->lang_default->encoding != CUPS_UTF8)
|
||||
+ {
|
||||
+ cupsCharsetToUTF8(utf8, date, (int)sizeof(utf8), cg->lang_default->encoding);
|
||||
+ strncpy(s, utf8, 256);
|
||||
+ }
|
||||
+ else {
|
||||
+ strncpy(s, date, 256);
|
||||
+ }
|
||||
+ }
|
||||
+ return ((size_t)size);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * End of "$Id$".
|
||||
+ */
|
||||
diff -Nur cups-1.5.4.dist/cups/testipp.c cups-1.5.4/cups/testipp.c
|
||||
--- cups-1.5.4.dist/cups/testipp.c 2011-09-14 02:31:10.000000000 +0200
|
||||
+++ cups-1.5.4/cups/testipp.c 2014-03-09 13:21:20.101683760 +0100
|
||||
@@ -891,7 +891,7 @@
|
||||
{
|
||||
vtime = ippDateToTime(val->date);
|
||||
vdate = localtime(&vtime);
|
||||
- strftime(vstring, sizeof(vstring), "%c", vdate);
|
||||
+ _cupsstrftime(vstring, sizeof(vstring), "%c", vdate);
|
||||
printf(" (%s)", vstring);
|
||||
}
|
||||
}
|
||||
diff -Nur cups-1.5.4.dist/filter/bannertops.c cups-1.5.4/filter/bannertops.c
|
||||
--- cups-1.5.4.dist/filter/bannertops.c 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5.4/filter/bannertops.c 2014-03-09 13:21:20.105684120 +0100
|
||||
@@ -843,7 +843,7 @@
|
||||
curtime = (time_t)atoi(option);
|
||||
curdate = localtime(&curtime);
|
||||
|
||||
- strftime(text, sizeof(text), "%c", curdate);
|
||||
+ _cupsstrftime(text, sizeof(text), "%c", curdate);
|
||||
}
|
||||
else
|
||||
strlcpy(text, "?", sizeof(text));
|
||||
@@ -865,7 +865,7 @@
|
||||
curtime = (time_t)atoi(option);
|
||||
curdate = localtime(&curtime);
|
||||
|
||||
- strftime(text, sizeof(text), "%c", curdate);
|
||||
+ _cupsstrftime(text, sizeof(text), "%c", curdate);
|
||||
}
|
||||
else
|
||||
strlcpy(text, "?", sizeof(text));
|
||||
@@ -1066,7 +1066,7 @@
|
||||
|
||||
curtime = time(NULL);
|
||||
curtm = localtime(&curtime);
|
||||
- strftime(curdate, sizeof(curdate), "%c", curtm);
|
||||
+ _cupsstrftime(curdate, sizeof(curdate), "%c", curtm);
|
||||
|
||||
puts("%!PS-Adobe-3.0");
|
||||
printf("%%%%BoundingBox: %.0f %.0f %.0f %.0f\n", PageLeft, PageBottom,
|
||||
diff -Nur cups-1.5.4.dist/filter/imagetops.c cups-1.5.4/filter/imagetops.c
|
||||
--- cups-1.5.4.dist/filter/imagetops.c 2011-08-17 23:01:53.000000000 +0200
|
||||
+++ cups-1.5.4/filter/imagetops.c 2014-03-09 13:21:20.113684721 +0100
|
||||
@@ -618,7 +618,7 @@
|
||||
puts("%%DocumentData: Clean7Bit");
|
||||
puts("%%DocumentNeededResources: font Helvetica-Bold");
|
||||
puts("%%Creator: imagetops/" CUPS_SVERSION);
|
||||
- strftime(curdate, sizeof(curdate), "%c", curtm);
|
||||
+ _cupsstrftime(curdate, sizeof(curdate), "%c", curtm);
|
||||
printf("%%%%CreationDate: %s\n", curdate);
|
||||
WriteTextComment("Title", argv[3]);
|
||||
WriteTextComment("For", argv[2]);
|
||||
diff -Nur cups-1.5.4.dist/filter/texttops.c cups-1.5.4/filter/texttops.c
|
||||
--- cups-1.5.4.dist/filter/texttops.c 2010-12-03 07:29:20.000000000 +0100
|
||||
+++ cups-1.5.4/filter/texttops.c 2014-03-09 13:21:20.117684961 +0100
|
||||
@@ -223,7 +223,7 @@
|
||||
|
||||
curtime = time(NULL);
|
||||
curtm = localtime(&curtime);
|
||||
- strftime(curdate, sizeof(curdate), "%c", curtm);
|
||||
+ _cupsstrftime(curdate, sizeof(curdate), "%c", curtm);
|
||||
|
||||
puts("%!PS-Adobe-3.0");
|
||||
printf("%%%%BoundingBox: 0 0 %.0f %.0f\n", PageWidth, PageLength);
|
||||
diff -Nur cups-1.5.4.dist/scheduler/testsub.c cups-1.5.4/scheduler/testsub.c
|
||||
--- cups-1.5.4.dist/scheduler/testsub.c 2010-03-24 01:45:34.000000000 +0100
|
||||
+++ cups-1.5.4/scheduler/testsub.c 2014-03-09 13:21:20.125685362 +0100
|
||||
@@ -442,7 +442,7 @@
|
||||
{
|
||||
vtime = ippDateToTime(val->date);
|
||||
vdate = localtime(&vtime);
|
||||
- strftime(vstring, sizeof(vstring), "%c", vdate);
|
||||
+ _cupsstrftime(vstring, sizeof(vstring), "%c", vdate);
|
||||
printf(" (%s)", vstring);
|
||||
}
|
||||
}
|
||||
diff -Nur cups-1.5.4.dist/systemv/lpstat.c cups-1.5.4/systemv/lpstat.c
|
||||
--- cups-1.5.4.dist/systemv/lpstat.c 2011-10-07 23:41:07.000000000 +0200
|
||||
+++ cups-1.5.4/systemv/lpstat.c 2014-03-09 13:21:20.133685662 +0100
|
||||
@@ -744,7 +744,7 @@
|
||||
if (match_list(printers, printer))
|
||||
{
|
||||
pdate = localtime(&ptime);
|
||||
- strftime(printer_state_time, sizeof(printer_state_time), "%c", pdate);
|
||||
+ _cupsstrftime(printer_state_time, sizeof(printer_state_time), "%c", pdate);
|
||||
|
||||
if (accepting)
|
||||
_cupsLangPrintf(stdout, _("%s accepting requests since %s"),
|
||||
@@ -1436,7 +1436,7 @@
|
||||
* Show the consolidated output format for the SGI tools...
|
||||
*/
|
||||
|
||||
- if (!strftime(date, sizeof(date), "%b %d %H:%M", jobdate))
|
||||
+ if (!_cupsstrftime(date, sizeof(date), "%b %d %H:%M", jobdate))
|
||||
strcpy(date, "Unknown");
|
||||
|
||||
_cupsLangPrintf(stdout, "%s;%s;%d;%s;%s",
|
||||
@@ -1445,7 +1445,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- if (!strftime(date, sizeof(date), "%c", jobdate))
|
||||
+ if (!_cupsstrftime(date, sizeof(date), "%c", jobdate))
|
||||
strcpy(date, "Unknown");
|
||||
|
||||
if (ranking)
|
||||
@@ -1764,7 +1764,7 @@
|
||||
*/
|
||||
|
||||
pdate = localtime(&ptime);
|
||||
- strftime(printer_state_time, sizeof(printer_state_time), "%c", pdate);
|
||||
+ _cupsstrftime(printer_state_time, sizeof(printer_state_time), "%c", pdate);
|
||||
|
||||
switch (pstate)
|
||||
{
|
||||
--- cups-1.5.4.dist/test/run-stp-tests.sh 2014-03-12 08:35:30.805162912 +0100
|
||||
+++ cups-1.5.4/test/run-stp-tests.sh 2014-03-12 09:45:53.668548631 +0100
|
||||
@@ -411,6 +411,19 @@
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
|
||||
+cat >>/tmp/cups-$user/printers.conf <<EOF
|
||||
+<Printer test5.4>
|
||||
+Accepting Yes
|
||||
+DeviceURI file:/dev/null
|
||||
+Info Test raw printer $i
|
||||
+JobSheets none none
|
||||
+Location CUPS test suite
|
||||
+State Idle
|
||||
+StateTime 1394607600
|
||||
+StateMessage Printer $1 is idle.
|
||||
+</Printer>
|
||||
+EOF
|
||||
+
|
||||
if test -f /tmp/cups-$user/printers.conf; then
|
||||
cp /tmp/cups-$user/printers.conf /tmp/cups-$user/printers.conf.orig
|
||||
else
|
||||
--- cups-1.5.4.dist/test/5.4-lpstat.sh 2014-03-12 08:26:22.738824487 +0100
|
||||
+++ cups-1.5.4/test/5.4-lpstat.sh 2014-03-12 09:44:43.838713821 +0100
|
||||
@@ -38,6 +38,30 @@
|
||||
fi
|
||||
echo ""
|
||||
|
||||
+echo "LPSTAT Test"
|
||||
+echo ""
|
||||
+echo " lpstat -p"
|
||||
+state="`../systemv/lpstat -p test5.4 | head -1 2>&1`"
|
||||
+if test $? != 0 -o "x$state" != "xprinter test5.4 is idle. enabled since Wed Mar 12 08:00:00 2014"; then
|
||||
+ echo " FAILED"
|
||||
+ exit 1
|
||||
+else
|
||||
+ echo " PASSED"
|
||||
+fi
|
||||
+echo ""
|
||||
+
|
||||
+echo "LPSTAT Test2"
|
||||
+echo ""
|
||||
+echo " LC_ALL=de_DE@euro lpstat -p"
|
||||
+state="`LC_ALL=de_DE@euro ../systemv/lpstat -p test5.4 | head -1 2>&1`"
|
||||
+if test $? != 0 -o "x$state" != "xprinter test5.4 is idle. enabled since Mi 12 M<>r 2014 08:00:00 CET"; then
|
||||
+ echo " FAILED"
|
||||
+ exit 1
|
||||
+else
|
||||
+ echo " PASSED"
|
||||
+fi
|
||||
+echo ""
|
||||
+
|
||||
#
|
||||
# End of "$Id: 5.4-lpstat.sh 8498 2009-04-13 17:03:15Z mike $".
|
||||
#
|
@@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 11 09:42:30 CEST 2014 - jsmeix@suse.de
|
||||
|
||||
- cups-1.5.4-strftime.patch fixes CUPS upstream STR #4388:
|
||||
no or malformed output from lpstat in charset other than utf-8
|
||||
(bnc#873030).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 20 13:57:24 CET 2014 - jsmeix@suse.de
|
||||
|
||||
|
@@ -15,6 +15,7 @@
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
Name: cups
|
||||
BuildRequires: dbus-1-devel
|
||||
BuildRequires: fdupes
|
||||
@@ -218,6 +219,8 @@ Patch112: cups-0003-systemd-secure-cups.service-unit-file.patch
|
||||
Patch113: cups-1.5.4-CVE-2012-5519.patch
|
||||
# Patch114 fixes STR #4351: cups-lpd hugh jobs (>2G) fail
|
||||
Patch114: str4351.patch
|
||||
# Patch115 fixes STR #4388: no or malformed output from lpstat in charset other than utf-8
|
||||
Patch115: cups-1.5.4-strftime.patch
|
||||
# Install into this non-root directory (required when norootforbuild is used):
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
@@ -380,6 +383,8 @@ printer drivers for CUPS.
|
||||
%patch113
|
||||
# Patch114 fixes STR #4351: cups-lpd hugh jobs (>2G) fail
|
||||
%patch114
|
||||
# Patch115 fixes STR #4388: no or malformed output from lpstat in charset other than utf-8
|
||||
%patch115 -p1
|
||||
|
||||
%build
|
||||
# Disable SILENT run of make so that make runs verbose as usual:
|
||||
|
Reference in New Issue
Block a user