[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Sun Jun 13 04:40:56 MDT 2010
The branch, master has been updated
via 3f7e222... s3: Remove the pointless PRINTERNAME macro
via 1b13755... s3: Remove the pointless SERVICE macro
from 731b446... s4:dcesrv_samr_GetGroupsForUser - return error code if a SID wasn't found
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 3f7e2222f47d5960cece48dd751470bcc0983d93
Author: Volker Lendecke <vl at samba.org>
Date: Sun Jun 13 12:11:26 2010 +0200
s3: Remove the pointless PRINTERNAME macro
commit 1b13755698464581fb1b4a3083f5930d7b408ea4
Author: Volker Lendecke <vl at samba.org>
Date: Sun Jun 13 12:07:37 2010 +0200
s3: Remove the pointless SERVICE macro
-----------------------------------------------------------------------
Summary of changes:
source3/include/smb_macros.h | 2 --
source3/printing/notify.c | 14 +++++++-------
source3/printing/nt_printing.c | 2 +-
source3/printing/print_cups.c | 27 ++++++++++++++++++---------
source3/printing/print_generic.c | 12 +++++++-----
source3/printing/print_iprint.c | 23 +++++++++++++++--------
source3/printing/printing.c | 12 ++++++------
source3/rpc_server/srv_spoolss_nt.c | 4 ++--
8 files changed, 56 insertions(+), 40 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h
index bc5d9a7..20283e7 100644
--- a/source3/include/smb_macros.h
+++ b/source3/include/smb_macros.h
@@ -68,8 +68,6 @@
/* access various service details */
-#define SERVICE(snum) (lp_servicename(snum))
-#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/notify.c b/source3/printing/notify.c
index a18b2fd..1d155bb 100644
--- a/source3/printing/notify.c
+++ b/source3/printing/notify.c
@@ -407,7 +407,7 @@ void notify_printer_status_byname(const char *sharename, uint32 status)
void notify_printer_status(int snum, uint32 status)
{
- const char *sharename = SERVICE(snum);
+ const char *sharename = lp_servicename(snum);
if (sharename)
notify_printer_status_byname(sharename, status);
@@ -472,7 +472,7 @@ void notify_job_submitted(const char *sharename, uint32 jobid,
void notify_printer_driver(int snum, const char *driver_name)
{
- const char *sharename = SERVICE(snum);
+ const char *sharename = lp_servicename(snum);
send_notify_field_buffer(
sharename, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_FIELD_DRIVER_NAME,
@@ -481,7 +481,7 @@ void notify_printer_driver(int snum, const char *driver_name)
void notify_printer_comment(int snum, const char *comment)
{
- const char *sharename = SERVICE(snum);
+ const char *sharename = lp_servicename(snum);
send_notify_field_buffer(
sharename, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_FIELD_COMMENT,
@@ -490,7 +490,7 @@ void notify_printer_comment(int snum, const char *comment)
void notify_printer_sharename(int snum, const char *share_name)
{
- const char *sharename = SERVICE(snum);
+ const char *sharename = lp_servicename(snum);
send_notify_field_buffer(
sharename, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_FIELD_SHARE_NAME,
@@ -499,7 +499,7 @@ void notify_printer_sharename(int snum, const char *share_name)
void notify_printer_printername(int snum, const char *printername)
{
- const char *sharename = SERVICE(snum);
+ const char *sharename = lp_servicename(snum);
send_notify_field_buffer(
sharename, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_FIELD_PRINTER_NAME,
@@ -508,7 +508,7 @@ void notify_printer_printername(int snum, const char *printername)
void notify_printer_port(int snum, const char *port_name)
{
- const char *sharename = SERVICE(snum);
+ const char *sharename = lp_servicename(snum);
send_notify_field_buffer(
sharename, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_FIELD_PORT_NAME,
@@ -517,7 +517,7 @@ void notify_printer_port(int snum, const char *port_name)
void notify_printer_location(int snum, const char *location)
{
- const char *sharename = SERVICE(snum);
+ const char *sharename = lp_servicename(snum);
send_notify_field_buffer(
sharename, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_FIELD_LOCATION,
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 78f4375..c87cfc1 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 76a13cf..043cc96 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 b789354..b925bed 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 f7a86dd..2f6e5b2 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 74edb25..6bf037a 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 8ebc7fa..e03bb34 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(
--
Samba Shared Repository
More information about the samba-cvs
mailing list