summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-06-13 12:11:26 +0200
committerVolker Lendecke <vl@samba.org>2010-06-13 12:40:27 +0200
commit3f7e2222f47d5960cece48dd751470bcc0983d93 (patch)
treeca449c0608ae34500e1613697d0788258351d5ce
parent1b13755698464581fb1b4a3083f5930d7b408ea4 (diff)
downloadsamba-3f7e2222f47d5960cece48dd751470bcc0983d93.tar.gz
samba-3f7e2222f47d5960cece48dd751470bcc0983d93.tar.bz2
samba-3f7e2222f47d5960cece48dd751470bcc0983d93.zip
s3: Remove the pointless PRINTERNAME macro
-rw-r--r--source3/include/smb_macros.h1
-rw-r--r--source3/printing/nt_printing.c2
-rw-r--r--source3/printing/print_cups.c27
-rw-r--r--source3/printing/print_generic.c12
-rw-r--r--source3/printing/print_iprint.c23
-rw-r--r--source3/printing/printing.c12
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c4
7 files changed, 49 insertions, 32 deletions
diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h
index f9a58f33be..20283e7177 100644
--- a/source3/include/smb_macros.h
+++ b/source3/include/smb_macros.h
@@ -68,7 +68,6 @@
/* access various service details */
-#define PRINTERNAME(snum) (lp_printername(snum))
#define CAN_WRITE(conn) (!conn->read_only)
#define VALID_SNUM(snum) (lp_snum_ok(snum))
#define GUEST_OK(snum) (VALID_SNUM(snum) && lp_guest_ok(snum))
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 78f43756c2..c87cfc1fe3 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -5607,7 +5607,7 @@ bool print_access_check(struct auth_serversupplied_info *server_info, int snum,
/* Get printer name */
- pname = PRINTERNAME(snum);
+ pname = lp_printername(snum);
if (!pname || !*pname) {
errno = EACCES;
diff --git a/source3/printing/print_cups.c b/source3/printing/print_cups.c
index 76a13cf3b4..043cc96930 100644
--- a/source3/printing/print_cups.c
+++ b/source3/printing/print_cups.c
@@ -962,7 +962,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, PRINTERNAME(snum), &size)) {
+ if (!push_utf8_talloc(frame, &printername, lp_printername(snum),
+ &size)) {
goto out;
}
slprintf(uri, sizeof(uri) - 1, "ipp://localhost/printers/%s",
@@ -1033,7 +1034,8 @@ 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", PRINTERNAME(snum),
+ DEBUG(0,("Unable to print file to %s - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
} else {
ret = 0;
@@ -1046,7 +1048,8 @@ static int cups_job_submit(int snum, struct printjob *pjob)
}
}
} else {
- DEBUG(0,("Unable to print file to `%s' - %s\n", PRINTERNAME(snum),
+ DEBUG(0,("Unable to print file to `%s' - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
}
@@ -1471,7 +1474,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, PRINTERNAME(snum), &size)) {
+ if (!push_utf8_talloc(frame, &printername, lp_printername(snum),
+ &size)) {
goto out;
}
slprintf(uri, sizeof(uri) - 1, "ipp://localhost/printers/%s",
@@ -1491,13 +1495,15 @@ 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", PRINTERNAME(snum),
+ DEBUG(0,("Unable to pause printer %s - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
} else {
ret = 0;
}
} else {
- DEBUG(0,("Unable to pause printer %s - %s\n", PRINTERNAME(snum),
+ DEBUG(0,("Unable to pause printer %s - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
}
@@ -1572,7 +1578,8 @@ 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, PRINTERNAME(snum), &size)) {
+ if (!push_utf8_talloc(frame, &printername, lp_printername(snum),
+ &size)) {
goto out;
}
slprintf(uri, sizeof(uri) - 1, "ipp://localhost/printers/%s",
@@ -1592,13 +1599,15 @@ 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", PRINTERNAME(snum),
+ DEBUG(0,("Unable to resume printer %s - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
} else {
ret = 0;
}
} else {
- DEBUG(0,("Unable to resume printer %s - %s\n", PRINTERNAME(snum),
+ DEBUG(0,("Unable to resume printer %s - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
}
diff --git a/source3/printing/print_generic.c b/source3/printing/print_generic.c
index b789354999..b925bedace 100644
--- a/source3/printing/print_generic.c
+++ b/source3/printing/print_generic.c
@@ -117,7 +117,7 @@ static int generic_job_pause(int snum, struct printjob *pjob)
/* need to pause the spooled entry */
slprintf(jobstr, sizeof(jobstr)-1, "%d", pjob->sysjob);
- return print_run_command(snum, PRINTERNAME(snum), True,
+ return print_run_command(snum, lp_printername(snum), True,
lp_lppausecommand(snum), NULL,
"%j", jobstr,
NULL);
@@ -132,7 +132,7 @@ static int generic_job_resume(int snum, struct printjob *pjob)
/* need to pause the spooled entry */
slprintf(jobstr, sizeof(jobstr)-1, "%d", pjob->sysjob);
- return print_run_command(snum, PRINTERNAME(snum), True,
+ return print_run_command(snum, lp_printername(snum), True,
lp_lpresumecommand(snum), NULL,
"%j", jobstr,
NULL);
@@ -194,7 +194,7 @@ static int generic_job_submit(int snum, struct printjob *pjob)
slprintf(job_size, sizeof(job_size)-1, "%lu", (unsigned long)pjob->size);
/* send it to the system spooler */
- ret = print_run_command(snum, PRINTERNAME(snum), True,
+ ret = print_run_command(snum, lp_printername(snum), True,
lp_printcommand(snum), NULL,
"%s", p,
"%J", jobname,
@@ -274,7 +274,8 @@ static int generic_queue_get(const char *printer_name,
****************************************************************************/
static int generic_queue_pause(int snum)
{
- return print_run_command(snum, PRINTERNAME(snum), True, lp_queuepausecommand(snum), NULL, NULL);
+ return print_run_command(snum, lp_printername(snum), True,
+ lp_queuepausecommand(snum), NULL, NULL);
}
/****************************************************************************
@@ -282,7 +283,8 @@ static int generic_queue_pause(int snum)
****************************************************************************/
static int generic_queue_resume(int snum)
{
- return print_run_command(snum, PRINTERNAME(snum), True, lp_queueresumecommand(snum), NULL, NULL);
+ return print_run_command(snum, lp_printername(snum), True,
+ lp_queueresumecommand(snum), NULL, NULL);
}
/****************************************************************************
diff --git a/source3/printing/print_iprint.c b/source3/printing/print_iprint.c
index f7a86dd453..2f6e5b2667 100644
--- a/source3/printing/print_iprint.c
+++ b/source3/printing/print_iprint.c
@@ -575,7 +575,8 @@ static int iprint_job_pause(int snum, struct printjob *pjob)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
- slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(), PRINTERNAME(snum));
+ slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(),
+ lp_printername(snum));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
@@ -588,7 +589,8 @@ static int iprint_job_pause(int snum, struct printjob *pjob)
* Do the request and get back a response...
*/
- slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s", PRINTERNAME(snum));
+ slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s",
+ lp_printername(snum));
if ((response = cupsDoRequest(http, request, httpPath)) != NULL) {
if (response->request.status.status_code >= IPP_OK_CONFLICT) {
@@ -673,7 +675,8 @@ static int iprint_job_resume(int snum, struct printjob *pjob)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
- slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(), PRINTERNAME(snum));
+ slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(),
+ lp_printername(snum));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri);
@@ -686,7 +689,8 @@ static int iprint_job_resume(int snum, struct printjob *pjob)
* Do the request and get back a response...
*/
- slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s", PRINTERNAME(snum));
+ slprintf(httpPath, sizeof(httpPath) - 1, "/ipp/%s",
+ lp_printername(snum));
if ((response = cupsDoRequest(http, request, httpPath)) != NULL) {
if (response->request.status.status_code >= IPP_OK_CONFLICT) {
@@ -772,7 +776,8 @@ static int iprint_job_submit(int snum, struct printjob *pjob)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE,
"attributes-natural-language", NULL, language->language);
- slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(), PRINTERNAME(snum));
+ slprintf(uri, sizeof(uri) - 1, "ipp://%s/ipp/%s", iprint_server(),
+ lp_printername(snum));
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
"printer-uri", NULL, uri);
@@ -796,17 +801,19 @@ static int iprint_job_submit(int snum, struct printjob *pjob)
* Do the request and get back a response...
*/
- slprintf(uri, sizeof(uri) - 1, "/ipp/%s", PRINTERNAME(snum));
+ slprintf(uri, sizeof(uri) - 1, "/ipp/%s", lp_printername(snum));
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", PRINTERNAME(snum),
+ DEBUG(0,("Unable to print file to %s - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
} else {
ret = 0;
}
} else {
- DEBUG(0,("Unable to print file to `%s' - %s\n", PRINTERNAME(snum),
+ DEBUG(0,("Unable to print file to `%s' - %s\n",
+ lp_printername(snum),
ippErrorString(cupsLastError())));
}
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 74edb25eb5..6bf037a817 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -1504,7 +1504,7 @@ static void print_queue_update(int snum, bool force)
lpqcommand = talloc_string_sub2(ctx,
lp_lpqcommand(snum),
"%p",
- PRINTERNAME(snum),
+ lp_printername(snum),
false, false, false);
if (!lpqcommand) {
return;
@@ -1524,7 +1524,7 @@ static void print_queue_update(int snum, bool force)
lprmcommand = talloc_string_sub2(ctx,
lp_lprmcommand(snum),
"%p",
- PRINTERNAME(snum),
+ lp_printername(snum),
false, false, false);
if (!lprmcommand) {
return;
@@ -1990,7 +1990,7 @@ static bool print_job_delete1(int snum, uint32 jobid)
if (pjob->spooled && pjob->sysjob != -1)
{
result = (*(current_printif->job_delete))(
- PRINTERNAME(snum),
+ lp_printername(snum),
lp_lprmcommand(snum),
pjob);
@@ -2060,7 +2060,7 @@ bool print_job_delete(struct auth_serversupplied_info *server_info, int snum,
"Permission denied-- user not allowed to delete, \
pause, or resume print job. User name: %s. Printer name: %s.",
uidtoname(server_info->utok.uid),
- PRINTERNAME(snum) );
+ lp_printername(snum) );
/* END_ADMIN_LOG */
return False;
@@ -2135,7 +2135,7 @@ bool print_job_pause(struct auth_serversupplied_info *server_info, int snum,
"Permission denied-- user not allowed to delete, \
pause, or resume print job. User name: %s. Printer name: %s.",
uidtoname(server_info->utok.uid),
- PRINTERNAME(snum) );
+ lp_printername(snum) );
/* END_ADMIN_LOG */
*errcode = WERR_ACCESS_DENIED;
@@ -2198,7 +2198,7 @@ bool print_job_resume(struct auth_serversupplied_info *server_info, int snum,
"Permission denied-- user not allowed to delete, \
pause, or resume print job. User name: %s. Printer name: %s.",
uidtoname(server_info->utok.uid),
- PRINTERNAME(snum) );
+ lp_printername(snum) );
/* END_ADMIN_LOG */
return False;
}
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 8ebc7fa64f..e03bb348ea 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -5363,7 +5363,7 @@ static WERROR update_printer_sec(struct policy_handle *handle,
the_acl = old_secdesc_ctr->sd->dacl;
DEBUG(10, ("old_secdesc_ctr for %s has %d aces:\n",
- PRINTERNAME(snum), the_acl->num_aces));
+ lp_printername(snum), the_acl->num_aces));
for (i = 0; i < the_acl->num_aces; i++) {
DEBUG(10, ("%s 0x%08x\n", sid_string_dbg(
@@ -5375,7 +5375,7 @@ static WERROR update_printer_sec(struct policy_handle *handle,
if (the_acl) {
DEBUG(10, ("secdesc_ctr for %s has %d aces:\n",
- PRINTERNAME(snum), the_acl->num_aces));
+ lp_printername(snum), the_acl->num_aces));
for (i = 0; i < the_acl->num_aces; i++) {
DEBUG(10, ("%s 0x%08x\n", sid_string_dbg(