The branch, master has been updated
       via  015bdbd s3: spoolss: Extend publish_toggle test to check returned 
GUID string format
      from  490c35d winbindd: idmap_rid: error code for failing id-to-sid 
mapping request

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


- Log -----------------------------------------------------------------
commit 015bdbd10b43df0e792032248b50edf9157a0f3e
Author: Samuel Cabrero <[email protected]>
Date:   Thu Oct 5 19:22:29 2017 +0200

    s3: spoolss: Extend publish_toggle test to check returned GUID string format
    
    Extend the rpc.spoolss.printer.addprinter.publish_toggle test to
    check the format of the returned GUID string in GetPrinter info
    level 7 structure.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12993
    
    Signed-off-by: Samuel Cabrero <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    Reviewed-by: David Disseldorp <[email protected]>
    
    Autobuild-User(master): Jeremy Allison <[email protected]>
    Autobuild-Date(master): Wed Oct 11 06:39:00 CEST 2017 on sn-devel-144

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

Summary of changes:
 source4/torture/rpc/spoolss.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)


Changeset truncated at 500 lines:

diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index d4f6969..31b9525 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -9218,14 +9218,26 @@ static bool test_printer_set_publish(struct 
torture_context *tctx,
                                         "info7 publish flag not set");
        } else {
                struct GUID guid;
+               char *ref_guid;
                torture_assert_int_equal(tctx,
                                         info.info7.action,
                                         DSPRINT_PUBLISH,
                                         "info7 publish flag not set");
+
+               /* GUID_from_string is able to parse both plain and
+                * curly-braced guids */
                torture_assert_ntstatus_ok(tctx,
                                           GUID_from_string(info.info7.guid,
                                           &guid),
                                           "invalid published printer GUID");
+
+               /* Build reference GUID string */
+               ref_guid = GUID_string2(tctx, &guid);
+               torture_assert_not_null(tctx, ref_guid, "ENOMEM");
+               ref_guid = talloc_strdup_upper(tctx, ref_guid);
+               torture_assert_not_null(tctx, ref_guid, "ENOMEM");
+               torture_assert_str_equal(tctx, info.info7.guid, ref_guid,
+                       "invalid GUID format");
        }
 
        return true;


-- 
Samba Shared Repository

Reply via email to