summaryrefslogtreecommitdiffstats
path: root/source3/rpc_server/spoolss
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@samba.org>2014-08-05 17:33:33 +0200
committerAndreas Schneider <asn@cryptomilk.org>2014-08-08 16:33:50 +0200
commit1ad71f79eb473822d36d9629cf52c2fca4c53752 (patch)
tree953fab08c774938769d3d5d079c78593a25aad69 /source3/rpc_server/spoolss
parent2706af4d78fc9a47a4ac45b373edf276e3a9b354 (diff)
downloadsamba-1ad71f79eb473822d36d9629cf52c2fca4c53752.tar.gz
samba-1ad71f79eb473822d36d9629cf52c2fca4c53752.tar.xz
samba-1ad71f79eb473822d36d9629cf52c2fca4c53752.zip
printing: reload printer shares on OpenPrinter
The printer share inventory should be reloaded on open _and_ enumeration, as there are some clients, such as cupsaddsmb, that do not perform an enumeration prior to access. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10652 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Aug 8 16:33:50 CEST 2014 on sn-devel-104
Diffstat (limited to 'source3/rpc_server/spoolss')
-rw-r--r--source3/rpc_server/spoolss/srv_spoolss_nt.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index 391bb01d3e..b8a6d7711e 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -1720,6 +1720,16 @@ WERROR _spoolss_OpenPrinterEx(struct pipes_struct *p,
return WERR_INVALID_PARAM;
}
+ /*
+ * The printcap printer share inventory is updated on client
+ * enumeration. For clients that do not perform enumeration prior to
+ * access, such as cupssmbadd, we reinitialise the printer share
+ * inventory on open as well.
+ */
+ become_root();
+ delete_and_reload_printers(server_event_context(), p->msg_ctx);
+ unbecome_root();
+
/* some sanity check because you can open a printer or a print server */
/* aka: \\server\printer or \\server */
@@ -4316,7 +4326,7 @@ static WERROR enum_all_printers_info_level(TALLOC_CTX *mem_ctx,
}
/*
- * printer shares are only updated on client enumeration. The background
+ * printer shares are updated on client enumeration. The background
* printer process updates printer_list.tdb at regular intervals.
*/
become_root();