summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-05-03 13:42:32 +0200
committerGünther Deschner <gd@samba.org>2010-05-03 14:45:26 +0200
commitfe1617a818b13b2ff2289e3afd33f2ddcfa76124 (patch)
tree81efee910946d55ca3d35e0856817cc5f7f06d8a /source3
parent84aea4784a1798f2585cfa98b6126e21e830ae82 (diff)
downloadsamba-fe1617a818b13b2ff2289e3afd33f2ddcfa76124.tar.gz
samba-fe1617a818b13b2ff2289e3afd33f2ddcfa76124.tar.bz2
samba-fe1617a818b13b2ff2289e3afd33f2ddcfa76124.zip
s3-lanman: fix api_DosPrintQEnum().
This was a subtile bug where the OpenPrinter call (called directly via dispatcher table) was modifiying r->in.printername in a way that all printers on a server had the printername stripped off the server unc. Once we switch to full NDR marshalling in inter RAP<->RPC server communication there is no danger anymore to have these kind of nasty effects. Guenther
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/lanman.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 954c9c84ba..ec87dbb0b8 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -1071,12 +1071,18 @@ static bool api_DosPrintQEnum(connection_struct *conn, uint16 vuid,
uint32_t num_jobs;
struct policy_handle handle;
+ const char *printername;
+
+ printername = talloc_strdup(mem_ctx, printer_info[i].info2.printername);
+ if (printername == NULL) {
+ goto err;
+ }
ZERO_STRUCT(handle);
ZERO_STRUCT(devmode_ctr);
status = rpccli_spoolss_OpenPrinter(cli, mem_ctx,
- printer_info[i].info2.printername,
+ printername,
NULL,
devmode_ctr,
SEC_FLAG_MAXIMUM_ALLOWED,