[cups.bugs] [MOD] STR #3508: Lprm broken

Vaclav Michalek amdg at e-mail.cz
Fri Feb 19 10:06:19 PST 2010


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

lprm utility cannot remove individual jobs, 
lprm <jobnum> ends with error "The printer or class was not found" or "Not
found". 
See also #3377

Reason: lprm.c:

The cupsGetNamedDest(http, name, instance) call returns default printer
(if any) even if "name" argument is a job number.


     /*
      * Cancel a job or printer...
      */
      if ((dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, argv[i], NULL)) !=
NULL)
        cupsFreeDests(1, dest);
      if (dest) //<-dest = default printer despite the argv[i] is <jobnum>
      {
        name   = argv[i];  //name is <jobnum>, leads to uri
/printers/<jobnum>
        job_id = 0;
      }
      else if (isdigit(argv[i][0] & 255))
      {
        name   = NULL;   // it would be nice to preserve printer name to
cupsCancelJob2 call
        job_id = atoi(argv[i]);
      }

Link: http://www.cups.org/str.php?L3508
Version: 1.4.2





More information about the cups-devel mailing list