The Samba-Bugzilla – Attachment 12636 Details for
Bug 11665
When connecting to printers with "List in Directory" set but aren't in the directory fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for 3.6
0001-s3-spoolss-Remove-printer-from-registry-if-it-is-unp.patch (text/plain), 2.48 KB, created by
Andreas Schneider
on 2016-11-08 17:22:55 UTC
(
hide
)
Description:
patch for 3.6
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2016-11-08 17:22:55 UTC
Size:
2.48 KB
patch
obsolete
>From b4952a540313749dd56c37a0aa1ebfa54aef0fea Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Tue, 8 Nov 2016 12:20:41 +0100 >Subject: [PATCH] s3-spoolss: Remove printer from registry if it is unpublished > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=11665 > >Signed-off-by: Andreas Schneider <asn@samba.org> >Reviewed-by: Guenther Deschner <gd@samba.org> > >(cherry picked from commit 07505429cc4bb7e56f4dcdcaeb4eabdcd8e550e5) >--- > source3/rpc_server/spoolss/srv_spoolss_nt.c | 34 ++++++++++++++++++++++++----- > 1 file changed, 29 insertions(+), 5 deletions(-) > >diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c >index 556cd4f..f1ab3fb 100644 >--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c >+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c >@@ -4194,6 +4194,7 @@ static WERROR construct_printer_info7(TALLOC_CTX *mem_ctx, > int snum) > { > struct auth_serversupplied_info *session_info; >+ struct spoolss_PrinterInfo2 *pinfo2 = NULL; > char *printer; > NTSTATUS status; > WERROR werr; >@@ -4218,7 +4219,7 @@ static WERROR construct_printer_info7(TALLOC_CTX *mem_ctx, > } > > if (is_printer_published(tmp_ctx, session_info, msg_ctx, >- servername, printer, NULL)) { >+ servername, printer, &pinfo2)) { > struct GUID guid; > werr = nt_printer_guid_get(tmp_ctx, session_info, msg_ctx, > printer, &guid); >@@ -4230,10 +4231,33 @@ static WERROR construct_printer_info7(TALLOC_CTX *mem_ctx, > werr = nt_printer_guid_retrieve(tmp_ctx, printer, > &guid); > if (!W_ERROR_IS_OK(werr)) { >- DEBUG(1, ("Failed to retrieve GUID for " >- "printer [%s] from AD - " >- "Is the the printer still " >- "published ?\n", printer)); >+ DEBUG(3, ("Failed to retrieve GUID for " >+ "printer [%s] from AD - %s\n", >+ printer, >+ win_errstr(werr))); >+ if (W_ERROR_EQUAL(werr, WERR_FILE_NOT_FOUND)) { >+ /* >+ * If we did not find it in AD, then it >+ * is unpublished and we should reflect >+ * this in the registry and return >+ * success. >+ */ >+ DEBUG(1, ("Unpublish printer [%s]\n", >+ pinfo2->sharename)); >+ nt_printer_publish(tmp_ctx, >+ session_info, >+ msg_ctx, >+ pinfo2, >+ DSPRINT_UNPUBLISH); >+ r->guid = talloc_strdup(mem_ctx, ""); >+ r->action = DSPRINT_UNPUBLISH; >+ >+ if (r->guid == NULL) { >+ werr = WERR_NOT_ENOUGH_MEMORY; >+ } else { >+ werr = WERR_OK; >+ } >+ } > goto out_tmp_free; > } > >-- >2.10.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 11665
:
12633
|
12634
|
12635
| 12636