summaryrefslogtreecommitdiffstats
path: root/source/printing
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-02-25 14:08:30 +0000
committerGerald Carter <jerry@samba.org>2005-02-25 14:08:30 +0000
commit70cd25be8b07743816b9376f9d219453f0f906fc (patch)
tree073f3d33dac8c96b0d4c7b809b3dc86b91023214 /source/printing
parent1d58e0d7811acc335f09128ae757f5f76a51644d (diff)
downloadsamba-70cd25be8b07743816b9376f9d219453f0f906fc.tar.gz
samba-70cd25be8b07743816b9376f9d219453f0f906fc.tar.xz
samba-70cd25be8b07743816b9376f9d219453f0f906fc.zip
r5555: current with 3.0 tree as of r5548; getting ready for 3.0.12pre1
Diffstat (limited to 'source/printing')
-rw-r--r--source/printing/print_cups.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/source/printing/print_cups.c b/source/printing/print_cups.c
index 59ab41b9f67..e6064564dc8 100644
--- a/source/printing/print_cups.c
+++ b/source/printing/print_cups.c
@@ -670,12 +670,13 @@ static int cups_job_submit(int snum, struct printjob *pjob)
* 'cups_queue_get()' - Get all the jobs in the print queue.
*/
-static int cups_queue_get(const char *printer_name,
+static int cups_queue_get(const char *sharename,
enum printing_types printing_type,
char *lpq_command,
print_queue_struct **q,
print_status_struct *status)
{
+ fstring printername;
http_t *http = NULL; /* HTTP connection to server */
ipp_t *request = NULL, /* IPP Request */
*response = NULL; /* IPP Response */
@@ -711,7 +712,15 @@ static int cups_queue_get(const char *printer_name,
*q = NULL;
- DEBUG(5,("cups_queue_get(%s, %p, %p)\n", printer_name, q, status));
+ /* HACK ALERT!!! The porblem with support the 'printer name'
+ option is that we key the tdb off the sharename. So we will
+ overload the lpq_command string to pass in the printername
+ (which is basically what we do for non-cups printers ... using
+ the lpq_command to get the queue listing). */
+
+ fstrcpy( printername, lpq_command );
+
+ DEBUG(5,("cups_queue_get(%s, %p, %p)\n", printername, q, status));
/*
* Make sure we don't ask for passwords...
@@ -733,7 +742,7 @@ static int cups_queue_get(const char *printer_name,
* Generate the printer URI...
*/
- slprintf(uri, sizeof(uri) - 1, "ipp://localhost/printers/%s", printer_name);
+ slprintf(uri, sizeof(uri) - 1, "ipp://localhost/printers/%s", printername);
/*
* Build an IPP_GET_JOBS request, which requires the following
@@ -936,14 +945,14 @@ static int cups_queue_get(const char *printer_name,
*/
if ((response = cupsDoRequest(http, request, "/")) == NULL) {
- DEBUG(0,("Unable to get printer status for %s - %s\n", printer_name,
+ DEBUG(0,("Unable to get printer status for %s - %s\n", printername,
ippErrorString(cupsLastError())));
*q = queue;
goto out;
}
if (response->request.status.status_code >= IPP_OK_CONFLICT) {
- DEBUG(0,("Unable to get printer status for %s - %s\n", printer_name,
+ DEBUG(0,("Unable to get printer status for %s - %s\n", printername,
ippErrorString(response->request.status.status_code)));
*q = queue;
goto out;