[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Fri Oct 6 03:22:02 UTC 2017


The branch, master has been updated
       via  fc03049 s3: spoolss: Fix GUID string format on GetPrinter info
      from  e1a8c9b ctdb-common: Make parse_ip() and parse_ipv4() static

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit fc03049ca1721c25c6ad3d01cba2501af3f39b93
Author: Samuel Cabrero <scabrero at suse.de>
Date:   Thu Sep 21 09:53:35 2017 +0200

    s3: spoolss: Fix GUID string format on GetPrinter info
    
    Fix regression introduced by commit a4157e7c5d75 which removed the braces
    around the printer GUID in the printer info level 7 structure.
    
    MS-RPRN section 2.2 says this protocol uses curly-braced GUIDs so printers
    are deleted from the directory by the domain controller's pruning service.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12993
    
    Signed-off-by: Samuel Cabrero <scabrero at suse.de>
    Reviewed-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Fri Oct  6 05:21:25 CEST 2017 on sn-devel-144

-----------------------------------------------------------------------

Summary of changes:
 source3/rpc_server/spoolss/srv_spoolss_nt.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index 663c623..1476dc6 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -4241,7 +4241,7 @@ static WERROR construct_printer_info7(TALLOC_CTX *mem_ctx,
 	if (is_printer_published(tmp_ctx, session_info, msg_ctx,
 				 servername, printer, &pinfo2)) {
 		struct GUID guid;
-		struct GUID_txt_buf guid_txt;
+		char *guidstr;
 		werr = nt_printer_guid_get(tmp_ctx, session_info, msg_ctx,
 					   printer, &guid);
 		if (!W_ERROR_IS_OK(werr)) {
@@ -4288,9 +4288,19 @@ static WERROR construct_printer_info7(TALLOC_CTX *mem_ctx,
 					  printer));
 			}
 		}
-		r->guid = talloc_strdup_upper(mem_ctx,
-					     GUID_buf_string(&guid, &guid_txt));
+
+		/* [MS-RPRN] section 2.2: must use curly-braced GUIDs */
+		guidstr = GUID_string2(mem_ctx, &guid);
+		if (guidstr == NULL) {
+			werr = WERR_NOT_ENOUGH_MEMORY;
+			goto out_tmp_free;
+		}
+		/* Convert GUID string to uppercase otherwise printers
+		 * are pruned */
+		r->guid = talloc_strdup_upper(mem_ctx, guidstr);
 		r->action = DSPRINT_PUBLISH;
+
+		TALLOC_FREE(guidstr);
 	} else {
 		r->guid = talloc_strdup(mem_ctx, "");
 		r->action = DSPRINT_UNPUBLISH;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list