packages: cups/cups.spec, cups/ipp-revert-1.4.patch (NEW)=?UTF-8?Q?=20?=- rel 2 - revert ...
baggins
baggins at pld-linux.org
Mon Feb 6 19:39:46 CET 2012
Author: baggins Date: Mon Feb 6 18:39:46 2012 GMT
Module: packages Tag: HEAD
---- Log message:
- rel 2
- revert ipp backend to the state of 1.4, gory details here:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=638521
---- Files affected:
packages/cups:
cups.spec (1.323 -> 1.324) , ipp-revert-1.4.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/cups/cups.spec
diff -u packages/cups/cups.spec:1.323 packages/cups/cups.spec:1.324
--- packages/cups/cups.spec:1.323 Sun Feb 5 21:51:20 2012
+++ packages/cups/cups.spec Mon Feb 6 19:39:41 2012
@@ -18,7 +18,7 @@
Summary(pt_BR.UTF-8): Sistema Unix de Impressão
Name: cups
Version: 1.5.2
-Release: 1
+Release: 2
Epoch: 1
License: LGPL v2 (libraries), GPL v2 (the rest) + openssl exception
Group: Applications/Printing
@@ -45,6 +45,8 @@
Patch11: %{name}-usb.patch
Patch12: %{name}-desktop.patch
Patch13: %{name}-systemd-socket.patch
+# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=638521
+Patch14: ipp-revert-1.4.patch
# avahi patches from fedora
Patch100: %{name}-avahi-1-config.patch
Patch101: %{name}-avahi-2-backend.patch
@@ -324,6 +326,7 @@
#%patch11 -p1
%patch12 -p1
%patch13 -p1
+%patch14 -p1
%if %{with avahi}
%patch100 -p1
@@ -778,6 +781,11 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.324 2012/02/06 18:39:41 baggins
+- rel 2
+- revert ipp backend to the state of 1.4, gory details here:
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=638521
+
Revision 1.323 2012/02/05 20:51:20 baggins
- rel 1
- it can't be any worse than 1.5.0 ;)
================================================================
Index: packages/cups/ipp-revert-1.4.patch
diff -u /dev/null packages/cups/ipp-revert-1.4.patch:1.1
--- /dev/null Mon Feb 6 19:39:46 2012
+++ packages/cups/ipp-revert-1.4.patch Mon Feb 6 19:39:41 2012
@@ -0,0 +1,3229 @@
+Index: branch-1.5/backend/ipp.c
+===================================================================
+--- branch-1.5/backend/ipp.c (.../branch-1.5/backend/ipp.c) (revision 10232)
++++ branch-1.4/backend/ipp.c (.../branch-1.4/backend/ipp.c) (revision 10232)
+@@ -1,9 +1,9 @@
+ /*
+ * "$Id$"
+ *
+- * IPP backend for CUPS.
++ * IPP backend for the Common UNIX Printing System (CUPS).
+ *
+- * Copyright 2007-2011 by Apple Inc.
++ * Copyright 2007-2010 by Apple Inc.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
+ *
+ * These coded instructions, statements, and computer programs are the
+@@ -18,16 +18,14 @@
+ *
+ * main() - Send a file to the printer or server.
+ * cancel_job() - Cancel a print job.
+- * check_printer_state() - Check the printer state.
+- * compress_files() - Compress print files.
+- * monitor_printer() - Monitor the printer state.
+- * new_request() - Create a new print creation or validation request.
++ * check_printer_state() - Check the printer state...
++ * compress_files() - Compress print files...
+ * password_cb() - Disable the password prompt for
+ * cupsDoFileRequest().
+ * report_attr() - Report an IPP attribute value.
+ * report_printer_state() - Report the printer state.
+- * run_as_user() - Run the IPP backend as the printing user.
+- * timeout_cb() - Handle HTTP timeouts.
++ * run_pictwps_filter() - Convert PICT files to PostScript when printing
++ * remotely.
+ * sigterm_handler() - Handle 'terminate' signals that stop the backend.
+ */
+
+@@ -35,138 +33,49 @@
+ * Include necessary headers.
+ */
+
++#include <cups/http-private.h>
+ #include "backend-private.h"
+-#include <cups/array-private.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/wait.h>
+-#if defined(HAVE_GSSAPI) && defined(HAVE_XPC)
+-# include <xpc/xpc.h>
+-# define kPMPrintUIToolAgent "com.apple.printuitool.agent"
+-# define kPMStartJob 100
+-# define kPMWaitForJob 101
+-extern void xpc_connection_set_target_uid(xpc_connection_t connection,
+- uid_t uid);
+-#endif /* HAVE_GSSAPI && HAVE_XPC */
+
+-
+ /*
+- * Types...
+- */
+-
+-typedef struct _cups_monitor_s /**** Monitoring data ****/
+-{
+- const char *uri, /* Printer URI */
+- *hostname, /* Hostname */
+- *user, /* Username */
+- *resource; /* Resource path */
+- int port, /* Port number */
+- version, /* IPP version */
+- job_id; /* Job ID for submitted job */
+- http_encryption_t encryption; /* Use encryption? */
+- ipp_jstate_t job_state; /* Current job state */
+- ipp_pstate_t printer_state; /* Current printer state */
+-} _cups_monitor_t;
+-
+-
+-/*
+ * Globals...
+ */
+
+-static const char *auth_info_required;
++static char *password = NULL; /* Password for device URI */
++static int password_tries = 0; /* Password tries */
++static const char *auth_info_required = "none";
+ /* New auth-info-required value */
+-#if defined(HAVE_GSSAPI) && defined(HAVE_XPC)
+-static int child_pid = 0; /* Child process ID */
+-#endif /* HAVE_GSSAPI && HAVE_XPC */
+-static const char * const jattrs[] = /* Job attributes we want */
+-{
+- "job-impressions-completed",
+- "job-media-sheets-completed",
+- "job-state",
+- "job-state-reasons"
+-};
+-static int job_canceled = 0;
+- /* Job cancelled? */
+-static char *password = NULL;
+- /* Password for device URI */
+-static int password_tries = 0;
+- /* Password tries */
+-static const char * const pattrs[] = /* Printer attributes we want */
+-{
+- "copies-supported",
+- "cups-version",
+- "document-format-supported",
+- "marker-colors",
+- "marker-high-levels",
+- "marker-levels",
+- "marker-low-levels",
+- "marker-message",
+- "marker-names",
+- "marker-types",
+- "media-col-supported",
+- "multiple-document-handling-supported",
+- "operations-supported",
+- "printer-alert",
+- "printer-alert-description",
+- "printer-is-accepting-jobs",
+- "printer-state",
+- "printer-state-message",
+- "printer-state-reasons"
+-};
+-static const char * const remote_job_states[] =
+-{ /* Remote job state keywords */
+- "+cups-remote-pending",
+- "+cups-remote-pending-held",
+- "+cups-remote-processing",
+- "+cups-remote-stopped",
+- "+cups-remote-canceled",
+- "+cups-remote-aborted",
+- "+cups-remote-completed"
+-};
+-static _cups_mutex_t report_mutex = _CUPS_MUTEX_INITIALIZER;
+- /* Mutex to control access */
+-static int num_attr_cache = 0;
+- /* Number of cached attributes */
+-static cups_option_t *attr_cache = NULL;
+- /* Cached attributes */
+-static cups_array_t *state_reasons; /* Array of printe-state-reasons keywords */
+-static char tmpfilename[1024] = "";
+- /* Temporary spool file name */
++#ifdef __APPLE__
++static char pstmpname[1024] = ""; /* Temporary PostScript file name */
++#endif /* __APPLE__ */
++static char tmpfilename[1024] = ""; /* Temporary spool file name */
++static int job_cancelled = 0; /* Job cancelled? */
+
+
+ /*
+ * Local functions...
+ */
+
+-static void cancel_job(http_t *http, const char *uri, int id,
+- const char *resource, const char *user,
+- int version);
+-static ipp_pstate_t check_printer_state(http_t *http, const char *uri,
+- const char *resource,
+- const char *user, int version);
++static void cancel_job(http_t *http, const char *uri, int id,
++ const char *resource, const char *user, int version);
++static void check_printer_state(http_t *http, const char *uri,
++ const char *resource, const char *user,
++ int version, int job_id);
+ #ifdef HAVE_LIBZ
+-static void compress_files(int num_files, char **files);
++static void compress_files(int num_files, char **files);
+ #endif /* HAVE_LIBZ */
+-static void *monitor_printer(_cups_monitor_t *monitor);
+-static ipp_t *new_request(ipp_op_t op, int version, const char *uri,
+- const char *user, const char *title,
+- int num_options, cups_option_t *options,
+- const char *compression, int copies,
+- const char *format, _ppd_cache_t *pc,
+- ipp_attribute_t *media_col_sup,
+- ipp_attribute_t *doc_handling_sup);
+-static const char *password_cb(const char *);
+-static void report_attr(ipp_attribute_t *attr);
+-static void report_printer_state(ipp_t *ipp);
+-#if defined(HAVE_GSSAPI) && defined(HAVE_XPC)
+-static int run_as_user(int argc, char *argv[], uid_t uid,
+- const char *device_uri, int fd);
+-#endif /* HAVE_GSSAPI && HAVE_XPC */
+-static void sigterm_handler(int sig);
+-static int timeout_cb(http_t *http, void *user_data);
+-static void update_reasons(ipp_attribute_t *attr, const char *s);
++static const char *password_cb(const char *);
++static void report_attr(ipp_attribute_t *attr);
++static int report_printer_state(ipp_t *ipp, int job_id);
+
++#ifdef __APPLE__
++static int run_pictwps_filter(char **argv, const char *filename);
++#endif /* __APPLE__ */
++static void sigterm_handler(int sig);
+
++
+ /*
+ * 'main()' - Send a file to the printer or server.
+ *
+@@ -193,60 +102,65 @@
+ *name, /* Name of option */
+ *value, /* Value of option */
+ sep; /* Separator character */
+- http_addrlist_t *addrlist; /* Address of printer */
+ int snmp_fd, /* SNMP socket */
+ start_count, /* Page count via SNMP at start */
+ page_count, /* Page count via SNMP */
+ have_supplies; /* Printer supports supply levels? */
+ int num_files; /* Number of files to print */
+ char **files, /* Files to print */
+- *compatfile = NULL; /* Compatibility filename */
+- off_t compatsize = 0; /* Size of compatibility file */
++ *filename; /* Pointer to single filename */
+ int port; /* Port number (not used) */
+- char portname[255]; /* Port name */
+ char uri[HTTP_MAX_URI]; /* Updated URI without user/pass */
+- http_status_t http_status; /* Status of HTTP request */
+ ipp_status_t ipp_status; /* Status of IPP request */
+ http_t *http; /* HTTP connection */
+ ipp_t *request, /* IPP request */
+ *response, /* IPP response */
+ *supported; /* get-printer-attributes response */
+ time_t start_time; /* Time of first connect */
++ int recoverable; /* Recoverable error shown? */
+ int contimeout; /* Connection timeout */
+- int delay, /* Delay for retries */
+- prev_delay; /* Previous delay */
+- const char *compression; /* Compression mode */
+- int waitjob, /* Wait for job complete? */
++ int delay; /* Delay for retries... */
++ int compression, /* Do compression of the job data? */
++ waitjob, /* Wait for job complete? */
+ waitprinter; /* Wait for printer ready? */
+- _cups_monitor_t monitor; /* Monitoring data */
+ ipp_attribute_t *job_id_attr; /* job-id attribute */
+ int job_id; /* job-id value */
+ ipp_attribute_t *job_sheets; /* job-media-sheets-completed */
+ ipp_attribute_t *job_state; /* job-state */
+ ipp_attribute_t *copies_sup; /* copies-supported */
+- ipp_attribute_t *cups_version; /* cups-version */
+ ipp_attribute_t *format_sup; /* document-format-supported */
+- ipp_attribute_t *media_col_sup; /* media-col-supported */
+- ipp_attribute_t *operations_sup; /* operations-supported */
+- ipp_attribute_t *doc_handling_sup; /* multiple-document-handling-supported */
+ ipp_attribute_t *printer_state; /* printer-state attribute */
+ ipp_attribute_t *printer_accepting; /* printer-is-accepting-jobs */
+- int validate_job; /* Does printer support Validate-Job? */
+ int copies, /* Number of copies for job */
+ copies_remaining; /* Number of copies remaining */
+ const char *content_type, /* CONTENT_TYPE environment variable */
+- *final_content_type, /* FINAL_CONTENT_TYPE environment var */
+- *document_format; /* document-format value */
+- int fd; /* File descriptor */
+- off_t bytes = 0; /* Bytes copied */
+- char buffer[16384]; /* Copy buffer */
++ *final_content_type; /* FINAL_CONTENT_TYPE environment var */
+ #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
+ struct sigaction action; /* Actions for POSIX signals */
+ #endif /* HAVE_SIGACTION && !HAVE_SIGSET */
+ int version; /* IPP version */
+- ppd_file_t *ppd; /* PPD file */
+- _ppd_cache_t *pc; /* PPD cache and mapping data */
+- fd_set input; /* Input set for select() */
++ static const char * const pattrs[] =
++ { /* Printer attributes we want */
++ "com.apple.print.recoverable-message",
++ "copies-supported",
++ "document-format-supported",
++ "marker-colors",
++ "marker-high-levels",
++ "marker-levels",
++ "marker-low-levels",
++ "marker-message",
++ "marker-names",
++ "marker-types",
++ "printer-is-accepting-jobs",
++ "printer-state",
++ "printer-state-message",
++ "printer-state-reasons",
++ };
++ static const char * const jattrs[] =
++ { /* Job attributes we want */
++ "job-media-sheets-completed",
++ "job-state"
++ };
+
+
+ /*
+@@ -297,75 +211,12 @@
+ else if (argc < 6)
+ {
+ _cupsLangPrintf(stderr,
+- _("Usage: %s job-id user title copies options [file]"),
++ _("Usage: %s job-id user title copies options [file]\n"),
+ argv[0]);
+ return (CUPS_BACKEND_STOP);
+ }
+
+ /*
+- * Get the device URI...
+- */
+-
+- while ((device_uri = cupsBackendDeviceURI(argv)) == NULL)
+- {
+- _cupsLangPrintFilter(stderr, "INFO", _("Unable to locate printer."));
+- sleep(10);
+-
+- if (getenv("CLASS") != NULL)
+- return (CUPS_BACKEND_FAILED);
+- }
+-
+- if ((auth_info_required = getenv("AUTH_INFO_REQUIRED")) == NULL)
+- auth_info_required = "none";
+-
+- state_reasons = _cupsArrayNewStrings(getenv("PRINTER_STATE_REASONS"));
+-
+-#ifdef HAVE_GSSAPI
+- /*
+- * For Kerberos, become the printing user (if we can) to get the credentials
+- * that way.
+- */
+-
+- if (!getuid() && (value = getenv("AUTH_UID")) != NULL)
+- {
+- uid_t uid = (uid_t)atoi(value);
+- /* User ID */
+-
+-# ifdef HAVE_XPC
+- if (uid > 0)
+- {
+- if (argc == 6)
+- return (run_as_user(argc, argv, uid, device_uri, 0));
+- else
+- {
+- int status = 0; /* Exit status */
+-
+- for (i = 6; i < argc && !status && !job_canceled; i ++)
+- {
+- if ((fd = open(argv[i], O_RDONLY)) >= 0)
+- {
+- status = run_as_user(argc, argv, uid, device_uri, fd);
+- close(fd);
+- }
+- else
+- {
+- _cupsLangPrintError("ERROR", _("Unable to open print file"));
+- status = CUPS_BACKEND_FAILED;
+- }
+- }
+-
+- return (status);
+- }
+- }
+-
+-# else /* No XPC, just try to run as the user ID */
+- if (uid > 0)
+- seteuid(uid);
+-# endif /* HAVE_XPC */
+- }
+-#endif /* HAVE_GSSAPI */
+-
+- /*
+ * Get the (final) content type...
+ */
+
+@@ -384,6 +235,9 @@
+ * Extract the hostname and printer name from the URI...
+ */
+
++ if ((device_uri = cupsBackendDeviceURI(argv)) == NULL)
++ return (CUPS_BACKEND_FAILED);
++
+ httpSeparateURI(HTTP_URI_CODING_ALL, device_uri, scheme, sizeof(scheme),
+ username, sizeof(username), hostname, sizeof(hostname), &port,
+ resource, sizeof(resource));
+@@ -400,8 +254,8 @@
+ * See if there are any options...
+ */
+
+- compression = NULL;
+- version = 20;
++ compression = 0;
++ version = 11;
+ waitjob = 1;
+ waitprinter = 1;
+ contimeout = 7 * 24 * 60 * 60;
+@@ -454,48 +308,48 @@
+ * Process the option...
+ */
+
+- if (!_cups_strcasecmp(name, "waitjob"))
++ if (!strcasecmp(name, "waitjob"))
+ {
+ /*
+ * Wait for job completion?
+ */
+
+- waitjob = !_cups_strcasecmp(value, "on") ||
+- !_cups_strcasecmp(value, "yes") ||
+- !_cups_strcasecmp(value, "true");
++ waitjob = !strcasecmp(value, "on") ||
++ !strcasecmp(value, "yes") ||
++ !strcasecmp(value, "true");
+ }
+- else if (!_cups_strcasecmp(name, "waitprinter"))
++ else if (!strcasecmp(name, "waitprinter"))
+ {
+ /*
+ * Wait for printer idle?
+ */
+
+- waitprinter = !_cups_strcasecmp(value, "on") ||
+- !_cups_strcasecmp(value, "yes") ||
+- !_cups_strcasecmp(value, "true");
++ waitprinter = !strcasecmp(value, "on") ||
++ !strcasecmp(value, "yes") ||
++ !strcasecmp(value, "true");
+ }
+- else if (!_cups_strcasecmp(name, "encryption"))
++ else if (!strcasecmp(name, "encryption"))
+ {
+ /*
+ * Enable/disable encryption?
+ */
+
+- if (!_cups_strcasecmp(value, "always"))
++ if (!strcasecmp(value, "always"))
+ cupsSetEncryption(HTTP_ENCRYPT_ALWAYS);
+- else if (!_cups_strcasecmp(value, "required"))
++ else if (!strcasecmp(value, "required"))
+ cupsSetEncryption(HTTP_ENCRYPT_REQUIRED);
+- else if (!_cups_strcasecmp(value, "never"))
++ else if (!strcasecmp(value, "never"))
+ cupsSetEncryption(HTTP_ENCRYPT_NEVER);
+- else if (!_cups_strcasecmp(value, "ifrequested"))
++ else if (!strcasecmp(value, "ifrequested"))
+ cupsSetEncryption(HTTP_ENCRYPT_IF_REQUESTED);
+ else
+ {
+- _cupsLangPrintFilter(stderr, "ERROR",
+- _("Unknown encryption option value: \"%s\"."),
+- value);
++ _cupsLangPrintf(stderr,
++ _("ERROR: Unknown encryption option value \"%s\"!\n"),
++ value);
+ }
+ }
+- else if (!_cups_strcasecmp(name, "version"))
++ else if (!strcasecmp(name, "version"))
+ {
+ if (!strcmp(value, "1.0"))
+ version = 10;
+@@ -505,24 +359,23 @@
+ version = 20;
+ else if (!strcmp(value, "2.1"))
+ version = 21;
+- else if (!strcmp(value, "2.2"))
+- version = 22;
+ else
+ {
+- _cupsLangPrintFilter(stderr, "ERROR",
+- _("Unknown version option value: \"%s\"."),
+- value);
++ _cupsLangPrintf(stderr,
++ _("ERROR: Unknown version option value \"%s\"!\n"),
++ value);
+ }
+ }
+ #ifdef HAVE_LIBZ
+- else if (!_cups_strcasecmp(name, "compression"))
++ else if (!strcasecmp(name, "compression"))
+ {
+- if (!_cups_strcasecmp(value, "true") || !_cups_strcasecmp(value, "yes") ||
+- !_cups_strcasecmp(value, "on") || !_cups_strcasecmp(value, "gzip"))
+- compression = "gzip";
++ compression = !strcasecmp(value, "true") ||
++ !strcasecmp(value, "yes") ||
++ !strcasecmp(value, "on") ||
++ !strcasecmp(value, "gzip");
+ }
+ #endif /* HAVE_LIBZ */
+- else if (!_cups_strcasecmp(name, "contimeout"))
++ else if (!strcasecmp(name, "contimeout"))
+ {
+ /*
+ * Set the connection timeout...
+@@ -537,9 +390,9 @@
+ * Unknown option...
+ */
+
+- _cupsLangPrintFilter(stderr, "ERROR",
+- _("Unknown option \"%s\" with value \"%s\"."),
+- name, value);
++ _cupsLangPrintf(stderr,
++ _("ERROR: Unknown option \"%s\" with value \"%s\"!\n"),
++ name, value);
+ }
+ }
+ }
+@@ -552,13 +405,64 @@
+
+ if (argc == 6)
+ {
+- num_files = 0;
+- files = NULL;
+- send_options = !_cups_strcasecmp(final_content_type, "application/pdf") ||
+- !_cups_strcasecmp(final_content_type, "application/vnd.cups-pdf") ||
+- !_cups_strncasecmp(final_content_type, "image/", 6);
++ /*
++ * Copy stdin to a temporary file...
++ */
+
+- fputs("DEBUG: Sending stdin for job...\n", stderr);
++ int fd; /* File descriptor */
++ http_addrlist_t *addrlist; /* Address list */
++ off_t tbytes; /* Total bytes copied */
++
++
++ fputs("STATE: +connecting-to-device\n", stderr);
++ fprintf(stderr, "DEBUG: Looking up \"%s\"...\n", hostname);
++
++ if ((addrlist = httpAddrGetList(hostname, AF_UNSPEC, "1")) == NULL)
++ {
++ _cupsLangPrintf(stderr, _("ERROR: Unable to locate printer \'%s\'!\n"),
++ hostname);
++ return (CUPS_BACKEND_STOP);
++ }
++
++ snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family);
++
++ if ((fd = cupsTempFd(tmpfilename, sizeof(tmpfilename))) < 0)
++ {
++ _cupsLangPrintError(_("ERROR: Unable to create temporary file"));
++ return (CUPS_BACKEND_FAILED);
++ }
++
++ _cupsLangPuts(stderr, _("INFO: Copying print data...\n"));
++
++ tbytes = backendRunLoop(-1, fd, snmp_fd, &(addrlist->addr), 0, 0,
++ backendNetworkSideCB);
++
++ if (snmp_fd >= 0)
++ _cupsSNMPClose(snmp_fd);
++
++ httpAddrFreeList(addrlist);
++
++ close(fd);
++
<<Diff was trimmed, longer than 597 lines>>
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/cups/cups.spec?r1=1.323&r2=1.324&f=u
More information about the pld-cvs-commit
mailing list