torture: Use GUID_zero()
authorVolker Lendecke <vl@samba.org>
Fri, 8 Feb 2019 16:26:04 +0000 (17:26 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 25 Feb 2019 18:36:19 +0000 (19:36 +0100)
10 lines less...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/torture/drs/rpc/dssync.c
source4/torture/rpc/drsuapi.c

index 67fde7c2b6137247417fb0a68d81befc225fc912..6a8a8b5492bfce654bd51ffc59e08760ef96119b 100644 (file)
@@ -677,7 +677,6 @@ static bool test_GetNCChanges(struct torture_context *tctx,
        struct drsuapi_DsGetNCChangesCtr1 *ctr1 = NULL;
        struct drsuapi_DsGetNCChangesCtr6 *ctr6 = NULL;
        uint32_t out_level = 0;
-       struct GUID null_guid;
        struct dom_sid null_sid;
        DATA_BLOB gensec_skey;
        struct {
@@ -691,7 +690,6 @@ static bool test_GetNCChanges(struct torture_context *tctx,
                }
        };
 
-       ZERO_STRUCT(null_guid);
        ZERO_STRUCT(null_sid);
 
        highest_usn = lpcfg_parm_int(tctx->lp_ctx, NULL, "dssync", "highest_usn", 0);
@@ -721,13 +719,13 @@ static bool test_GetNCChanges(struct torture_context *tctx,
 
                switch (r.in.level) {
                case 5:
-                       nc.guid = null_guid;
+                       nc.guid = GUID_zero();
                        nc.sid  = null_sid;
                        nc.dn   = nc_dn_str;
 
                        r.in.req                                        = &req;
                        r.in.req->req5.destination_dsa_guid             = ctx->new_dc.invocation_id;
-                       r.in.req->req5.source_dsa_invocation_id         = null_guid;
+                       r.in.req->req5.source_dsa_invocation_id = GUID_zero();
                        r.in.req->req5.naming_context                   = &nc;
                        r.in.req->req5.highwatermark.tmp_highest_usn    = highest_usn;
                        r.in.req->req5.highwatermark.reserved_usn       = 0;
@@ -752,14 +750,14 @@ static bool test_GetNCChanges(struct torture_context *tctx,
 
                        break;
                case 8:
-                       nc.guid = null_guid;
+                       nc.guid = GUID_zero();
                        nc.sid  = null_sid;
                        nc.dn   = nc_dn_str;
                        /* nc.dn can be set to any other ad partition */
 
                        r.in.req                                        = &req;
                        r.in.req->req8.destination_dsa_guid             = ctx->new_dc.invocation_id;
-                       r.in.req->req8.source_dsa_invocation_id         = null_guid;
+                       r.in.req->req8.source_dsa_invocation_id = GUID_zero();
                        r.in.req->req8.naming_context                   = &nc;
                        r.in.req->req8.highwatermark.tmp_highest_usn    = highest_usn;
                        r.in.req->req8.highwatermark.reserved_usn       = 0;
@@ -934,10 +932,8 @@ static bool test_FetchNT4Data(struct torture_context *tctx,
        union drsuapi_DsGetNT4ChangeLogRequest req;
        union drsuapi_DsGetNT4ChangeLogInfo info;
        uint32_t level_out = 0;
-       struct GUID null_guid;
        DATA_BLOB cookie;
 
-       ZERO_STRUCT(null_guid);
        ZERO_STRUCT(cookie);
 
        ZERO_STRUCT(r);
index a424a3160c66e6cdebd4f35cd9a0a538065d1562..2ae2ba031e96bea10998ac52a227dcabaf8b432b 100644 (file)
@@ -399,7 +399,6 @@ static bool test_DsReplicaSync(struct torture_context *tctx,
        struct drsuapi_DsReplicaSync r;
        union drsuapi_DsReplicaSyncRequest sync_req;
        struct drsuapi_DsReplicaObjectIdentifier nc;
-       struct GUID null_guid;
        struct dom_sid null_sid;
        struct {
                int32_t level;
@@ -419,7 +418,6 @@ static bool test_DsReplicaSync(struct torture_context *tctx,
                return true;
        }
 
-       ZERO_STRUCT(null_guid);
        ZERO_STRUCT(null_sid);
 
        r.in.bind_handle        = &priv->bind_handle;
@@ -431,7 +429,7 @@ static bool test_DsReplicaSync(struct torture_context *tctx,
                r.in.level = array[i].level;
                switch(r.in.level) {
                case 1:
-                       nc.guid                                 = null_guid;
+                       nc.guid                                 = GUID_zero();
                        nc.sid                                  = null_sid;
                        nc.dn                                   = priv->domain_obj_dn?priv->domain_obj_dn:"";
 
@@ -458,12 +456,10 @@ static bool test_DsReplicaUpdateRefs(struct torture_context *tctx,
        struct dcerpc_pipe *p = priv->drs_pipe;
        struct drsuapi_DsReplicaUpdateRefs r;
        struct drsuapi_DsReplicaObjectIdentifier nc;
-       struct GUID null_guid;
        struct GUID dest_dsa_guid;
        const char *dest_dsa_guid_str;
        struct dom_sid null_sid;
 
-       ZERO_STRUCT(null_guid);
        ZERO_STRUCT(null_sid);
        dest_dsa_guid = GUID_random();
        dest_dsa_guid_str = GUID_string(tctx, &dest_dsa_guid);
@@ -472,7 +468,7 @@ static bool test_DsReplicaUpdateRefs(struct torture_context *tctx,
        r.in.level       = 1; /* Only version 1 is defined presently */
 
        /* setup NC */
-       nc.guid         = priv->domain_obj_dn ? null_guid : priv->domain_guid;
+       nc.guid         = priv->domain_obj_dn ? GUID_zero():priv->domain_guid;
        nc.sid          = null_sid;
        nc.dn           = priv->domain_obj_dn ? priv->domain_obj_dn : "";
 
@@ -552,7 +548,6 @@ static bool test_DsGetNCChanges(struct torture_context *tctx,
        union drsuapi_DsGetNCChangesRequest req;
        union drsuapi_DsGetNCChangesCtr ctr;
        struct drsuapi_DsReplicaObjectIdentifier nc;
-       struct GUID null_guid;
        struct dom_sid null_sid;
        uint32_t level_out;
        struct {
@@ -571,7 +566,6 @@ static bool test_DsGetNCChanges(struct torture_context *tctx,
                return true;
        }
 
-       ZERO_STRUCT(null_guid);
        ZERO_STRUCT(null_sid);
 
        for (i=0; i < ARRAY_SIZE(array); i++) {
@@ -586,13 +580,13 @@ static bool test_DsGetNCChanges(struct torture_context *tctx,
 
                switch (r.in.level) {
                case 5:
-                       nc.guid = null_guid;
+                       nc.guid = GUID_zero();
                        nc.sid  = null_sid;
                        nc.dn   = priv->domain_obj_dn ? priv->domain_obj_dn : "";
 
                        r.in.req                                        = &req;
                        r.in.req->req5.destination_dsa_guid             = GUID_random();
-                       r.in.req->req5.source_dsa_invocation_id         = null_guid;
+                       r.in.req->req5.source_dsa_invocation_id = GUID_zero();
                        r.in.req->req5.naming_context                   = &nc;
                        r.in.req->req5.highwatermark.tmp_highest_usn    = 0;
                        r.in.req->req5.highwatermark.reserved_usn       = 0;
@@ -609,13 +603,13 @@ static bool test_DsGetNCChanges(struct torture_context *tctx,
 
                        break;
                case 8:
-                       nc.guid = null_guid;
+                       nc.guid = GUID_zero();
                        nc.sid  = null_sid;
                        nc.dn   = priv->domain_obj_dn ? priv->domain_obj_dn : "";
 
                        r.in.req                                        = &req;
                        r.in.req->req8.destination_dsa_guid             = GUID_random();
-                       r.in.req->req8.source_dsa_invocation_id         = null_guid;
+                       r.in.req->req8.source_dsa_invocation_id = GUID_zero();
                        r.in.req->req8.naming_context                   = &nc;
                        r.in.req->req8.highwatermark.tmp_highest_usn    = 0;
                        r.in.req->req8.highwatermark.reserved_usn       = 0;