Public bug reported:

Binary package hint: cupsys

In cupsys-1.2.2-0ubuntu0.6.06, when running cups-lpd to provide lpd
printing emulation via cups, at least two aspects of cups lpd emulation
work incorrectly:

1: When using lpq on a remote machine to query a cups printer, the following is 
reported, regardless of the status of the printer:
"lw is not ready" (where "lw" is the name of the printer).

2: When a print job is reported in /var/log/cups/page_log, the portion of the 
log entry that is supposed to show the IP address or hostname of the remote 
machine shows instead
an ascii 001, i.e. instead of:

lw jdd 2515 [31/Aug/2007:10:55:52 -0400] 1 1 - 128.100.5.251
it shows:
lw jdd 2515 [31/Aug/2007:10:55:52 -0400] 1 1 - ^A

(where ^A is control-A, i.e. ascii character 001)

There is a straightforward source patch: simply replace
cupsys-1.2.2/scheduler/cups-lpd.c with the equivalent from cups 1.2.12,
and both problems are eliminated.

I've appended a patch below.

Regards,

John
--
John DiMarco <[EMAIL PROTECTED]>                      Office: SF3302B
IT Director                                            Phone: 416-978-5300
Department of Computer Science, University of Toronto  Fax:   416-946-5464
http://www.cs.toronto.edu/~jdd
*** cups-lpd.c  2007/08/31 19:20:20     1.1
--- cups-lpd.c  2007/08/31 19:20:56

***************
*** 96,102 ****
                            int destsize, cups_option_t **options,
                            int *accepting, int *shared, ipp_pstate_t *state);
  static int    print_file(http_t *http, int id, const char *filename,
!                          const char *docname, const char *user, int last);
  static int    recv_print_job(const char *name, int num_defaults,
                               cups_option_t *defaults);
  static int    remove_jobs(const char *name, const char *agent,
--- 96,103 ----
                            int destsize, cups_option_t **options,
                            int *accepting, int *shared, ipp_pstate_t *state);
  static int    print_file(http_t *http, int id, const char *filename,
!                          const char *docname, const char *user,
!                          const char *format, int last);
  static int    recv_print_job(const char *name, int num_defaults,
                               cups_option_t *defaults);
  static int    remove_jobs(const char *name, const char *agent,
***************
*** 150,157 ****
    num_defaults = 0;
    defaults     = NULL;
    hostlookups  = 1;
-   num_defaults = cupsAddOption("job-originating-host-name", hostname,
-                                num_defaults, &defaults);
  
    for (i = 1; i < argc; i ++)
      if (argv[i][0] == '-')
--- 151,156 ----
***************
*** 217,222 ****
--- 216,224 ----
             hostip);
    }
  
+   num_defaults = cupsAddOption("job-originating-host-name", hostname,
+                                num_defaults, &defaults);
+ 
   /*
    * RFC1179 specifies that only 1 daemon command can be received for
    * every connection.
***************
*** 471,477 ****
  
      request = ippNewRequest(CUPS_GET_PRINTERS);
  
!     ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
                    "requested-attributes",
                  (int)(sizeof(requested) / sizeof(requested[0])),
                    NULL, requested);
--- 473,479 ----
  
      request = ippNewRequest(CUPS_GET_PRINTERS);
  
!     ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
                    "requested-attributes",
                  (int)(sizeof(requested) / sizeof(requested[0])),
                    NULL, requested);
***************
*** 597,603 ****
      ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
                 NULL, uri);
  
!     ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
                    "requested-attributes",
                  (int)(sizeof(requested) / sizeof(requested[0])),
                    NULL, requested);
--- 599,605 ----
      ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri",
                 NULL, uri);
  
!     ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD,
                    "requested-attributes",
                  (int)(sizeof(requested) / sizeof(requested[0])),
                    NULL, requested);
***************
*** 648,654 ****
      if (state)
      {
        if ((attr = ippFindAttribute(response, "printer-state",
!                                  IPP_TAG_INTEGER)) == NULL)
        syslog(LOG_ERR, "No printer-state attribute found in "
                        "response from server!");
        else
--- 650,656 ----
      if (state)
      {
        if ((attr = ippFindAttribute(response, "printer-state",
!                                  IPP_TAG_ENUM)) == NULL)
        syslog(LOG_ERR, "No printer-state attribute found in "
                        "response from server!");
        else
***************
*** 823,828 ****
--- 825,831 ----
           const char *filename,        /* I - File to print */
             const char *docname,               /* I - document-name */
           const char *user,            /* I - requesting-user-name */
+          const char *format,          /* I - document-format */
           int        last)             /* I - 1 = last file in job */
  {
    ipp_t               *request;               /* IPP request */
***************
*** 845,850 ****
--- 848,857 ----
      ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
                 "document-name", NULL, docname);
  
+   if (format)
+     ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_MIMETYPE,
+                  "document-format", NULL, format);
+ 
    if (last)
      ippAddBoolean(request, IPP_TAG_OPERATION, "last-document", 1);
  
***************
*** 1277,1282 ****
--- 1284,1291 ----
                docnumber ++;
  
                if (print_file(http, id, temp[i], docname, user,
+                              cupsGetOption("document-format", num_options,
+                                            options),
                               docnumber == doccount))
                    status = 1;
                else
***************
*** 1387,1393 ****
        return (1);
      }
      else
!       syslog(LOG_INFO, "Job ID %d cancelled", id);
    }
  
    httpClose(http);
--- 1396,1402 ----
        return (1);
      }
      else
!       syslog(LOG_INFO, "Job ID %d canceled", id);
    }
  
    httpClose(http);

** Affects: cupsys (Ubuntu)
     Importance: Undecided
         Status: New

-- 
cups lpd emulation: lpq, log flaws
https://bugs.launchpad.net/bugs/136454
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to