r4492: r.in.info is a pointer that needs to be allocated before use
[samba.git] / source4 / torture / rpc / samr.c
index c7456e2fdad3e67b84cdaa3266742bda138caeb5..ea645d72d49d5e25c3813b93d52b88e8f050b758 100644 (file)
@@ -70,7 +70,7 @@ static BOOL test_Shutdown(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
        NTSTATUS status;
        struct samr_Shutdown r;
 
-       if (lp_parm_int(-1, "torture", "dangerous") != 1) {
+       if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
                printf("samr_Shutdown disabled - enable dangerous tests to use\n");
                return True;
        }
@@ -96,7 +96,7 @@ static BOOL test_SetDsrmPassword(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
        struct samr_String string;
        struct samr_Password hash;
 
-       if (lp_parm_int(-1, "torture", "dangerous") != 1) {
+       if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
                printf("samr_SetDsrmPassword disabled - enable dangerous tests to use\n");
                return True;
        }
@@ -629,9 +629,10 @@ static BOOL test_SetAliasInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
 
                r.in.alias_handle = handle;
                r.in.level = levels[i];
+               r.in.info  = talloc_p(mem_ctx, union samr_AliasInfo);
                switch (r.in.level) {
-                   case 2 : init_samr_String(&r.in.info.name,TEST_ALIASNAME); break;
-                   case 3 : init_samr_String(&r.in.info.description,
+                   case 2 : init_samr_String(&r.in.info->name,TEST_ALIASNAME); break;
+                   case 3 : init_samr_String(&r.in.info->description,
                                "Test Description, should test I18N as well"); break;
                }
 
@@ -2176,7 +2177,7 @@ static BOOL test_EnumDomainUsers_async(struct dcerpc_pipe *p, TALLOC_CTX *mem_ct
 #define ASYNC_COUNT 100
        struct rpc_request *req[ASYNC_COUNT];
 
-       if (lp_parm_int(-1, "torture", "dangerous") != 1) {
+       if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
                printf("samr async test disabled - enable dangerous tests to use\n");
                return True;
        }
@@ -2562,7 +2563,7 @@ static BOOL test_GroupList(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
                    !NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES))
                        break;
 
-               for (i=0; i<q1.out.sam->count; i++) {
+               for (i=0; i<q1.out.num_entries; i++) {
                        add_string_to_array(mem_ctx,
                                            q1.out.sam->entries[i].name.string,
                                            &names, &num_names);