rpms/cups/F-8 cups-undo-str2537.patch, NONE, 1.1 cups.spec, 1.371, 1.372

Tim Waugh (twaugh) fedora-extras-commits at redhat.com
Mon Nov 12 18:47:17 UTC 2007


Author: twaugh

Update of /cvs/pkgs/rpms/cups/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26629

Modified Files:
	cups.spec 
Added Files:
	cups-undo-str2537.patch 
Log Message:
* Mon Nov 12 2007 Tim Waugh <twaugh at redhat.com>
- Temporarily undo STR #2537 change so that non-UTF-8 requests are not
  rejected (bug #378211).


cups-undo-str2537.patch:

--- NEW FILE cups-undo-str2537.patch ---
diff -up cups-1.3.4/cups/util.c.undo-str2537 cups-1.3.4/cups/util.c
--- cups-1.3.4/cups/util.c.undo-str2537	2007-10-10 23:00:43.000000000 +0100
+++ cups-1.3.4/cups/util.c	2007-11-12 18:44:01.000000000 +0000
@@ -91,6 +91,7 @@ cupsCancelJob(const char *name,		/* I - 
 		uri[HTTP_MAX_URI];	/* Printer URI */
   ipp_t		*request,		/* IPP request */
 		*response;		/* IPP response */
+  cups_lang_t	*language;		/* Language info */
   _cups_globals_t *cg = _cupsGlobals();	/* Pointer to library globals */
 
 
@@ -128,7 +129,21 @@ cupsCancelJob(const char *name,		/* I - 
   *    [requesting-user-name]
   */
 
-  request = ippNewRequest(IPP_CANCEL_JOB);
+  request = ippNew();
+
+  request->request.op.operation_id = IPP_CANCEL_JOB;
+  request->request.op.request_id   = 1;
+
+  language = cupsLangDefault();
+
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
+               "attributes-charset", NULL, cupsLangEncoding(language));
+
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
+               "attributes-natural-language", NULL,
+               language != NULL ? language->language : "C");
+
+  cupsLangFree(language);
 
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
                NULL, uri);
@@ -190,6 +205,7 @@ cupsGetClasses(char ***classes)		/* O - 
   ipp_t		*request,		/* IPP Request */
 		*response;		/* IPP Response */
   ipp_attribute_t *attr;		/* Current attribute */
+  cups_lang_t	*language;		/* Default language */
   char		**temp;			/* Temporary pointer */
   _cups_globals_t *cg = _cupsGlobals();	/* Pointer to library globals */
 
@@ -221,7 +237,20 @@ cupsGetClasses(char ***classes)		/* O - 
   *    requested-attributes
   */
 
-  request = ippNewRequest(CUPS_GET_CLASSES);
+  request = ippNew();
+
+  request->request.op.operation_id = CUPS_GET_CLASSES;
+  request->request.op.request_id   = 1;
+
+  language = cupsLangDefault();
+
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
+               "attributes-charset", NULL, cupsLangEncoding(language));
+
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
+               "attributes-natural-language", NULL, language->language);
+
+  cupsLangFree(language);
 
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
                "requested-attributes", NULL, "printer-name");
@@ -342,6 +371,7 @@ cupsGetDefault2(http_t *http)		/* I - HT
   ipp_t		*request,		/* IPP Request */
 		*response;		/* IPP Response */
   ipp_attribute_t *attr;		/* Current attribute */
+  cups_lang_t	*language;		/* Default language */
   const char	*var;			/* Environment variable */
   _cups_globals_t *cg = _cupsGlobals();	/* Pointer to library globals */
 
@@ -373,7 +403,20 @@ cupsGetDefault2(http_t *http)		/* I - HT
   *    attributes-natural-language
   */
 
-  request = ippNewRequest(CUPS_GET_DEFAULT);
+  request = ippNew();
+
+  request->request.op.operation_id = CUPS_GET_DEFAULT;
+  request->request.op.request_id   = 1;
+
+  language = cupsLangDefault();
+
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
+               "attributes-charset", NULL, cupsLangEncoding(language));
+
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
+               "attributes-natural-language", NULL, language->language);
+
+  cupsLangFree(language);
 
  /*
   * Do the request and get back a response...
@@ -448,6 +491,7 @@ cupsGetJobs2(http_t     *http,		/* I - H
   ipp_t		*request,		/* IPP Request */
 		*response;		/* IPP Response */
   ipp_attribute_t *attr;		/* Current attribute */
+  cups_lang_t	*language;		/* Default language */
   cups_job_t	*temp;			/* Temporary pointer */
   int		id,			/* job-id */
 		priority,		/* job-priority */
@@ -520,7 +564,20 @@ cupsGetJobs2(http_t     *http,		/* I - H
   *    requested-attributes
   */
 
-  request = ippNewRequest(IPP_GET_JOBS);
+  request = ippNew();
+
+  request->request.op.operation_id = IPP_GET_JOBS;
+  request->request.op.request_id   = 1;
+
+  language = cupsLangDefault();
+
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
+               "attributes-charset", NULL, cupsLangEncoding(language));
+
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
+               "attributes-natural-language", NULL, language->language);
+
+  cupsLangFree(language);
 
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
                "printer-uri", NULL, uri);
@@ -900,6 +957,7 @@ cupsGetPrinters(char ***printers)	/* O -
   ipp_t		*request,		/* IPP Request */
 		*response;		/* IPP Response */
   ipp_attribute_t *attr;		/* Current attribute */
+  cups_lang_t	*language;		/* Default language */
   char		**temp;			/* Temporary pointer */
   _cups_globals_t *cg = _cupsGlobals();	/* Pointer to library globals */
 
@@ -931,7 +989,20 @@ cupsGetPrinters(char ***printers)	/* O -
   *    requested-attributes
   */
 
-  request = ippNewRequest(CUPS_GET_PRINTERS);
+  request = ippNew();
+
+  request->request.op.operation_id = CUPS_GET_PRINTERS;
+  request->request.op.request_id   = 1;
+
+  language = cupsLangDefault();
+
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
+               "attributes-charset", NULL, cupsLangEncoding(language));
+
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
+               "attributes-natural-language", NULL, language->language);
+
+  cupsLangFree(language);
 
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
                "requested-attributes", NULL, "printer-name");
@@ -1199,6 +1270,7 @@ cupsPrintFiles2(http_t        *http,	/* 
   ipp_t		*response;		/* IPP response */
   ipp_attribute_t *attr;		/* IPP job-id attribute */
   char		uri[HTTP_MAX_URI];	/* Printer URI */
+  cups_lang_t	*language;		/* Language to use */
   int		jobid;			/* New job ID */
   const char	*base;			/* Basename of current filename */
 
@@ -1231,18 +1303,34 @@ cupsPrintFiles2(http_t        *http,	/* 
   }
 
  /*
+  * Setup the request data...
+  */
+
+  language = cupsLangDefault();
+
+ /*
   * Build a standard CUPS URI for the printer and fill the standard IPP
   * attributes...
   */
 
-  if ((request = ippNewRequest(num_files == 1 ? IPP_PRINT_JOB :
-                                                IPP_CREATE_JOB)) == NULL)
+  if ((request = ippNew()) == NULL)
   {
     _cupsSetError(IPP_INTERNAL_ERROR, NULL);
 
     return (0);
   }
 
+  request->request.op.operation_id = num_files == 1 ? IPP_PRINT_JOB :
+                                                      IPP_CREATE_JOB;
+  request->request.op.request_id   = 1;
+
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
+               "attributes-charset", NULL, cupsLangEncoding(language));
+
+  ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
+               "attributes-natural-language", NULL,
+               language != NULL ? language->language : "C");
+
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
                NULL, uri);
 
[...6214 lines suppressed...]
+83 2510             
+84 2514             
+85 2518             
+86 251C             
+87 2524             
+88 252C             
+89 2534             
+8A 253C             
+8B 2580             
+8C 2584             
+8D 2588             
+8E 258C             
+8F 2590             
+90 2591             
+91 2592             
+92 2593             
+93 2320             
+94 25A0             
+95 2219             
+96 221A             
+97 2248             
+98 2264             
+99 2265             
+9A 00A0             
+9B 2321             
+9C 00B0             
+9D 00B2             
+9E 00B7             
+9F 00F7             
+A0 2550             
+A1 2551             
+A2 2552             
+A3 0451             
+A4 0454             
+A5 2554             
+A6 0456             
+A7 0457             
+A8 2557             
+A9 2558             
+AA 2559             
+AB 255A             
+AC 255B             
+AD 0491             
+AE 255D             
+AF 255E             
+B0 255F             
+B1 2560             
+B2 2561             
+B3 0401             
+B4 0404             
+B5 2563             
+B6 0406             
+B7 0407             
+B8 2566             
+B9 2567             
+BA 2568             
+BB 2569             
+BC 256A             
+BD 0490             
+BE 256C             
+BF 00A9             
+C0 044E             
+C1 0430             
+C2 0431             
+C3 0446             
+C4 0434             
+C5 0435             
+C6 0444             
+C7 0433             
+C8 0445             
+C9 0438             
+CA 0439             
+CB 043A             
+CC 043B             
+CD 043C             
+CE 043D             
+CF 043E             
+D0 043F             
+D1 044F             
+D2 0440             
+D3 0441             
+D4 0442             
+D5 0443             
+D6 0436             
+D7 0432             
+D8 044C             
+D9 044B             
+DA 0437             
+DB 0448             
+DC 044D             
+DD 0449             
+DE 0447             
+DF 044A             
+E0 042E             
+E1 0410             
+E2 0411             
+E3 0426             
+E4 0414             
+E5 0415             
+E6 0424             
+E7 0413             
+E8 0425             
+E9 0418             
+EA 0419             
+EB 041A             
+EC 041B             
+ED 041C             
+EE 041D             
+EF 041E             
+F0 041F             
+F1 042F             
+F2 0420             
+F3 0421             
+F4 0422             
+F5 0423             
+F6 0416             
+F7 0412             
+F8 042C             
+F9 042B             
+FA 0417             
+FB 0428             
+FC 042D             
+FD 0429             
+FE 0427             
+FF 042A             
diff -up cups-1.3.4/packaging/cups.list.in.undo-str2537 cups-1.3.4/packaging/cups.list.in
--- cups-1.3.4/packaging/cups.list.in.undo-str2537	2007-10-10 23:00:43.000000000 +0100
+++ cups-1.3.4/packaging/cups.list.in	2007-11-12 18:44:01.000000000 +0000
@@ -432,6 +432,29 @@ d 0755 root sys $DATADIR/charmaps -
 f 0644 root sys $DATADIR/charmaps data/*.txt
 
 d 0755 root sys $DATADIR/charsets -
+f 0644 root sys $DATADIR/charsets/windows-874 data/windows-874
+f 0644 root sys $DATADIR/charsets/windows-1250 data/windows-1250
+f 0644 root sys $DATADIR/charsets/windows-1251 data/windows-1251
+f 0644 root sys $DATADIR/charsets/windows-1252 data/windows-1252
+f 0644 root sys $DATADIR/charsets/windows-1253 data/windows-1253
+f 0644 root sys $DATADIR/charsets/windows-1254 data/windows-1254
+f 0644 root sys $DATADIR/charsets/windows-1255 data/windows-1255
+f 0644 root sys $DATADIR/charsets/windows-1256 data/windows-1256
+f 0644 root sys $DATADIR/charsets/windows-1257 data/windows-1257
+f 0644 root sys $DATADIR/charsets/windows-1258 data/windows-1258
+f 0644 root sys $DATADIR/charsets/iso-8859-1 data/iso-8859-1
+f 0644 root sys $DATADIR/charsets/iso-8859-2 data/iso-8859-2
+f 0644 root sys $DATADIR/charsets/iso-8859-3 data/iso-8859-3
+f 0644 root sys $DATADIR/charsets/iso-8859-4 data/iso-8859-4
+f 0644 root sys $DATADIR/charsets/iso-8859-5 data/iso-8859-5
+f 0644 root sys $DATADIR/charsets/iso-8859-6 data/iso-8859-6
+f 0644 root sys $DATADIR/charsets/iso-8859-7 data/iso-8859-7
+f 0644 root sys $DATADIR/charsets/iso-8859-8 data/iso-8859-8
+f 0644 root sys $DATADIR/charsets/iso-8859-9 data/iso-8859-9
+f 0644 root sys $DATADIR/charsets/iso-8859-10 data/iso-8859-10
+f 0644 root sys $DATADIR/charsets/iso-8859-13 data/iso-8859-13
+f 0644 root sys $DATADIR/charsets/iso-8859-14 data/iso-8859-14
+f 0644 root sys $DATADIR/charsets/iso-8859-15 data/iso-8859-15
 f 0644 root sys $DATADIR/charsets/utf-8 data/utf-8
 
 d 0755 root sys $DATADIR/data -
diff -up cups-1.3.4/scheduler/ipp.c.undo-str2537 cups-1.3.4/scheduler/ipp.c
--- cups-1.3.4/scheduler/ipp.c.undo-str2537	2007-11-12 18:41:10.000000000 +0000
+++ cups-1.3.4/scheduler/ipp.c	2007-11-12 18:44:01.000000000 +0000
@@ -375,31 +375,13 @@ cupsdProcessIPPRequest(
 	ippAddString(con->response, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
                      "attributes-natural-language", NULL, DefaultLanguage);
 
-      if (charset &&
-          strcasecmp(charset->values[0].string.text, "us-ascii") &&
-          strcasecmp(charset->values[0].string.text, "utf-8"))
-      {
-       /*
-        * Bad character set...
-	*/
-
-        cupsdLogMessage(CUPSD_LOG_ERROR, "Unsupported character set \"%s\"!",
-	                charset->values[0].string.text);
-	cupsdAddEvent(CUPSD_EVENT_SERVER_AUDIT, NULL, NULL,
-		      "%04X %s Unsupported attributes-charset value \"%s\"",
-		      IPP_CHARSET, con->http.hostname,
-		      charset->values[0].string.text);
-	send_ipp_status(con, IPP_BAD_REQUEST,
-	                _("Unsupported character set \"%s\"!"),
-	                charset->values[0].string.text);
-      }
-      else if (!charset || !language ||
-	       (!uri &&
-	        con->request->request.op.operation_id != CUPS_GET_DEFAULT &&
-	        con->request->request.op.operation_id != CUPS_GET_PRINTERS &&
-	        con->request->request.op.operation_id != CUPS_GET_CLASSES &&
-	        con->request->request.op.operation_id != CUPS_GET_DEVICES &&
-	        con->request->request.op.operation_id != CUPS_GET_PPDS))
+      if (!charset || !language ||
+	  (!uri &&
+	   con->request->request.op.operation_id != CUPS_GET_DEFAULT &&
+	   con->request->request.op.operation_id != CUPS_GET_PRINTERS &&
+	   con->request->request.op.operation_id != CUPS_GET_CLASSES &&
+	   con->request->request.op.operation_id != CUPS_GET_DEVICES &&
+	   con->request->request.op.operation_id != CUPS_GET_PPDS))
       {
        /*
 	* Return an error, since attributes-charset,


Index: cups.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cups/F-8/cups.spec,v
retrieving revision 1.371
retrieving revision 1.372
diff -u -r1.371 -r1.372
--- cups.spec	12 Nov 2007 18:41:33 -0000	1.371
+++ cups.spec	12 Nov 2007 18:46:44 -0000	1.372
@@ -38,6 +38,7 @@
 Patch12: cups-wbuffer.patch
 Patch13: cups-direct-usb.patch
 Patch14: cups-lpr-help.patch
+Patch15: cups-undo-str2537.patch
 Patch16: cups-pid.patch
 Patch17: cups-foomatic-recommended.patch
 Patch19: cups-eggcups.patch
@@ -150,6 +151,7 @@
 %patch12 -p1 -b .wbuffer
 %patch13 -p1 -b .direct-usb
 %patch14 -p1 -b .lpr-help
+%patch15 -p1 -b .undo-str2537
 %patch16 -p1 -b .pid
 %patch17 -p1 -b .foomatic-recommended
 %patch19 -p1 -b .eggcups
@@ -450,6 +452,8 @@
 
 %changelog
 * Mon Nov 12 2007 Tim Waugh <twaugh at redhat.com>
+- Temporarily undo STR #2537 change so that non-UTF-8 requests are not
+  rejected (bug #378211).
 - LSPP cupsdSetString/ClearString fixes (bug #378451).
 
 * Wed Nov  7 2007 Tim Waugh <twaugh at redhat.com> 1:1.3.4-2




More information about the fedora-extras-commits mailing list