From fe1617a818b13b2ff2289e3afd33f2ddcfa76124 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 3 May 2010 13:42:32 +0200 Subject: 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 --- source3/smbd/lanman.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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, -- cgit