diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-10-06 22:28:14 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:07:55 -0500 |
commit | 2151cde58014ea2e822c13d2f8a369b45dc19ca8 (patch) | |
tree | b0cd4c5b394e636232f417bcf482da87d1e18975 /source4/torture/libnet | |
parent | 05e7c481465e3065effaf21b43636d6605d7c313 (diff) | |
download | samba-2151cde58014ea2e822c13d2f8a369b45dc19ca8.tar.gz samba-2151cde58014ea2e822c13d2f8a369b45dc19ca8.tar.bz2 samba-2151cde58014ea2e822c13d2f8a369b45dc19ca8.zip |
r25554: Convert last instances of BOOL, True and False to the standard types.
(This used to be commit 566aa14139510788548a874e9213d91317f83ca9)
Diffstat (limited to 'source4/torture/libnet')
-rw-r--r-- | source4/torture/libnet/domain.c | 22 | ||||
-rw-r--r-- | source4/torture/libnet/groupinfo.c | 22 | ||||
-rw-r--r-- | source4/torture/libnet/groupman.c | 18 | ||||
-rw-r--r-- | source4/torture/libnet/libnet_BecomeDC.c | 24 | ||||
-rw-r--r-- | source4/torture/libnet/libnet_domain.c | 66 | ||||
-rw-r--r-- | source4/torture/libnet/libnet_group.c | 54 | ||||
-rw-r--r-- | source4/torture/libnet/libnet_lookup.c | 32 | ||||
-rw-r--r-- | source4/torture/libnet/libnet_rpc.c | 52 | ||||
-rw-r--r-- | source4/torture/libnet/libnet_share.c | 18 | ||||
-rw-r--r-- | source4/torture/libnet/libnet_user.c | 122 | ||||
-rw-r--r-- | source4/torture/libnet/userinfo.c | 41 | ||||
-rw-r--r-- | source4/torture/libnet/userman.c | 84 | ||||
-rw-r--r-- | source4/torture/libnet/utils.c | 54 | ||||
-rw-r--r-- | source4/torture/libnet/utils.h | 10 |
14 files changed, 309 insertions, 310 deletions
diff --git a/source4/torture/libnet/domain.c b/source4/torture/libnet/domain.c index 329c8a1d23..daf9012e0c 100644 --- a/source4/torture/libnet/domain.c +++ b/source4/torture/libnet/domain.c @@ -25,7 +25,7 @@ #include "librpc/gen_ndr/ndr_samr_c.h" #include "param/param.h" -static BOOL test_domainopen(struct libnet_context *net_ctx, TALLOC_CTX *mem_ctx, +static bool test_domainopen(struct libnet_context *net_ctx, TALLOC_CTX *mem_ctx, struct lsa_String *domname, struct policy_handle *domain_handle) { @@ -40,15 +40,15 @@ static BOOL test_domainopen(struct libnet_context *net_ctx, TALLOC_CTX *mem_ctx, status = libnet_DomainOpen(net_ctx, mem_ctx, &io); if (!NT_STATUS_IS_OK(status)) { printf("Composite domain open failed - %s\n", nt_errstr(status)); - return False; + return false; } *domain_handle = io.out.domain_handle; - return True; + return true; } -static BOOL test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *domain_handle) { NTSTATUS status; @@ -63,20 +63,20 @@ static BOOL test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_Close(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { printf("Close failed - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } -BOOL torture_domainopen(struct torture_context *torture) +bool torture_domainopen(struct torture_context *torture) { NTSTATUS status; struct libnet_context *net_ctx; struct event_context *evt_ctx; TALLOC_CTX *mem_ctx; - BOOL ret = True; + bool ret = true; struct policy_handle h; struct lsa_String name; @@ -90,7 +90,7 @@ BOOL torture_domainopen(struct torture_context *torture) &ndr_table_samr); if (!NT_STATUS_IS_OK(status)) { - return False; + return false; } name.string = lp_workgroup(global_loadparm); @@ -99,12 +99,12 @@ BOOL torture_domainopen(struct torture_context *torture) * Testing synchronous version */ if (!test_domainopen(net_ctx, mem_ctx, &name, &h)) { - ret = False; + ret = false; goto done; } if (!test_cleanup(net_ctx->samr.pipe, mem_ctx, &h)) { - ret = False; + ret = false; goto done; } diff --git a/source4/torture/libnet/groupinfo.c b/source4/torture/libnet/groupinfo.c index 31b49ef70e..bff2f405cd 100644 --- a/source4/torture/libnet/groupinfo.c +++ b/source4/torture/libnet/groupinfo.c @@ -29,7 +29,7 @@ #define TEST_GROUPNAME "libnetgroupinfotest" -static BOOL test_groupinfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_groupinfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *domain_handle, struct dom_sid2 *domain_sid, const char* group_name, uint32_t *rid) @@ -49,7 +49,7 @@ static BOOL test_groupinfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = libnet_rpc_groupinfo(p, mem_ctx, &group); if (!NT_STATUS_IS_OK(status)) { printf("Failed to call sync libnet_rpc_userinfo - %s\n", nt_errstr(status)); - return False; + return false; } ZERO_STRUCT(group); @@ -63,19 +63,19 @@ static BOOL test_groupinfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = libnet_rpc_groupinfo(p, mem_ctx, &group); if (!NT_STATUS_IS_OK(status)) { printf("Failed to call sync libnet_rpc_groupinfo - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } -BOOL torture_groupinfo(struct torture_context *torture) +bool torture_groupinfo(struct torture_context *torture) { NTSTATUS status; struct dcerpc_pipe *p; TALLOC_CTX *mem_ctx; - BOOL ret = True; + bool ret = true; struct policy_handle h; struct lsa_String name; struct dom_sid2 sid; @@ -88,7 +88,7 @@ BOOL torture_groupinfo(struct torture_context *torture) &ndr_table_samr); if (!NT_STATUS_IS_OK(status)) { - return False; + return false; } name.string = lp_workgroup(global_loadparm); @@ -97,22 +97,22 @@ BOOL torture_groupinfo(struct torture_context *torture) * Testing synchronous version */ if (!test_opendomain(p, mem_ctx, &h, &name, &sid)) { - ret = False; + ret = false; goto done; } if (!test_group_create(p, mem_ctx, &h, TEST_GROUPNAME, &rid)) { - ret = False; + ret = false; goto done; } if (!test_groupinfo(p, mem_ctx, &h, &sid, TEST_GROUPNAME, &rid)) { - ret = False; + ret = false; goto done; } if (!test_group_cleanup(p, mem_ctx, &h, TEST_GROUPNAME)) { - ret = False; + ret = false; goto done; } diff --git a/source4/torture/libnet/groupman.c b/source4/torture/libnet/groupman.c index a812f59aea..552e02c420 100644 --- a/source4/torture/libnet/groupman.c +++ b/source4/torture/libnet/groupman.c @@ -27,12 +27,12 @@ #include "torture/libnet/utils.h" -static BOOL test_groupadd(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_groupadd(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *domain_handle, const char *name) { NTSTATUS status; - BOOL ret = True; + bool ret = true; struct libnet_rpc_groupadd group; group.in.domain_handle = *domain_handle; @@ -43,14 +43,14 @@ static BOOL test_groupadd(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = libnet_rpc_groupadd(p, mem_ctx, &group); if (!NT_STATUS_IS_OK(status)) { printf("Failed to call sync libnet_rpc_groupadd - %s\n", nt_errstr(status)); - return False; + return false; } return ret; } -BOOL torture_groupadd(struct torture_context *torture) +bool torture_groupadd(struct torture_context *torture) { NTSTATUS status; struct dcerpc_pipe *p; @@ -59,7 +59,7 @@ BOOL torture_groupadd(struct torture_context *torture) struct dom_sid2 sid; const char *name = TEST_GROUPNAME; TALLOC_CTX *mem_ctx; - BOOL ret = True; + bool ret = true; mem_ctx = talloc_init("test_groupadd"); @@ -68,22 +68,22 @@ BOOL torture_groupadd(struct torture_context *torture) &ndr_table_samr); if (!NT_STATUS_IS_OK(status)) { - return False; + return false; } domain_name.string = lp_workgroup(global_loadparm); if (!test_opendomain(p, mem_ctx, &h, &domain_name, &sid)) { - ret = False; + ret = false; goto done; } if (!test_groupadd(p, mem_ctx, &h, name)) { - ret = False; + ret = false; goto done; } if (!test_group_cleanup(p, mem_ctx, &h, name)) { - ret = False; + ret = false; goto done; } diff --git a/source4/torture/libnet/libnet_BecomeDC.c b/source4/torture/libnet/libnet_BecomeDC.c index 5738e5c620..edcf92b8ec 100644 --- a/source4/torture/libnet/libnet_BecomeDC.c +++ b/source4/torture/libnet/libnet_BecomeDC.c @@ -712,9 +712,9 @@ static NTSTATUS test_become_dc_store_chunk(void *private_data, return NT_STATUS_OK; } -BOOL torture_net_become_dc(struct torture_context *torture) +bool torture_net_become_dc(struct torture_context *torture) { - BOOL ret = True; + bool ret = true; NTSTATUS status; struct libnet_BecomeDC b; struct libnet_UnbecomeDC u; @@ -724,7 +724,7 @@ BOOL torture_net_become_dc(struct torture_context *torture) uint32_t i; s = talloc_zero(torture, struct test_become_dc_state); - if (!s) return False; + if (!s) return false; s->netbios_name = lp_parm_string(global_loadparm, NULL, "become dc", "smbtorture dc"); if (!s->netbios_name || !s->netbios_name[0]) { @@ -751,7 +751,7 @@ BOOL torture_net_become_dc(struct torture_context *torture) if (!s->tj) { DEBUG(0, ("%s failed to join domain as workstation\n", s->netbios_name)); - return False; + return false; } s->ctx = libnet_context_init(torture->ev); @@ -776,27 +776,27 @@ BOOL torture_net_become_dc(struct torture_context *torture) status = libnet_BecomeDC(s->ctx, s, &b); if (!NT_STATUS_IS_OK(status)) { printf("libnet_BecomeDC() failed - %s\n", nt_errstr(status)); - ret = False; + ret = false; goto cleanup; } msg = ldb_msg_new(s); if (!msg) { printf("ldb_msg_new() failed\n"); - ret = False; + ret = false; goto cleanup; } msg->dn = ldb_dn_new(msg, s->ldb, "cn=ROOTDSE"); if (!msg->dn) { printf("ldb_msg_new(cn=ROOTDSE) failed\n"); - ret = False; + ret = false; goto cleanup; } ldb_ret = ldb_msg_add_string(msg, "isSynchronized", "TRUE"); if (ldb_ret != LDB_SUCCESS) { printf("ldb_msg_add_string(msg, isSynchronized, TRUE) failed: %d\n", ldb_ret); - ret = False; + ret = false; goto cleanup; } @@ -808,7 +808,7 @@ BOOL torture_net_become_dc(struct torture_context *torture) ldb_ret = ldb_modify(s->ldb, msg); if (ldb_ret != LDB_SUCCESS) { printf("ldb_modify() failed: %d\n", ldb_ret); - ret = False; + ret = false; goto cleanup; } @@ -823,14 +823,14 @@ BOOL torture_net_become_dc(struct torture_context *torture) if (!s->ldb) { DEBUG(0,("Failed to open '%s'\n", s->path.samdb_ldb)); - ret = False; + ret = false; goto cleanup; } s->schema = dsdb_get_schema(s->ldb); if (!s->schema) { DEBUG(0,("Failed to get loaded dsdb_schema\n")); - ret = False; + ret = false; goto cleanup; } @@ -849,7 +849,7 @@ cleanup: status = libnet_UnbecomeDC(s->ctx, s, &u); if (!NT_STATUS_IS_OK(status)) { printf("libnet_UnbecomeDC() failed - %s\n", nt_errstr(status)); - ret = False; + ret = false; } /* Leave domain. */ diff --git a/source4/torture/libnet/libnet_domain.c b/source4/torture/libnet/libnet_domain.c index a2c0967faa..379cca19be 100644 --- a/source4/torture/libnet/libnet_domain.c +++ b/source4/torture/libnet/libnet_domain.c @@ -33,7 +33,7 @@ #include "param/param.h" -static BOOL test_opendomain_samr(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_opendomain_samr(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct lsa_String *domname, uint32_t *access_mask, struct dom_sid **sid) { @@ -54,7 +54,7 @@ static BOOL test_opendomain_samr(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_Connect(p, mem_ctx, &r1); if (!NT_STATUS_IS_OK(status)) { printf("Connect failed - %s\n", nt_errstr(status)); - return False; + return false; } r2.in.connect_handle = &h; @@ -65,7 +65,7 @@ static BOOL test_opendomain_samr(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_LookupDomain(p, mem_ctx, &r2); if (!NT_STATUS_IS_OK(status)) { printf("LookupDomain failed - %s\n", nt_errstr(status)); - return False; + return false; } r3.in.connect_handle = &h; @@ -78,16 +78,16 @@ static BOOL test_opendomain_samr(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_OpenDomain(p, mem_ctx, &r3); if (!NT_STATUS_IS_OK(status)) { printf("OpenDomain failed - %s\n", nt_errstr(status)); - return False; + return false; } else { *handle = domain_handle; } - return True; + return true; } -static BOOL test_opendomain_lsa(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_opendomain_lsa(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct lsa_String *domname, uint32_t *access_mask) { @@ -115,16 +115,16 @@ static BOOL test_opendomain_lsa(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_lsa_OpenPolicy2(p, mem_ctx, &open); if (!NT_STATUS_IS_OK(status)) { - return False; + return false; } - return True; + return true; } bool torture_domain_open_lsa(struct torture_context *torture) { NTSTATUS status; - BOOL ret = True; + bool ret = true; struct libnet_context *ctx; struct libnet_DomainOpen r; struct lsa_Close lsa_close; @@ -139,7 +139,7 @@ bool torture_domain_open_lsa(struct torture_context *torture) ctx = libnet_context_init(NULL); if (ctx == NULL) { d_printf("failed to create libnet context\n"); - return False; + return false; } ctx->cred = cmdline_credentials; @@ -152,7 +152,7 @@ bool torture_domain_open_lsa(struct torture_context *torture) status = libnet_DomainOpen(ctx, torture, &r); if (!NT_STATUS_IS_OK(status)) { d_printf("failed to open domain on lsa service: %s\n", nt_errstr(status)); - ret = False; + ret = false; goto done; } @@ -163,7 +163,7 @@ bool torture_domain_open_lsa(struct torture_context *torture) status = dcerpc_lsa_Close(ctx->lsa.pipe, ctx, &lsa_close); if (!NT_STATUS_IS_OK(status)) { d_printf("failed to close domain on lsa service: %s\n", nt_errstr(status)); - ret = False; + ret = false; } done: @@ -172,9 +172,9 @@ done: } -BOOL torture_domain_close_lsa(struct torture_context *torture) +bool torture_domain_close_lsa(struct torture_context *torture) { - BOOL ret = True; + bool ret = true; NTSTATUS status; TALLOC_CTX *mem_ctx=NULL; struct libnet_context *ctx; @@ -193,7 +193,7 @@ BOOL torture_domain_close_lsa(struct torture_context *torture) ctx = libnet_context_init(NULL); if (ctx == NULL) { d_printf("failed to create libnet context\n"); - ret = False; + ret = false; goto done; } @@ -204,7 +204,7 @@ BOOL torture_domain_close_lsa(struct torture_context *torture) cmdline_credentials, NULL); if (!NT_STATUS_IS_OK(status)) { d_printf("failed to connect to server: %s\n", nt_errstr(status)); - ret = False; + ret = false; goto done; } @@ -212,7 +212,7 @@ BOOL torture_domain_close_lsa(struct torture_context *torture) if (!test_opendomain_lsa(p, torture, &h, &domain_name, &access_mask)) { d_printf("failed to open domain on lsa service\n"); - ret = False; + ret = false; goto done; } @@ -230,7 +230,7 @@ BOOL torture_domain_close_lsa(struct torture_context *torture) status = libnet_DomainClose(ctx, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { - ret = False; + ret = false; goto done; } @@ -241,7 +241,7 @@ done: } -BOOL torture_domain_open_samr(struct torture_context *torture) +bool torture_domain_open_samr(struct torture_context *torture) { NTSTATUS status; struct libnet_context *ctx; @@ -251,7 +251,7 @@ BOOL torture_domain_open_samr(struct torture_context *torture) struct libnet_DomainOpen io; struct samr_Close r; const char *domain_name; - BOOL ret = True; + bool ret = true; mem_ctx = talloc_init("test_domainopen_lsa"); @@ -275,7 +275,7 @@ BOOL torture_domain_open_samr(struct torture_context *torture) status = libnet_DomainOpen(ctx, mem_ctx, &io); if (!NT_STATUS_IS_OK(status)) { printf("Composite domain open failed - %s\n", nt_errstr(status)); - ret = False; + ret = false; goto done; } @@ -289,7 +289,7 @@ BOOL torture_domain_open_samr(struct torture_context *torture) status = dcerpc_samr_Close(ctx->samr.pipe, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { printf("Close failed - %s\n", nt_errstr(status)); - ret = False; + ret = false; goto done; } @@ -301,9 +301,9 @@ done: } -BOOL torture_domain_close_samr(struct torture_context *torture) +bool torture_domain_close_samr(struct torture_context *torture) { - BOOL ret = True; + bool ret = true; NTSTATUS status; TALLOC_CTX *mem_ctx = NULL; struct libnet_context *ctx; @@ -323,7 +323,7 @@ BOOL torture_domain_close_samr(struct torture_context *torture) ctx = libnet_context_init(NULL); if (ctx == NULL) { d_printf("failed to create libnet context\n"); - ret = False; + ret = false; goto done; } @@ -334,7 +334,7 @@ BOOL torture_domain_close_samr(struct torture_context *torture) ctx->cred, NULL); if (!NT_STATUS_IS_OK(status)) { d_printf("failed to connect to server: %s\n", nt_errstr(status)); - ret = False; + ret = false; goto done; } @@ -342,7 +342,7 @@ BOOL torture_domain_close_samr(struct torture_context *torture) if (!test_opendomain_samr(p, torture, &h, &domain_name, &access_mask, &sid)) { d_printf("failed to open domain on samr service\n"); - ret = False; + ret = false; goto done; } @@ -362,7 +362,7 @@ BOOL torture_domain_close_samr(struct torture_context *torture) status = libnet_DomainClose(ctx, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { - ret = False; + ret = false; goto done; } @@ -373,9 +373,9 @@ done: } -BOOL torture_domain_list(struct torture_context *torture) +bool torture_domain_list(struct torture_context *torture) { - BOOL ret = True; + bool ret = true; NTSTATUS status; TALLOC_CTX *mem_ctx = NULL; struct dcerpc_binding *binding; @@ -391,7 +391,7 @@ BOOL torture_domain_list(struct torture_context *torture) ctx = libnet_context_init(NULL); if (ctx == NULL) { d_printf("failed to create libnet context\n"); - ret = False; + ret = false; goto done; } @@ -408,7 +408,7 @@ BOOL torture_domain_list(struct torture_context *torture) status = libnet_DomainList(ctx, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { - ret = False; + ret = false; goto done; } @@ -429,7 +429,7 @@ BOOL torture_domain_list(struct torture_context *torture) status = libnet_DomainList(ctx, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { - ret = False; + ret = false; goto done; } diff --git a/source4/torture/libnet/libnet_group.c b/source4/torture/libnet/libnet_group.c index 7089bd83fc..a4489d376d 100644 --- a/source4/torture/libnet/libnet_group.c +++ b/source4/torture/libnet/libnet_group.c @@ -32,7 +32,7 @@ #define TEST_GROUPNAME "libnetgrouptest" -static BOOL test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *domain_handle, const char *groupname) { NTSTATUS status; @@ -54,7 +54,7 @@ static BOOL test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_LookupNames(p, mem_ctx, &r1); if (!NT_STATUS_IS_OK(status)) { printf("LookupNames failed - %s\n", nt_errstr(status)); - return False; + return false; } rid = r1.out.rids.ids[0]; @@ -69,7 +69,7 @@ static BOOL test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_OpenGroup(p, mem_ctx, &r2); if (!NT_STATUS_IS_OK(status)) { printf("OpenGroup failed - %s\n", nt_errstr(status)); - return False; + return false; } r3.in.group_handle = &group_handle; @@ -80,14 +80,14 @@ static BOOL test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_DeleteDomainGroup(p, mem_ctx, &r3); if (!NT_STATUS_IS_OK(status)) { printf("DeleteGroup failed - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } -static BOOL test_creategroup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_creategroup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, const char *name) { NTSTATUS status; @@ -113,7 +113,7 @@ static BOOL test_creategroup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, if (NT_STATUS_EQUAL(status, NT_STATUS_GROUP_EXISTS)) { printf("Group (%s) already exists - attempting to delete and recreate group again\n", name); if (!test_cleanup(p, mem_ctx, handle, TEST_GROUPNAME)) { - return False; + return false; } printf("creating group account\n"); @@ -121,18 +121,18 @@ static BOOL test_creategroup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_CreateDomainGroup(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { printf("CreateGroup failed - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } - return False; + return false; } - return True; + return true; } -static BOOL test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct lsa_String *domname) { NTSTATUS status; @@ -150,7 +150,7 @@ static BOOL test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_Connect(p, mem_ctx, &r1); if (!NT_STATUS_IS_OK(status)) { printf("Connect failed - %s\n", nt_errstr(status)); - return False; + return false; } r2.in.connect_handle = &h; @@ -161,7 +161,7 @@ static BOOL test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_LookupDomain(p, mem_ctx, &r2); if (!NT_STATUS_IS_OK(status)) { printf("LookupDomain failed - %s\n", nt_errstr(status)); - return False; + return false; } r3.in.connect_handle = &h; @@ -174,16 +174,16 @@ static BOOL test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_OpenDomain(p, mem_ctx, &r3); if (!NT_STATUS_IS_OK(status)) { printf("OpenDomain failed - %s\n", nt_errstr(status)); - return False; + return false; } else { *handle = domain_handle; } - return True; + return true; } -static BOOL test_samr_close(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_samr_close(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *domain_handle) { NTSTATUS status; @@ -195,17 +195,17 @@ static BOOL test_samr_close(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_Close(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { printf("Close samr domain failed - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } -BOOL torture_groupinfo_api(struct torture_context *torture) +bool torture_groupinfo_api(struct torture_context *torture) { const char *name = TEST_GROUPNAME; - BOOL ret = True; + bool ret = true; NTSTATUS status; TALLOC_CTX *mem_ctx = NULL, *prep_mem_ctx; struct libnet_context *ctx; @@ -223,17 +223,17 @@ BOOL torture_groupinfo_api(struct torture_context *torture) &p, &ndr_table_samr); if (!NT_STATUS_IS_OK(status)) { - return False; + return false; } domain_name.string = lp_workgroup(global_loadparm); if (!test_opendomain(p, prep_mem_ctx, &h, &domain_name)) { - ret = False; + ret = false; goto done; } if (!test_creategroup(p, prep_mem_ctx, &h, name)) { - ret = False; + ret = false; goto done; } @@ -247,20 +247,20 @@ BOOL torture_groupinfo_api(struct torture_context *torture) status = libnet_GroupInfo(ctx, mem_ctx, &req); if (!NT_STATUS_IS_OK(status)) { printf("libnet_GroupInfo call failed: %s\n", nt_errstr(status)); - ret = False; + ret = false; talloc_free(mem_ctx); goto done; } if (!test_cleanup(ctx->samr.pipe, mem_ctx, &ctx->samr.handle, TEST_GROUPNAME)) { printf("cleanup failed\n"); - ret = False; + ret = false; goto done; } if (!test_samr_close(ctx->samr.pipe, mem_ctx, &ctx->samr.handle)) { printf("domain close failed\n"); - ret = False; + ret = false; } talloc_free(ctx); diff --git a/source4/torture/libnet/libnet_lookup.c b/source4/torture/libnet/libnet_lookup.c index 0d4389c54a..4734ec5088 100644 --- a/source4/torture/libnet/libnet_lookup.c +++ b/source4/torture/libnet/libnet_lookup.c @@ -29,9 +29,9 @@ #include "param/param.h" -BOOL torture_lookup(struct torture_context *torture) +bool torture_lookup(struct torture_context *torture) { - BOOL ret; + bool ret; NTSTATUS status; TALLOC_CTX *mem_ctx; struct libnet_context *ctx; @@ -59,11 +59,11 @@ BOOL torture_lookup(struct torture_context *torture) if (!NT_STATUS_IS_OK(status)) { printf("Couldn't lookup name %s: %s\n", lookup.in.hostname, nt_errstr(status)); - ret = False; + ret = false; goto done; } - ret = True; + ret = true; printf("Name [%s] found at address: %s.\n", lookup.in.hostname, *lookup.out.address); @@ -73,9 +73,9 @@ done: } -BOOL torture_lookup_host(struct torture_context *torture) +bool torture_lookup_host(struct torture_context *torture) { - BOOL ret; + bool ret; NTSTATUS status; TALLOC_CTX *mem_ctx; struct libnet_context *ctx; @@ -102,11 +102,11 @@ BOOL torture_lookup_host(struct torture_context *torture) if (!NT_STATUS_IS_OK(status)) { printf("Couldn't lookup host %s: %s\n", lookup.in.hostname, nt_errstr(status)); - ret = False; + ret = false; goto done; } - ret = True; + ret = true; printf("Host [%s] found at address: %s.\n", lookup.in.hostname, *lookup.out.address); @@ -116,9 +116,9 @@ done: } -BOOL torture_lookup_pdc(struct torture_context *torture) +bool torture_lookup_pdc(struct torture_context *torture) { - BOOL ret; + bool ret; NTSTATUS status; TALLOC_CTX *mem_ctx; struct libnet_context *ctx; @@ -134,7 +134,7 @@ BOOL torture_lookup_pdc(struct torture_context *torture) lookup = talloc(mem_ctx, struct libnet_LookupDCs); if (!lookup) { - ret = False; + ret = false; goto done; } @@ -146,11 +146,11 @@ BOOL torture_lookup_pdc(struct torture_context *torture) if (!NT_STATUS_IS_OK(status)) { printf("Couldn't lookup pdc %s: %s\n", lookup->in.domain_name, nt_errstr(status)); - ret = False; + ret = false; goto done; } - ret = True; + ret = true; printf("DCs of domain [%s] found.\n", lookup->in.domain_name); for (i = 0; i < lookup->out.num_dcs; i++) { @@ -164,7 +164,7 @@ done: } -BOOL torture_lookup_sam_name(struct torture_context *torture) +bool torture_lookup_sam_name(struct torture_context *torture) { NTSTATUS status; TALLOC_CTX *mem_ctx; @@ -175,7 +175,7 @@ BOOL torture_lookup_sam_name(struct torture_context *torture) ctx->cred = cmdline_credentials; mem_ctx = talloc_init("torture lookup sam name"); - if (mem_ctx == NULL) return False; + if (mem_ctx == NULL) return false; r.in.name = "Administrator"; r.in.domain_name = lp_workgroup(global_loadparm); @@ -185,5 +185,5 @@ BOOL torture_lookup_sam_name(struct torture_context *torture) talloc_free(mem_ctx); talloc_free(ctx); - return True; + return true; } diff --git a/source4/torture/libnet/libnet_rpc.c b/source4/torture/libnet/libnet_rpc.c index bb9a8d2f34..5ca927a1e3 100644 --- a/source4/torture/libnet/libnet_rpc.c +++ b/source4/torture/libnet/libnet_rpc.c @@ -33,12 +33,12 @@ #include "param/param.h" -static BOOL test_connect_service(struct libnet_context *ctx, +static bool test_connect_service(struct libnet_context *ctx, const struct ndr_interface_table *iface, const char *binding_string, const char *hostname, const enum libnet_RpcConnect_level level, - BOOL badcreds, NTSTATUS expected_status) + bool badcreds, NTSTATUS expected_status) { NTSTATUS status; struct libnet_RpcConnect connect; @@ -62,7 +62,7 @@ static BOOL test_connect_service(struct libnet_context *ctx, connect.in.dcerpc_iface->name, connect.in.binding, nt_errstr(expected_status), nt_errstr(status)); - return False; + return false; } d_printf("PASSED. Expected: %s, received: %s\n", nt_errstr(expected_status), @@ -79,11 +79,11 @@ static BOOL test_connect_service(struct libnet_context *ctx, d_printf("Error string: %s\n", connect.out.error_string); } - return True; + return true; } -static BOOL torture_rpc_connect(struct torture_context *torture, +static bool torture_rpc_connect(struct torture_context *torture, const enum libnet_RpcConnect_level level, const char *bindstr, const char *hostname) { @@ -94,46 +94,46 @@ static BOOL torture_rpc_connect(struct torture_context *torture, d_printf("Testing connection to LSA interface\n"); if (!test_connect_service(ctx, &ndr_table_lsarpc, bindstr, - hostname, level, False, NT_STATUS_OK)) { + hostname, level, false, NT_STATUS_OK)) { d_printf("failed to connect LSA interface\n"); - return False; + return false; } d_printf("Testing connection to SAMR interface\n"); if (!test_connect_service(ctx, &ndr_table_samr, bindstr, - hostname, level, False, NT_STATUS_OK)) { + hostname, level, false, NT_STATUS_OK)) { d_printf("failed to connect SAMR interface\n"); - return False; + return false; } d_printf("Testing connection to SRVSVC interface\n"); if (!test_connect_service(ctx, &ndr_table_srvsvc, bindstr, - hostname, level, False, NT_STATUS_OK)) { + hostname, level, false, NT_STATUS_OK)) { d_printf("failed to connect SRVSVC interface\n"); - return False; + return false; } d_printf("Testing connection to LSA interface with wrong credentials\n"); if (!test_connect_service(ctx, &ndr_table_lsarpc, bindstr, - hostname, level, True, NT_STATUS_LOGON_FAILURE)) { + hostname, level, true, NT_STATUS_LOGON_FAILURE)) { d_printf("failed to test wrong credentials on LSA interface\n"); - return False; + return false; } d_printf("Testing connection to SAMR interface with wrong credentials\n"); if (!test_connect_service(ctx, &ndr_table_samr, bindstr, - hostname, level, True, NT_STATUS_LOGON_FAILURE)) { + hostname, level, true, NT_STATUS_LOGON_FAILURE)) { d_printf("failed to test wrong credentials on SAMR interface\n"); - return False; + return false; } talloc_free(ctx); - return True; + return true; } -BOOL torture_rpc_connect_srv(struct torture_context *torture) +bool torture_rpc_connect_srv(struct torture_context *torture) { const enum libnet_RpcConnect_level level = LIBNET_RPC_CONNECT_SERVER; NTSTATUS status; @@ -141,14 +141,14 @@ BOOL torture_rpc_connect_srv(struct torture_context *torture) status = torture_rpc_binding(torture, &binding); if (!NT_STATUS_IS_OK(status)) { - return False; + return false; } return torture_rpc_connect(torture, level, NULL, binding->host); } -BOOL torture_rpc_connect_pdc(struct torture_context *torture) +bool torture_rpc_connect_pdc(struct torture_context *torture) { const enum libnet_RpcConnect_level level = LIBNET_RPC_CONNECT_PDC; NTSTATUS status; @@ -157,7 +157,7 @@ BOOL torture_rpc_connect_pdc(struct torture_context *torture) status = torture_rpc_binding(torture, &binding); if (!NT_STATUS_IS_OK(status)) { - return False; + return false; } /* we're accessing domain controller so the domain name should be @@ -168,7 +168,7 @@ BOOL torture_rpc_connect_pdc(struct torture_context *torture) } -BOOL torture_rpc_connect_dc(struct torture_context *torture) +bool torture_rpc_connect_dc(struct torture_context *torture) { const enum libnet_RpcConnect_level level = LIBNET_RPC_CONNECT_DC; NTSTATUS status; @@ -177,7 +177,7 @@ BOOL torture_rpc_connect_dc(struct torture_context *torture) status = torture_rpc_binding(torture, &binding); if (!NT_STATUS_IS_OK(status)) { - return False; + return false; } /* we're accessing domain controller so the domain name should be @@ -188,7 +188,7 @@ BOOL torture_rpc_connect_dc(struct torture_context *torture) } -BOOL torture_rpc_connect_dc_info(struct torture_context *torture) +bool torture_rpc_connect_dc_info(struct torture_context *torture) { const enum libnet_RpcConnect_level level = LIBNET_RPC_CONNECT_DC_INFO; NTSTATUS status; @@ -197,7 +197,7 @@ BOOL torture_rpc_connect_dc_info(struct torture_context *torture) status = torture_rpc_binding(torture, &binding); if (!NT_STATUS_IS_OK(status)) { - return False; + return false; } /* we're accessing domain controller so the domain name should be @@ -208,7 +208,7 @@ BOOL torture_rpc_connect_dc_info(struct torture_context *torture) } -BOOL torture_rpc_connect_binding(struct torture_context *torture) +bool torture_rpc_connect_binding(struct torture_context *torture) { const enum libnet_RpcConnect_level level = LIBNET_RPC_CONNECT_BINDING; NTSTATUS status; @@ -217,7 +217,7 @@ BOOL torture_rpc_connect_binding(struct torture_context *torture) status = torture_rpc_binding(torture, &binding); if (!NT_STATUS_IS_OK(status)) { - return False; + return false; } bindstr = dcerpc_binding_string(torture, binding); diff --git a/source4/torture/libnet/libnet_share.c b/source4/torture/libnet/libnet_share.c index b1657c0922..d18e6ea9db 100644 --- a/source4/torture/libnet/libnet_share.c +++ b/source4/torture/libnet/libnet_share.c @@ -113,13 +113,13 @@ static void test_displayshares(struct libnet_ListShares s) } -BOOL torture_listshares(struct torture_context *torture) +bool torture_listshares(struct torture_context *torture) { struct libnet_ListShares share; NTSTATUS status; uint32_t levels[] = { 0, 1, 2, 501, 502 }; int i; - BOOL ret = True; + bool ret = true; struct libnet_context* libnetctx; struct dcerpc_binding *bind; TALLOC_CTX *mem_ctx; @@ -127,14 +127,14 @@ BOOL torture_listshares(struct torture_context *torture) mem_ctx = talloc_init("test_listshares"); status = torture_rpc_binding(torture, &bind); if (!NT_STATUS_IS_OK(status)) { - ret = False; + ret = false; goto done; } libnetctx = libnet_context_init(NULL); if (!libnetctx) { printf("Couldn't allocate libnet context\n"); - ret = False; + ret = false; goto done; } @@ -151,7 +151,7 @@ BOOL torture_listshares(struct torture_context *torture) status = libnet_ListShares(libnetctx, mem_ctx, &share); if (!NT_STATUS_IS_OK(status)) { printf("libnet_ListShare level %u failed - %s\n", share.in.level, share.out.error_string); - ret = False; + ret = false; goto done; } @@ -165,7 +165,7 @@ done: } -static BOOL test_addshare(struct dcerpc_pipe *svc_pipe, TALLOC_CTX *mem_ctx, const char *host, +static bool test_addshare(struct dcerpc_pipe *svc_pipe, TALLOC_CTX *mem_ctx, const char *host, const char* share) { NTSTATUS status; @@ -187,11 +187,11 @@ static BOOL test_addshare(struct dcerpc_pipe *svc_pipe, TALLOC_CTX *mem_ctx, con status = dcerpc_srvsvc_NetShareAdd(svc_pipe, mem_ctx, &add); if (!NT_STATUS_IS_OK(status)) { printf("Failed to add a new share\n"); - return False; + return false; } printf("share added\n"); - return True; + return true; } @@ -202,7 +202,7 @@ bool torture_delshare(struct torture_context *torture) struct libnet_context* libnetctx; const char *host; NTSTATUS status; - BOOL ret = True; + bool ret = true; struct libnet_DelShare share; host = torture_setting_string(torture, "host", NULL); diff --git a/source4/torture/libnet/libnet_user.c b/source4/torture/libnet/libnet_user.c index 640816b891..b3aadc776e 100644 --- a/source4/torture/libnet/libnet_user.c +++ b/source4/torture/libnet/libnet_user.c @@ -30,7 +30,7 @@ #include "param/param.h" -static BOOL test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *domain_handle, const char *username) { NTSTATUS status; @@ -52,7 +52,7 @@ static BOOL test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_LookupNames(p, mem_ctx, &r1); if (!NT_STATUS_IS_OK(status)) { printf("LookupNames failed - %s\n", nt_errstr(status)); - return False; + return false; } rid = r1.out.rids.ids[0]; @@ -67,7 +67,7 @@ static BOOL test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_OpenUser(p, mem_ctx, &r2); if (!NT_STATUS_IS_OK(status)) { printf("OpenUser failed - %s\n", nt_errstr(status)); - return False; + return false; } r3.in.user_handle = &user_handle; @@ -78,14 +78,14 @@ static BOOL test_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_DeleteUser(p, mem_ctx, &r3); if (!NT_STATUS_IS_OK(status)) { printf("DeleteUser failed - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } -static BOOL test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct lsa_String *domname) { NTSTATUS status; @@ -103,7 +103,7 @@ static BOOL test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_Connect(p, mem_ctx, &r1); if (!NT_STATUS_IS_OK(status)) { printf("Connect failed - %s\n", nt_errstr(status)); - return False; + return false; } r2.in.connect_handle = &h; @@ -114,7 +114,7 @@ static BOOL test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_LookupDomain(p, mem_ctx, &r2); if (!NT_STATUS_IS_OK(status)) { printf("LookupDomain failed - %s\n", nt_errstr(status)); - return False; + return false; } r3.in.connect_handle = &h; @@ -127,16 +127,16 @@ static BOOL test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_OpenDomain(p, mem_ctx, &r3); if (!NT_STATUS_IS_OK(status)) { printf("OpenDomain failed - %s\n", nt_errstr(status)); - return False; + return false; } else { *handle = domain_handle; } - return True; + return true; } -static BOOL test_samr_close(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_samr_close(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *domain_handle) { NTSTATUS status; @@ -148,14 +148,14 @@ static BOOL test_samr_close(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_Close(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { printf("Close samr domain failed - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } -static BOOL test_lsa_close(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_lsa_close(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *domain_handle) { NTSTATUS status; @@ -167,14 +167,14 @@ static BOOL test_lsa_close(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_lsa_Close(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { printf("Close lsa domain failed - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } -static BOOL test_createuser(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_createuser(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, const char* user) { NTSTATUS status; @@ -201,7 +201,7 @@ static BOOL test_createuser(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, if (NT_STATUS_EQUAL(status, NT_STATUS_USER_EXISTS)) { printf("User (%s) already exists - attempting to delete and recreate account again\n", user); if (!test_cleanup(p, mem_ctx, handle, TEST_USERNAME)) { - return False; + return false; } printf("creating user account\n"); @@ -209,11 +209,11 @@ static BOOL test_createuser(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_CreateUser(p, mem_ctx, &r1); if (!NT_STATUS_IS_OK(status)) { printf("CreateUser failed - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } - return False; + return false; } r2.in.handle = &user_handle; @@ -224,20 +224,20 @@ static BOOL test_createuser(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_Close(p, mem_ctx, &r2); if (!NT_STATUS_IS_OK(status)) { printf("Close failed - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } -BOOL torture_createuser(struct torture_context *torture) +bool torture_createuser(struct torture_context *torture) { NTSTATUS status; TALLOC_CTX *mem_ctx; struct libnet_context *ctx; struct libnet_CreateUser req; - BOOL ret = True; + bool ret = true; mem_ctx = talloc_init("test_createuser"); @@ -251,19 +251,19 @@ BOOL torture_createuser(struct torture_context *torture) status = libnet_CreateUser(ctx, mem_ctx, &req); if (!NT_STATUS_IS_OK(status)) { printf("libnet_CreateUser call failed: %s\n", nt_errstr(status)); - ret = False; + ret = false; goto done; } if (!test_cleanup(ctx->samr.pipe, mem_ctx, &ctx->samr.handle, TEST_USERNAME)) { printf("cleanup failed\n"); - ret = False; + ret = false; goto done; } if (!test_samr_close(ctx->samr.pipe, mem_ctx, &ctx->samr.handle)) { printf("domain close failed\n"); - ret = False; + ret = false; } done: @@ -273,7 +273,7 @@ done: } -BOOL torture_deleteuser(struct torture_context *torture) +bool torture_deleteuser(struct torture_context *torture) { NTSTATUS status; struct dcerpc_pipe *p; @@ -283,7 +283,7 @@ BOOL torture_deleteuser(struct torture_context *torture) const char *name = TEST_USERNAME; struct libnet_context *ctx; struct libnet_DeleteUser req; - BOOL ret = True; + bool ret = true; prep_mem_ctx = talloc_init("prepare test_deleteuser"); @@ -297,18 +297,18 @@ BOOL torture_deleteuser(struct torture_context *torture) &p, &ndr_table_samr); if (!NT_STATUS_IS_OK(status)) { - ret = False; + ret = false; goto done; } domain_name.string = lp_workgroup(global_loadparm); if (!test_opendomain(p, prep_mem_ctx, &h, &domain_name)) { - ret = False; + ret = false; goto done; } if (!test_createuser(p, prep_mem_ctx, &h, name)) { - ret = False; + ret = false; goto done; } @@ -317,7 +317,7 @@ BOOL torture_deleteuser(struct torture_context *torture) status = libnet_DeleteUser(ctx, mem_ctx, &req); if (!NT_STATUS_IS_OK(status)) { printf("libnet_DeleteUser call failed: %s\n", nt_errstr(status)); - ret = False; + ret = false; } talloc_free(mem_ctx); @@ -439,26 +439,26 @@ static void set_test_changes(TALLOC_CTX *mem_ctx, struct libnet_ModifyUser *r, #define TEST_STR_FLD(fld) \ if (!strequal(req.in.fld, user_req.out.fld)) { \ printf("failed to change '%s'\n", #fld); \ - ret = False; \ + ret = false; \ goto cleanup; \ } #define TEST_TIME_FLD(fld) \ if (timeval_compare(req.in.fld, user_req.out.fld)) { \ printf("failed to change '%s'\n", #fld); \ - ret = False; \ + ret = false; \ goto cleanup; \ } #define TEST_NUM_FLD(fld) \ if (req.in.fld != user_req.out.fld) { \ printf("failed to change '%s'\n", #fld); \ - ret = False; \ + ret = false; \ goto cleanup; \ } -BOOL torture_modifyuser(struct torture_context *torture) +bool torture_modifyuser(struct torture_context *torture) { NTSTATUS status; struct dcerpc_binding *bind; @@ -471,7 +471,7 @@ BOOL torture_modifyuser(struct torture_context *torture) struct libnet_ModifyUser req; struct libnet_UserInfo user_req; int fld; - BOOL ret = True; + bool ret = true; prep_mem_ctx = talloc_init("prepare test_deleteuser"); @@ -482,7 +482,7 @@ BOOL torture_modifyuser(struct torture_context *torture) &p, &ndr_table_samr); if (!NT_STATUS_IS_OK(status)) { - ret = False; + ret = false; goto done; } @@ -490,12 +490,12 @@ BOOL torture_modifyuser(struct torture_context *torture) domain_name.string = lp_workgroup(global_loadparm); if (!test_opendomain(p, prep_mem_ctx, &h, &domain_name)) { - ret = False; + ret = false; goto done; } if (!test_createuser(p, prep_mem_ctx, &h, name)) { - ret = False; + ret = false; goto done; } @@ -503,7 +503,7 @@ BOOL torture_modifyuser(struct torture_context *torture) status = torture_rpc_binding(mem_ctx, &bind); if (!NT_STATUS_IS_OK(status)) { - ret = False; + ret = false; goto done; } @@ -519,7 +519,7 @@ BOOL torture_modifyuser(struct torture_context *torture) status = libnet_ModifyUser(ctx, mem_ctx, &req); if (!NT_STATUS_IS_OK(status)) { printf("libnet_ModifyUser call failed: %s\n", nt_errstr(status)); - ret = False; + ret = false; continue; } @@ -530,7 +530,7 @@ BOOL torture_modifyuser(struct torture_context *torture) status = libnet_UserInfo(ctx, mem_ctx, &user_req); if (!NT_STATUS_IS_OK(status)) { printf("libnet_UserInfo call failed: %s\n", nt_errstr(status)); - ret = False; + ret = false; continue; } @@ -571,7 +571,7 @@ BOOL torture_modifyuser(struct torture_context *torture) if (!NT_STATUS_IS_OK(status)) { printf("libnet_ModifyUser call failed: %s\n", nt_errstr(status)); talloc_free(mem_ctx); - ret = False; + ret = false; goto done; } @@ -582,13 +582,13 @@ BOOL torture_modifyuser(struct torture_context *torture) cleanup: if (!test_cleanup(ctx->samr.pipe, mem_ctx, &ctx->samr.handle, name)) { printf("cleanup failed\n"); - ret = False; + ret = false; goto done; } if (!test_samr_close(ctx->samr.pipe, mem_ctx, &ctx->samr.handle)) { printf("domain close failed\n"); - ret = False; + ret = false; } talloc_free(mem_ctx); @@ -600,10 +600,10 @@ done: } -BOOL torture_userinfo_api(struct torture_context *torture) +bool torture_userinfo_api(struct torture_context *torture) { const char *name = TEST_USERNAME; - BOOL ret = True; + bool ret = true; NTSTATUS status; TALLOC_CTX *mem_ctx = NULL, *prep_mem_ctx; struct libnet_context *ctx; @@ -621,17 +621,17 @@ BOOL torture_userinfo_api(struct torture_context *torture) &p, &ndr_table_samr); if (!NT_STATUS_IS_OK(status)) { - return False; + return false; } domain_name.string = lp_workgroup(global_loadparm); if (!test_opendomain(p, prep_mem_ctx, &h, &domain_name)) { - ret = False; + ret = false; goto done; } if (!test_createuser(p, prep_mem_ctx, &h, name)) { - ret = False; + ret = false; goto done; } @@ -645,20 +645,20 @@ BOOL torture_userinfo_api(struct torture_context *torture) status = libnet_UserInfo(ctx, mem_ctx, &req); if (!NT_STATUS_IS_OK(status)) { printf("libnet_UserInfo call failed: %s\n", nt_errstr(status)); - ret = False; + ret = false; talloc_free(mem_ctx); goto done; } if (!test_cleanup(ctx->samr.pipe, mem_ctx, &ctx->samr.handle, TEST_USERNAME)) { printf("cleanup failed\n"); - ret = False; + ret = false; goto done; } if (!test_samr_close(ctx->samr.pipe, mem_ctx, &ctx->samr.handle)) { printf("domain close failed\n"); - ret = False; + ret = false; } talloc_free(ctx); @@ -669,9 +669,9 @@ done: } -BOOL torture_userlist(struct torture_context *torture) +bool torture_userlist(struct torture_context *torture) { - BOOL ret = True; + bool ret = true; NTSTATUS status; TALLOC_CTX *mem_ctx = NULL; struct libnet_context *ctx; @@ -707,19 +707,19 @@ BOOL torture_userlist(struct torture_context *torture) if (!(NT_STATUS_IS_OK(status) || NT_STATUS_EQUAL(status, NT_STATUS_NO_MORE_ENTRIES))) { printf("libnet_UserList call failed: %s\n", nt_errstr(status)); - ret = False; + ret = false; goto done; } if (!test_samr_close(ctx->samr.pipe, mem_ctx, &ctx->samr.handle)) { printf("samr domain close failed\n"); - ret = False; + ret = false; goto done; } if (!test_lsa_close(ctx->lsa.pipe, mem_ctx, &ctx->lsa.handle)) { printf("lsa domain close failed\n"); - ret = False; + ret = false; } talloc_free(ctx); diff --git a/source4/torture/libnet/userinfo.c b/source4/torture/libnet/userinfo.c index 731731865b..46a9a6a015 100644 --- a/source4/torture/libnet/userinfo.c +++ b/source4/torture/libnet/userinfo.c @@ -29,8 +29,7 @@ #define TEST_USERNAME "libnetuserinfotest" - -static BOOL test_userinfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_userinfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *domain_handle, struct dom_sid2 *domain_sid, const char* user_name, uint32_t *rid) @@ -50,7 +49,7 @@ static BOOL test_userinfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = libnet_rpc_userinfo(p, mem_ctx, &user); if (!NT_STATUS_IS_OK(status)) { printf("Failed to call sync libnet_rpc_userinfo - %s\n", nt_errstr(status)); - return False; + return false; } ZERO_STRUCT(user); @@ -64,14 +63,14 @@ static BOOL test_userinfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = libnet_rpc_userinfo(p, mem_ctx, &user); if (!NT_STATUS_IS_OK(status)) { printf("Failed to call sync libnet_rpc_userinfo - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } -static BOOL test_userinfo_async(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_userinfo_async(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *domain_handle, struct dom_sid2 *domain_sid, const char* user_name, uint32_t *rid) @@ -93,13 +92,13 @@ static BOOL test_userinfo_async(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, c = libnet_rpc_userinfo_send(p, &user, msg_handler); if (!c) { printf("Failed to call sync libnet_rpc_userinfo_send\n"); - return False; + return false; } status = libnet_rpc_userinfo_recv(c, mem_ctx, &user); if (!NT_STATUS_IS_OK(status)) { printf("Calling async libnet_rpc_userinfo failed - %s\n", nt_errstr(status)); - return False; + return false; } ZERO_STRUCT(user); @@ -114,16 +113,16 @@ static BOOL test_userinfo_async(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, c = libnet_rpc_userinfo_send(p, &user, msg_handler); if (!c) { printf("Failed to call sync libnet_rpc_userinfo_send\n"); - return False; + return false; } status = libnet_rpc_userinfo_recv(c, mem_ctx, &user); if (!NT_STATUS_IS_OK(status)) { printf("Calling async libnet_rpc_userinfo failed - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } @@ -132,7 +131,7 @@ bool torture_userinfo(struct torture_context *torture) NTSTATUS status; struct dcerpc_pipe *p; TALLOC_CTX *mem_ctx; - BOOL ret = True; + bool ret = true; struct policy_handle h; struct lsa_String name; struct dom_sid2 sid; @@ -145,7 +144,7 @@ bool torture_userinfo(struct torture_context *torture) &ndr_table_samr); if (!NT_STATUS_IS_OK(status)) { - return False; + return false; } name.string = lp_workgroup(global_loadparm); @@ -154,22 +153,22 @@ bool torture_userinfo(struct torture_context *torture) * Testing synchronous version */ if (!test_opendomain(p, mem_ctx, &h, &name, &sid)) { - ret = False; + ret = false; goto done; } if (!test_user_create(p, mem_ctx, &h, TEST_USERNAME, &rid)) { - ret = False; + ret = false; goto done; } if (!test_userinfo(p, mem_ctx, &h, &sid, TEST_USERNAME, &rid)) { - ret = False; + ret = false; goto done; } if (!test_user_cleanup(p, mem_ctx, &h, TEST_USERNAME)) { - ret = False; + ret = false; goto done; } @@ -177,22 +176,22 @@ bool torture_userinfo(struct torture_context *torture) * Testing asynchronous version and monitor messages */ if (!test_opendomain(p, mem_ctx, &h, &name, &sid)) { - ret = False; + ret = false; goto done; } if (!test_user_create(p, mem_ctx, &h, TEST_USERNAME, &rid)) { - ret = False; + ret = false; goto done; } if (!test_userinfo_async(p, mem_ctx, &h, &sid, TEST_USERNAME, &rid)) { - ret = False; + ret = false; goto done; } if (!test_user_cleanup(p, mem_ctx, &h, TEST_USERNAME)) { - ret = False; + ret = false; goto done; } diff --git a/source4/torture/libnet/userman.c b/source4/torture/libnet/userman.c index ff2f2d5265..e834938bc5 100644 --- a/source4/torture/libnet/userman.c +++ b/source4/torture/libnet/userman.c @@ -24,15 +24,16 @@ #include "libnet/libnet.h" #include "librpc/gen_ndr/ndr_samr_c.h" #include "param/param.h" + #include "torture/libnet/utils.h" -static BOOL test_useradd(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_useradd(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *domain_handle, const char *name) { NTSTATUS status; - BOOL ret = True; + bool ret = true; struct libnet_rpc_useradd user; user.in.domain_handle = *domain_handle; @@ -43,14 +44,14 @@ static BOOL test_useradd(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = libnet_rpc_useradd(p, mem_ctx, &user); if (!NT_STATUS_IS_OK(status)) { printf("Failed to call libnet_rpc_useradd - %s\n", nt_errstr(status)); - return False; + return false; } return ret; } -static BOOL test_useradd_async(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_useradd_async(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, const char* username) { NTSTATUS status; @@ -65,21 +66,20 @@ static BOOL test_useradd_async(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, c = libnet_rpc_useradd_send(p, &user, msg_handler); if (!c) { printf("Failed to call async libnet_rpc_useradd\n"); - return False; + return false; } status = libnet_rpc_useradd_recv(c, mem_ctx, &user); if (!NT_STATUS_IS_OK(status)) { printf("Calling async libnet_rpc_useradd failed - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } - -static BOOL test_usermod(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_usermod(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, int num_changes, struct libnet_rpc_usermod *mod, char **username) { @@ -206,14 +206,14 @@ static BOOL test_usermod(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = libnet_rpc_usermod(p, mem_ctx, mod); if (!NT_STATUS_IS_OK(status)) { printf("Failed to call sync libnet_rpc_usermod - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } -static BOOL test_userdel(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_userdel(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, const char *username) { NTSTATUS status; @@ -225,10 +225,10 @@ static BOOL test_userdel(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = libnet_rpc_userdel(p, mem_ctx, &user); if (!NT_STATUS_IS_OK(status)) { printf("Failed to call sync libnet_rpc_userdel - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } @@ -238,7 +238,7 @@ static BOOL test_userdel(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, printf("'%s' field does not match\n", #fld); \ printf("received: '%s'\n", i->fld.string); \ printf("expected: '%s'\n", mod->in.change.fld); \ - return False; \ + return false; \ } @@ -252,7 +252,7 @@ static BOOL test_userdel(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, printf("expected: '%s (+%ld us)'\n", \ timestring(mem_ctx, mod->in.change.fld->tv_sec), \ mod->in.change.fld->tv_usec); \ - return False; \ + return false; \ } \ } @@ -262,11 +262,11 @@ static BOOL test_userdel(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, printf("'%s' field does not match\n", #fld); \ printf("received: '%04x'\n", i->fld); \ printf("expected: '%04x'\n", mod->in.change.fld); \ - return False; \ + return false; \ } -static BOOL test_compare(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +static bool test_compare(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct libnet_rpc_usermod *mod, const char *username) { @@ -284,7 +284,7 @@ static BOOL test_compare(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = libnet_rpc_userinfo(p, mem_ctx, &info); if (!NT_STATUS_IS_OK(status)) { printf("Failed to call sync libnet_rpc_userinfo - %s\n", nt_errstr(status)); - return False; + return false; } i = &info.out.info.info21; @@ -300,11 +300,11 @@ static BOOL test_compare(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, CMP_TIME_FLD(acct_expiry, USERMOD_FIELD_ACCT_EXPIRY); CMP_NUM_FLD(acct_flags, USERMOD_FIELD_ACCT_FLAGS) - return True; + return true; } -BOOL torture_useradd(struct torture_context *torture) +bool torture_useradd(struct torture_context *torture) { NTSTATUS status; struct dcerpc_pipe *p; @@ -313,7 +313,7 @@ BOOL torture_useradd(struct torture_context *torture) struct dom_sid2 sid; const char *name = TEST_USERNAME; TALLOC_CTX *mem_ctx; - BOOL ret = True; + bool ret = true; mem_ctx = talloc_init("test_useradd"); @@ -322,37 +322,37 @@ BOOL torture_useradd(struct torture_context *torture) &ndr_table_samr); if (!NT_STATUS_IS_OK(status)) { - return False; + return false; } domain_name.string = lp_workgroup(global_loadparm); if (!test_opendomain(p, mem_ctx, &h, &domain_name, &sid)) { - ret = False; + ret = false; goto done; } if (!test_useradd(p, mem_ctx, &h, name)) { - ret = False; + ret = false; goto done; } if (!test_user_cleanup(p, mem_ctx, &h, name)) { - ret = False; + ret = false; goto done; } if (!test_opendomain(p, mem_ctx, &h, &domain_name, &sid)) { - ret = False; + ret = false; goto done; } if (!test_useradd_async(p, mem_ctx, &h, name)) { - ret = False; + ret = false; goto done; } if (!test_user_cleanup(p, mem_ctx, &h, name)) { - ret = False; + ret = false; goto done; } @@ -372,7 +372,7 @@ bool torture_userdel(struct torture_context *torture) uint32_t rid; const char *name = TEST_USERNAME; TALLOC_CTX *mem_ctx; - BOOL ret = True; + bool ret = true; mem_ctx = talloc_init("test_userdel"); @@ -381,22 +381,22 @@ bool torture_userdel(struct torture_context *torture) &ndr_table_samr); if (!NT_STATUS_IS_OK(status)) { - return False; + return false; } domain_name.string = lp_workgroup(global_loadparm); if (!test_opendomain(p, mem_ctx, &h, &domain_name, &sid)) { - ret = False; + ret = false; goto done; } if (!test_user_create(p, mem_ctx, &h, name, &rid)) { - ret = False; + ret = false; goto done; } if (!test_userdel(p, mem_ctx, &h, name)) { - ret = False; + ret = false; goto done; } @@ -406,7 +406,7 @@ done: } -BOOL torture_usermod(struct torture_context *torture) +bool torture_usermod(struct torture_context *torture) { NTSTATUS status; struct dcerpc_pipe *p; @@ -417,7 +417,7 @@ BOOL torture_usermod(struct torture_context *torture) int i; char *name; TALLOC_CTX *mem_ctx; - BOOL ret = True; + bool ret = true; mem_ctx = talloc_init("test_userdel"); @@ -426,7 +426,7 @@ BOOL torture_usermod(struct torture_context *torture) &ndr_table_samr); if (!NT_STATUS_IS_OK(status)) { - ret = False; + ret = false; goto done; } @@ -434,12 +434,12 @@ BOOL torture_usermod(struct torture_context *torture) name = talloc_strdup(mem_ctx, TEST_USERNAME); if (!test_opendomain(p, mem_ctx, &h, &domain_name, &sid)) { - ret = False; + ret = false; goto done; } if (!test_user_create(p, mem_ctx, &h, name, &rid)) { - ret = False; + ret = false; goto done; } @@ -447,19 +447,19 @@ BOOL torture_usermod(struct torture_context *torture) struct libnet_rpc_usermod m; if (!test_usermod(p, mem_ctx, &h, i, &m, &name)) { - ret = False; + ret = false; goto cleanup; } if (!test_compare(p, mem_ctx, &h, &m, name)) { - ret = False; + ret = false; goto cleanup; } } cleanup: if (!test_user_cleanup(p, mem_ctx, &h, name)) { - ret = False; + ret = false; goto done; } diff --git a/source4/torture/libnet/utils.c b/source4/torture/libnet/utils.c index dd84b45a93..47bb9315c7 100644 --- a/source4/torture/libnet/utils.c +++ b/source4/torture/libnet/utils.c @@ -29,7 +29,7 @@ #include "param/param.h" -BOOL test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +bool test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct lsa_String *domname, struct dom_sid2 *sid) { @@ -48,7 +48,7 @@ BOOL test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_Connect(p, mem_ctx, &r1); if (!NT_STATUS_IS_OK(status)) { printf("Connect failed - %s\n", nt_errstr(status)); - return False; + return false; } r2.in.connect_handle = &h; @@ -59,7 +59,7 @@ BOOL test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_LookupDomain(p, mem_ctx, &r2); if (!NT_STATUS_IS_OK(status)) { printf("LookupDomain failed - %s\n", nt_errstr(status)); - return False; + return false; } r3.in.connect_handle = &h; @@ -72,17 +72,17 @@ BOOL test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_OpenDomain(p, mem_ctx, &r3); if (!NT_STATUS_IS_OK(status)) { printf("OpenDomain failed - %s\n", nt_errstr(status)); - return False; + return false; } else { *handle = domain_handle; } *sid = *r2.out.sid; - return True; + return true; } -BOOL test_user_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +bool test_user_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *domain_handle, const char *name) { @@ -105,7 +105,7 @@ BOOL test_user_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_LookupNames(p, mem_ctx, &r1); if (!NT_STATUS_IS_OK(status)) { printf("LookupNames failed - %s\n", nt_errstr(status)); - return False; + return false; } rid = r1.out.rids.ids[0]; @@ -120,7 +120,7 @@ BOOL test_user_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_OpenUser(p, mem_ctx, &r2); if (!NT_STATUS_IS_OK(status)) { printf("OpenUser failed - %s\n", nt_errstr(status)); - return False; + return false; } r3.in.user_handle = &user_handle; @@ -131,14 +131,14 @@ BOOL test_user_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_DeleteUser(p, mem_ctx, &r3); if (!NT_STATUS_IS_OK(status)) { printf("DeleteUser failed - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } -BOOL test_user_create(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +bool test_user_create(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, const char *name, uint32_t *rid) { @@ -164,7 +164,7 @@ BOOL test_user_create(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, if (NT_STATUS_EQUAL(status, NT_STATUS_USER_EXISTS)) { printf("User (%s) already exists - attempting to delete and recreate account again\n", name); if (!test_user_cleanup(p, mem_ctx, handle, name)) { - return False; + return false; } printf("creating user account\n"); @@ -172,18 +172,18 @@ BOOL test_user_create(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_CreateUser(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { printf("CreateUser failed - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } - return False; + return false; } - return True; + return true; } -BOOL test_group_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +bool test_group_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *domain_handle, const char *name) { @@ -206,7 +206,7 @@ BOOL test_group_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_LookupNames(p, mem_ctx, &r1); if (!NT_STATUS_IS_OK(status)) { printf("LookupNames failed - %s\n", nt_errstr(status)); - return False; + return false; } rid = r1.out.rids.ids[0]; @@ -221,7 +221,7 @@ BOOL test_group_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_OpenGroup(p, mem_ctx, &r2); if (!NT_STATUS_IS_OK(status)) { printf("OpenGroup failed - %s\n", nt_errstr(status)); - return False; + return false; } r3.in.group_handle = &group_handle; @@ -232,14 +232,14 @@ BOOL test_group_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_DeleteDomainGroup(p, mem_ctx, &r3); if (!NT_STATUS_IS_OK(status)) { printf("DeleteGroup failed - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } -BOOL test_group_create(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +bool test_group_create(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, const char *name, uint32_t *rid) { @@ -265,7 +265,7 @@ BOOL test_group_create(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, if (NT_STATUS_EQUAL(status, NT_STATUS_USER_EXISTS)) { printf("Group (%s) already exists - attempting to delete and recreate account again\n", name); if (!test_group_cleanup(p, mem_ctx, handle, name)) { - return False; + return false; } printf("creating group account\n"); @@ -273,14 +273,14 @@ BOOL test_group_create(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, status = dcerpc_samr_CreateDomainGroup(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { printf("CreateGroup failed - %s\n", nt_errstr(status)); - return False; + return false; } - return True; + return true; } - return False; + return false; } - return True; + return true; } diff --git a/source4/torture/libnet/utils.h b/source4/torture/libnet/utils.h index 3111c38f1e..ff94ec49e9 100644 --- a/source4/torture/libnet/utils.h +++ b/source4/torture/libnet/utils.h @@ -19,23 +19,23 @@ */ -BOOL test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +bool test_opendomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, struct lsa_String *domname, struct dom_sid2 *sid); -BOOL test_user_create(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +bool test_user_create(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, const char *name, uint32_t *rid); -BOOL test_user_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +bool test_user_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *domain_handle, const char *name); -BOOL test_group_create(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +bool test_group_create(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *handle, const char *name, uint32_t *rid); -BOOL test_group_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, +bool test_group_cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *domain_handle, const char *name); |