summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2019-11-07 11:01:05 +0100
committerStefan Metzmacher <metze@samba.org>2019-11-27 10:25:37 +0000
commitb5c6964a50be03999432fa5620be39dcb7093ad8 (patch)
tree3933192064a7df757929b2f12b204e94746e4ef5 /source3/printing
parenteddc63be868434d3aa5a66b514b692f4d7b8833a (diff)
downloadsamba-b5c6964a50be03999432fa5620be39dcb7093ad8.tar.gz
s3:param: make "servicename" a substituted option
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/notify.c32
-rw-r--r--source3/printing/nt_printing.c4
-rw-r--r--source3/printing/nt_printing_ads.c4
-rw-r--r--source3/printing/print_generic.c2
-rw-r--r--source3/printing/printing.c10
-rw-r--r--source3/printing/printspoolss.c2
-rw-r--r--source3/printing/queue_process.c1
7 files changed, 39 insertions, 16 deletions
diff --git a/source3/printing/notify.c b/source3/printing/notify.c
index 56747272394..d09c12ade77 100644
--- a/source3/printing/notify.c
+++ b/source3/printing/notify.c
@@ -423,7 +423,9 @@ void notify_printer_status(struct tevent_context *ev,
struct messaging_context *msg_ctx,
int snum, uint32_t status)
{
- const char *sharename = lp_servicename(talloc_tos(), snum);
+ const struct loadparm_substitution *lp_sub =
+ loadparm_s3_global_substitution();
+ const char *sharename = lp_servicename(talloc_tos(), lp_sub, snum);
if (sharename)
notify_printer_status_byname(ev, msg_ctx, sharename, status);
@@ -511,7 +513,9 @@ void notify_printer_driver(struct tevent_context *ev,
struct messaging_context *msg_ctx,
int snum, const char *driver_name)
{
- const char *sharename = lp_servicename(talloc_tos(), snum);
+ const struct loadparm_substitution *lp_sub =
+ loadparm_s3_global_substitution();
+ const char *sharename = lp_servicename(talloc_tos(), lp_sub, snum);
send_notify_field_buffer(
ev, msg_ctx,
@@ -523,7 +527,9 @@ void notify_printer_comment(struct tevent_context *ev,
struct messaging_context *msg_ctx,
int snum, const char *comment)
{
- const char *sharename = lp_servicename(talloc_tos(), snum);
+ const struct loadparm_substitution *lp_sub =
+ loadparm_s3_global_substitution();
+ const char *sharename = lp_servicename(talloc_tos(), lp_sub, snum);
send_notify_field_buffer(
ev, msg_ctx,
@@ -535,7 +541,9 @@ void notify_printer_sharename(struct tevent_context *ev,
struct messaging_context *msg_ctx,
int snum, const char *share_name)
{
- const char *sharename = lp_servicename(talloc_tos(), snum);
+ const struct loadparm_substitution *lp_sub =
+ loadparm_s3_global_substitution();
+ const char *sharename = lp_servicename(talloc_tos(), lp_sub, snum);
send_notify_field_buffer(
ev, msg_ctx,
@@ -547,7 +555,9 @@ void notify_printer_printername(struct tevent_context *ev,
struct messaging_context *msg_ctx,
int snum, const char *printername)
{
- const char *sharename = lp_servicename(talloc_tos(), snum);
+ const struct loadparm_substitution *lp_sub =
+ loadparm_s3_global_substitution();
+ const char *sharename = lp_servicename(talloc_tos(), lp_sub, snum);
send_notify_field_buffer(
ev, msg_ctx,
@@ -559,7 +569,9 @@ void notify_printer_port(struct tevent_context *ev,
struct messaging_context *msg_ctx,
int snum, const char *port_name)
{
- const char *sharename = lp_servicename(talloc_tos(), snum);
+ const struct loadparm_substitution *lp_sub =
+ loadparm_s3_global_substitution();
+ const char *sharename = lp_servicename(talloc_tos(), lp_sub, snum);
send_notify_field_buffer(
ev, msg_ctx,
@@ -571,7 +583,9 @@ void notify_printer_location(struct tevent_context *ev,
struct messaging_context *msg_ctx,
int snum, const char *location)
{
- const char *sharename = lp_servicename(talloc_tos(), snum);
+ const struct loadparm_substitution *lp_sub =
+ loadparm_s3_global_substitution();
+ const char *sharename = lp_servicename(talloc_tos(), lp_sub, snum);
send_notify_field_buffer(
ev, msg_ctx,
@@ -583,7 +597,9 @@ void notify_printer_sepfile(struct tevent_context *ev,
struct messaging_context *msg_ctx,
int snum, const char *sepfile)
{
- const char *sharename = lp_servicename(talloc_tos(), snum);
+ const struct loadparm_substitution *lp_sub =
+ loadparm_s3_global_substitution();
+ const char *sharename = lp_servicename(talloc_tos(), lp_sub, snum);
send_notify_field_buffer(
ev, msg_ctx,
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index cd9ca9f9452..98536017b5b 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -1713,6 +1713,8 @@ bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
struct dcerpc_binding_handle *b,
const struct spoolss_DriverInfo8 *r)
{
+ const struct loadparm_substitution *lp_sub =
+ loadparm_s3_global_substitution();
int snum;
int n_services = lp_numservices();
bool in_use = false;
@@ -1733,7 +1735,7 @@ bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
}
result = winreg_get_printer(mem_ctx, b,
- lp_servicename(talloc_tos(), snum),
+ lp_servicename(talloc_tos(), lp_sub, snum),
&pinfo2);
if (!W_ERROR_IS_OK(result)) {
continue; /* skip */
diff --git a/source3/printing/nt_printing_ads.c b/source3/printing/nt_printing_ads.c
index a82f1361fc8..478d1231b00 100644
--- a/source3/printing/nt_printing_ads.c
+++ b/source3/printing/nt_printing_ads.c
@@ -619,6 +619,8 @@ done:
WERROR check_published_printers(struct messaging_context *msg_ctx)
{
+ const struct loadparm_substitution *lp_sub =
+ loadparm_s3_global_substitution();
ADS_STATUS ads_rc;
ADS_STRUCT *ads = NULL;
int snum;
@@ -666,7 +668,7 @@ WERROR check_published_printers(struct messaging_context *msg_ctx)
}
result = winreg_get_printer_internal(tmp_ctx, session_info, msg_ctx,
- lp_servicename(talloc_tos(), snum),
+ lp_servicename(talloc_tos(), lp_sub, snum),
&pinfo2);
if (!W_ERROR_IS_OK(result)) {
continue;
diff --git a/source3/printing/print_generic.c b/source3/printing/print_generic.c
index 77000bf55ec..0059fad23c5 100644
--- a/source3/printing/print_generic.c
+++ b/source3/printing/print_generic.c
@@ -82,7 +82,7 @@ static int print_run_command(int snum, const char* printername, bool do_sub,
if (do_sub && snum != -1) {
syscmd = talloc_sub_advanced(ctx,
- lp_servicename(talloc_tos(), snum),
+ lp_servicename(talloc_tos(), lp_sub, snum),
current_user_info.unix_name,
"",
get_current_gid(NULL),
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 3d43887c5c0..3c74efb9657 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -1727,7 +1727,7 @@ static void print_queue_update(struct messaging_context *msg_ctx,
return;
}
lpqcommand = talloc_sub_full(ctx,
- lp_servicename(talloc_tos(), snum),
+ lp_servicename(talloc_tos(), lp_sub, snum),
current_user_info.unix_name,
"",
get_current_gid(NULL),
@@ -1747,7 +1747,7 @@ static void print_queue_update(struct messaging_context *msg_ctx,
return;
}
lprmcommand = talloc_sub_full(ctx,
- lp_servicename(talloc_tos(), snum),
+ lp_servicename(talloc_tos(), lp_sub, snum),
current_user_info.unix_name,
"",
get_current_gid(NULL),
@@ -3054,7 +3054,7 @@ NTSTATUS print_job_end(struct messaging_context *msg_ctx, int snum,
goto fail;
}
lpq_cmd = talloc_sub_full(tmp_ctx,
- lp_servicename(talloc_tos(), snum),
+ lp_servicename(talloc_tos(), lp_sub, snum),
current_user_info.unix_name,
"",
get_current_gid(NULL),
@@ -3105,6 +3105,8 @@ static bool get_stored_queue_info(struct messaging_context *msg_ctx,
struct tdb_print_db *pdb, int snum,
int *pcount, print_queue_struct **ppqueue)
{
+ const struct loadparm_substitution *lp_sub =
+ loadparm_s3_global_substitution();
TDB_DATA data, cgdata, jcdata;
print_queue_struct *queue = NULL;
uint32_t qcount = 0;
@@ -3115,7 +3117,7 @@ static bool get_stored_queue_info(struct messaging_context *msg_ctx,
uint32_t i;
int max_reported_jobs = lp_max_reported_print_jobs(snum);
bool ret = false;
- const char* sharename = lp_servicename(talloc_tos(), snum);
+ const char* sharename = lp_servicename(talloc_tos(), lp_sub, snum);
TALLOC_CTX *tmp_ctx = talloc_new(msg_ctx);
if (tmp_ctx == NULL) {
return false;
diff --git a/source3/printing/printspoolss.c b/source3/printing/printspoolss.c
index 68e94fd1635..523e429b205 100644
--- a/source3/printing/printspoolss.c
+++ b/source3/printing/printspoolss.c
@@ -80,7 +80,7 @@ NTSTATUS print_spool_open(files_struct *fsp,
status = NT_STATUS_NO_MEMORY;
goto done;
}
- pf->svcname = lp_servicename(pf, SNUM(fsp->conn));
+ pf->svcname = lp_servicename(pf, lp_sub, SNUM(fsp->conn));
/* the document name is derived from the file name.
* "Remote Downlevel Document" is added in front to
diff --git a/source3/printing/queue_process.c b/source3/printing/queue_process.c
index 38d50eeffa8..0b6dc9fca9f 100644
--- a/source3/printing/queue_process.c
+++ b/source3/printing/queue_process.c
@@ -103,6 +103,7 @@ static void delete_and_reload_printers_full(struct tevent_context *ev,
msg_ctx,
NULL,
lp_servicename(session_info,
+ lp_sub,
snum),
&pinfo2)) {
nt_printer_publish(session_info,