summaryrefslogtreecommitdiff
path: root/source3/printing/print_cups.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-07-18 15:07:23 +0930
committerRusty Russell <rusty@rustcorp.com.au>2012-07-18 15:07:23 +0930
commitfe72740e8221575921c22030d6d4fcb19201b03b (patch)
tree0b1bb254e23d6541eede8f2ff4494af477fd5566 /source3/printing/print_cups.c
parentc809eec53fb1d2a36909e4934dff349f91e3359e (diff)
downloadsamba-fe72740e8221575921c22030d6d4fcb19201b03b.tar.gz
samba-fe72740e8221575921c22030d6d4fcb19201b03b.tar.bz2
samba-fe72740e8221575921c22030d6d4fcb19201b03b.zip
loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.
They use talloc_tos() internally: hoist that up to the callers, some of whom don't want to us talloc_tos(). A simple patch, but hits a lot of files. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'source3/printing/print_cups.c')
-rw-r--r--source3/printing/print_cups.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/source3/printing/print_cups.c b/source3/printing/print_cups.c
index b5c7b0d4ec..d6903bc3ff 100644
--- a/source3/printing/print_cups.c
+++ b/source3/printing/print_cups.c
@@ -66,8 +66,8 @@ static http_t *cups_connect(TALLOC_CTX *frame)
int timeout = lp_cups_connection_timeout();
size_t size;
- if (lp_cups_server() != NULL && strlen(lp_cups_server()) > 0) {
- if (!push_utf8_talloc(frame, &server, lp_cups_server(), &size)) {
+ if (lp_cups_server(talloc_tos()) != NULL && strlen(lp_cups_server(talloc_tos())) > 0) {
+ if (!push_utf8_talloc(frame, &server, lp_cups_server(talloc_tos()), &size)) {
return NULL;
}
} else {
@@ -914,7 +914,8 @@ static int cups_job_submit(int snum, struct printjob *pjob,
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
- if (!push_utf8_talloc(frame, &printername, lp_printername(snum),
+ if (!push_utf8_talloc(frame, &printername,
+ lp_printername(talloc_tos(), snum),
&size)) {
goto out;
}
@@ -951,7 +952,8 @@ static int cups_job_submit(int snum, struct printjob *pjob,
* add any options defined in smb.conf
*/
- if (!push_utf8_talloc(frame, &cupsoptions, lp_cups_options(snum), &size)) {
+ if (!push_utf8_talloc(frame, &cupsoptions,
+ lp_cups_options(talloc_tos(), snum), &size)) {
goto out;
}
num_options = 0;
@@ -973,7 +975,7 @@ static int cups_job_submit(int snum, struct printjob *pjob,
if ((response = cupsDoFileRequest(http, request, uri, pjob->filename)) != NULL) {
if (response->request.status.status_code >= IPP_OK_CONFLICT) {
DEBUG(0,("Unable to print file to %s - %s\n",
- lp_printername(snum),
+ lp_printername(talloc_tos(), snum),
ippErrorString(cupsLastError())));
} else {
ret = 0;
@@ -987,7 +989,7 @@ static int cups_job_submit(int snum, struct printjob *pjob,
}
} else {
DEBUG(0,("Unable to print file to `%s' - %s\n",
- lp_printername(snum),
+ lp_printername(talloc_tos(), snum),
ippErrorString(cupsLastError())));
}
@@ -1412,8 +1414,8 @@ static int cups_queue_pause(int snum)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
- if (!push_utf8_talloc(frame, &printername, lp_printername(snum),
- &size)) {
+ if (!push_utf8_talloc(frame, &printername,
+ lp_printername(talloc_tos(), snum), &size)) {
goto out;
}
slprintf(uri, sizeof(uri) - 1, "ipp://localhost/printers/%s",
@@ -1434,14 +1436,14 @@ static int cups_queue_pause(int snum)
if ((response = cupsDoRequest(http, request, "/admin/")) != NULL) {
if (response->request.status.status_code >= IPP_OK_CONFLICT) {
DEBUG(0,("Unable to pause printer %s - %s\n",
- lp_printername(snum),
+ lp_printername(talloc_tos(), snum),
ippErrorString(cupsLastError())));
} else {
ret = 0;
}
} else {
DEBUG(0,("Unable to pause printer %s - %s\n",
- lp_printername(snum),
+ lp_printername(talloc_tos(), snum),
ippErrorString(cupsLastError())));
}
@@ -1516,7 +1518,7 @@ static int cups_queue_resume(int snum)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
- if (!push_utf8_talloc(frame, &printername, lp_printername(snum),
+ if (!push_utf8_talloc(frame, &printername, lp_printername(talloc_tos(), snum),
&size)) {
goto out;
}
@@ -1538,14 +1540,14 @@ static int cups_queue_resume(int snum)
if ((response = cupsDoRequest(http, request, "/admin/")) != NULL) {
if (response->request.status.status_code >= IPP_OK_CONFLICT) {
DEBUG(0,("Unable to resume printer %s - %s\n",
- lp_printername(snum),
+ lp_printername(talloc_tos(), snum),
ippErrorString(cupsLastError())));
} else {
ret = 0;
}
} else {
DEBUG(0,("Unable to resume printer %s - %s\n",
- lp_printername(snum),
+ lp_printername(talloc_tos(), snum),
ippErrorString(cupsLastError())));
}