diff options
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/basic/misc.c | 14 | ||||
-rw-r--r-- | source4/torture/gentest.c | 14 | ||||
-rw-r--r-- | source4/torture/ldap/cldapbench.c | 4 | ||||
-rw-r--r-- | source4/torture/nbench/nbio.c | 12 | ||||
-rw-r--r-- | source4/torture/nbt/dgram.c | 48 | ||||
-rw-r--r-- | source4/torture/raw/lockbench.c | 8 | ||||
-rw-r--r-- | source4/torture/raw/offline.c | 12 | ||||
-rw-r--r-- | source4/torture/raw/openbench.c | 14 | ||||
-rw-r--r-- | source4/torture/raw/oplock.c | 22 | ||||
-rw-r--r-- | source4/torture/raw/search.c | 8 | ||||
-rw-r--r-- | source4/torture/rpc/eventlog.c | 35 | ||||
-rw-r--r-- | source4/torture/rpc/samba3rpc.c | 14 | ||||
-rw-r--r-- | source4/torture/rpc/samsync.c | 44 | ||||
-rw-r--r-- | source4/torture/rpc/winreg.c | 20 | ||||
-rwxr-xr-x | source4/torture/tests/test_gentest.sh | 4 | ||||
-rwxr-xr-x | source4/torture/tests/test_locktest.sh | 4 | ||||
-rwxr-xr-x | source4/torture/tests/test_masktest.sh | 4 | ||||
-rw-r--r-- | source4/torture/unix/unix_info2.c | 4 | ||||
-rw-r--r-- | source4/torture/util_smb.c | 6 |
19 files changed, 154 insertions, 137 deletions
diff --git a/source4/torture/basic/misc.c b/source4/torture/basic/misc.c index 23844a2c85..f4f91c8ba3 100644 --- a/source4/torture/basic/misc.c +++ b/source4/torture/basic/misc.c @@ -510,7 +510,7 @@ static NTSTATUS benchrw_close(struct torture_context *tctx, NT_STATUS_HAVE_NO_MEMORY(req); /*register the callback function!*/ req->async.fn = benchrw_callback; - req->async.private = state; + req->async.private_data = state; return NT_STATUS_OK; } @@ -521,7 +521,7 @@ static void benchrw_callback(struct smbcli_request *req); static void benchrw_rw_callback(struct smbcli_request *req) { - struct benchrw_state *state = req->async.private; + struct benchrw_state *state = req->async.private_data; struct torture_context *tctx = state->tctx; if (!NT_STATUS_IS_OK(req->status)) { @@ -596,7 +596,7 @@ static NTSTATUS benchrw_readwrite(struct torture_context *tctx, NT_STATUS_HAVE_NO_MEMORY(req); /*register the callback function!*/ req->async.fn = benchrw_rw_callback; - req->async.private = state; + req->async.private_data = state; return NT_STATUS_OK; } @@ -644,7 +644,7 @@ static NTSTATUS benchrw_open(struct torture_context *tctx, /*register the callback function!*/ req->async.fn = benchrw_callback; - req->async.private = state; + req->async.private_data = state; return NT_STATUS_OK; } @@ -691,7 +691,7 @@ static NTSTATUS benchrw_mkdir(struct torture_context *tctx, /*register the callback function!*/ req->async.fn = benchrw_callback; - req->async.private = state; + req->async.private_data = state; return NT_STATUS_OK; } @@ -701,7 +701,7 @@ static NTSTATUS benchrw_mkdir(struct torture_context *tctx, */ static void benchrw_callback(struct smbcli_request *req) { - struct benchrw_state *state = req->async.private; + struct benchrw_state *state = req->async.private_data; struct torture_context *tctx = state->tctx; /*dont send new requests when torture_numops is reached*/ @@ -913,7 +913,7 @@ bool run_benchrw(struct torture_context *tctx) req = smb_raw_mkdir_send(state[i]->cli,&parms); /* register callback fn + private data */ req->async.fn = benchrw_callback; - req->async.private=state[i]; + req->async.private_data=state[i]; break; /* error occured , finish */ case ERROR: diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c index 0677d9ac8e..be02f33378 100644 --- a/source4/torture/gentest.c +++ b/source4/torture/gentest.c @@ -125,9 +125,9 @@ static struct smb2_handle bad_smb2_handle; static bool oplock_handler_smb2(struct smb2_transport *transport, const struct smb2_handle *handle, uint8_t level, void *private_data); -static void idle_func_smb2(struct smb2_transport *transport, void *private); -static bool oplock_handler_smb(struct smbcli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *private); -static void idle_func_smb(struct smbcli_transport *transport, void *private); +static void idle_func_smb2(struct smb2_transport *transport, void *private_data); +static bool oplock_handler_smb(struct smbcli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *private_data); +static void idle_func_smb(struct smbcli_transport *transport, void *private_data); /* check if a string should be ignored. This is used as the basis @@ -976,7 +976,7 @@ static void oplock_handler_close_recv_smb(struct smbcli_request *req) /* the oplock handler will either ack the break or close the file */ -static bool oplock_handler_smb(struct smbcli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *private) +static bool oplock_handler_smb(struct smbcli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *private_data) { union smb_close io; int i, j; @@ -1024,7 +1024,7 @@ static bool oplock_handler_smb(struct smbcli_transport *transport, uint16_t tid, } req->async.fn = oplock_handler_close_recv_smb; - req->async.private = NULL; + req->async.private_data = NULL; return true; } @@ -1035,7 +1035,7 @@ static bool oplock_handler_smb(struct smbcli_transport *transport, uint16_t tid, an operation on another connection blocking until that break is acked we check for operations on all transports in the idle function */ -static void idle_func_smb(struct smbcli_transport *transport, void *private) +static void idle_func_smb(struct smbcli_transport *transport, void *private_data) { int i, j; for (i=0;i<NSERVERS;i++) { @@ -1155,7 +1155,7 @@ static bool oplock_handler_smb2(struct smb2_transport *transport, const struct s an operation on another connection blocking until that break is acked we check for operations on all transports in the idle function */ -static void idle_func_smb2(struct smb2_transport *transport, void *private) +static void idle_func_smb2(struct smb2_transport *transport, void *private_data) { int i, j; for (i=0;i<NSERVERS;i++) { diff --git a/source4/torture/ldap/cldapbench.c b/source4/torture/ldap/cldapbench.c index df2a5b0551..1fcfe5a050 100644 --- a/source4/torture/ldap/cldapbench.c +++ b/source4/torture/ldap/cldapbench.c @@ -33,7 +33,7 @@ struct bench_state { static void request_handler(struct cldap_request *req) { struct cldap_netlogon io; - struct bench_state *state = talloc_get_type(req->async.private, struct bench_state); + struct bench_state *state = talloc_get_type(req->async.private_data, struct bench_state); NTSTATUS status; TALLOC_CTX *tmp_ctx = talloc_new(NULL); io.in.version = 6; @@ -75,7 +75,7 @@ static bool bench_cldap(struct torture_context *tctx, const char *address) struct cldap_request *req; req = cldap_netlogon_send(cldap, &search); - req->async.private = state; + req->async.private_data = state; req->async.fn = request_handler; num_sent++; if (num_sent % 50 == 0) { diff --git a/source4/torture/nbench/nbio.c b/source4/torture/nbench/nbio.c index be09018acf..bf594088cd 100644 --- a/source4/torture/nbench/nbio.c +++ b/source4/torture/nbench/nbio.c @@ -384,9 +384,9 @@ static struct smbcli_state *c; a handler function for oplock break requests */ static bool oplock_handler(struct smbcli_transport *transport, uint16_t tid, - uint16_t fnum, uint8_t level, void *private) + uint16_t fnum, uint8_t level, void *private_data) { - struct smbcli_tree *tree = (struct smbcli_tree *)private; + struct smbcli_tree *tree = (struct smbcli_tree *)private_data; return smbcli_oplock_ack(tree, fnum, OPLOCK_BREAK_TO_NONE); } @@ -802,15 +802,15 @@ bool nb_mkdir(const char *dname, NTSTATUS status, bool retry) return true; } -bool nb_rename(const char *old, const char *new, NTSTATUS status, bool retry) +bool nb_rename(const char *o, const char *n, NTSTATUS status, bool retry) { NTSTATUS ret; union smb_rename io; io.generic.level = RAW_RENAME_RENAME; io.rename.in.attrib = FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY; - io.rename.in.pattern1 = old; - io.rename.in.pattern2 = new; + io.rename.in.pattern1 = o; + io.rename.in.pattern2 = n; ret = smb_raw_rename(c->tree, &io); @@ -906,7 +906,7 @@ bool nb_qfsinfo(int level, NTSTATUS status) } /* callback function used for trans2 search */ -static bool findfirst_callback(void *private, const union smb_search_data *file) +static bool findfirst_callback(void *private_data, const union smb_search_data *file) { return true; } diff --git a/source4/torture/nbt/dgram.c b/source4/torture/nbt/dgram.c index 5d26d65e0c..8eb315127a 100644 --- a/source4/torture/nbt/dgram.c +++ b/source4/torture/nbt/dgram.c @@ -42,11 +42,11 @@ static void netlogon_handler(struct dgram_mailslot_handler *dgmslot, struct socket_address *src) { NTSTATUS status; - struct nbt_netlogon_response *netlogon = dgmslot->private; + struct nbt_netlogon_response *netlogon = dgmslot->private_data; - dgmslot->private = netlogon = talloc(dgmslot, struct nbt_netlogon_response); + dgmslot->private_data = netlogon = talloc(dgmslot, struct nbt_netlogon_response); - if (!dgmslot->private) { + if (!dgmslot->private_data) { return; } @@ -139,11 +139,11 @@ static bool nbt_test_netlogon(struct torture_context *tctx) &myname, &logon); torture_assert_ntstatus_ok(tctx, status, "Failed to send netlogon request"); - while (timeval_elapsed(&tv) < 5 && !dgmslot->private) { + while (timeval_elapsed(&tv) < 5 && !dgmslot->private_data) { event_loop_once(dgmsock->event_ctx); } - response = talloc_get_type(dgmslot->private, struct nbt_netlogon_response); + response = talloc_get_type(dgmslot->private_data, struct nbt_netlogon_response); torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet"); @@ -234,11 +234,11 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) &myname, &logon); torture_assert_ntstatus_ok(tctx, status, "Failed to send netlogon request"); - while (timeval_elapsed(&tv) < 5 && dgmslot->private == NULL) { + while (timeval_elapsed(&tv) < 5 && dgmslot->private_data == NULL) { event_loop_once(dgmsock->event_ctx); } - response = talloc_get_type(dgmslot->private, struct nbt_netlogon_response); + response = talloc_get_type(dgmslot->private_data, struct nbt_netlogon_response); torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet"); @@ -273,11 +273,11 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) &myname, &logon); torture_assert_ntstatus_ok(tctx, status, "Failed to send netlogon request"); - while (timeval_elapsed(&tv) < 5 && dgmslot->private == NULL) { + while (timeval_elapsed(&tv) < 5 && dgmslot->private_data == NULL) { event_loop_once(dgmsock->event_ctx); } - response = talloc_get_type(dgmslot->private, struct nbt_netlogon_response); + response = talloc_get_type(dgmslot->private_data, struct nbt_netlogon_response); torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet"); @@ -324,11 +324,11 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) torture_assert_ntstatus_ok(tctx, status, "Failed to send netlogon request"); - while (timeval_elapsed(&tv) < 5 && dgmslot->private == NULL) { + while (timeval_elapsed(&tv) < 5 && dgmslot->private_data == NULL) { event_loop_once(dgmsock->event_ctx); } - response = talloc_get_type(dgmslot->private, struct nbt_netlogon_response); + response = talloc_get_type(dgmslot->private_data, struct nbt_netlogon_response); torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet"); @@ -365,11 +365,11 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) torture_assert_ntstatus_ok(tctx, status, "Failed to send netlogon request"); - while (timeval_elapsed(&tv) < 5 && dgmslot->private == NULL) { + while (timeval_elapsed(&tv) < 5 && dgmslot->private_data == NULL) { event_loop_once(dgmsock->event_ctx); } - response = talloc_get_type(dgmslot->private, struct nbt_netlogon_response); + response = talloc_get_type(dgmslot->private_data, struct nbt_netlogon_response); torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet"); @@ -378,7 +378,7 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) torture_assert_int_equal(tctx, response->data.samlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE, "Got incorrect netlogon response command"); - dgmslot->private = NULL; + dgmslot->private_data = NULL; ZERO_STRUCT(logon); logon.command = LOGON_SAM_LOGON_REQUEST; @@ -404,11 +404,11 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) torture_assert_ntstatus_ok(tctx, status, "Failed to send netlogon request"); - while (timeval_elapsed(&tv) < 5 && dgmslot->private == NULL) { + while (timeval_elapsed(&tv) < 5 && dgmslot->private_data == NULL) { event_loop_once(dgmsock->event_ctx); } - response = talloc_get_type(dgmslot->private, struct nbt_netlogon_response); + response = talloc_get_type(dgmslot->private_data, struct nbt_netlogon_response); torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet"); @@ -513,11 +513,11 @@ static bool nbt_test_ntlogon(struct torture_context *tctx) &myname, &logon); torture_assert_ntstatus_ok(tctx, status, "Failed to send ntlogon request"); - while (timeval_elapsed(&tv) < 5 && dgmslot->private == NULL) { + while (timeval_elapsed(&tv) < 5 && dgmslot->private_data == NULL) { event_loop_once(dgmsock->event_ctx); } - response = talloc_get_type(dgmslot->private, struct nbt_netlogon_response); + response = talloc_get_type(dgmslot->private_data, struct nbt_netlogon_response); torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet"); @@ -557,11 +557,11 @@ static bool nbt_test_ntlogon(struct torture_context *tctx) &myname, &logon); torture_assert_ntstatus_ok(tctx, status, "Failed to send ntlogon request"); - while (timeval_elapsed(&tv) < 5 && dgmslot->private == NULL) { + while (timeval_elapsed(&tv) < 5 && dgmslot->private_data == NULL) { event_loop_once(dgmsock->event_ctx); } - response = talloc_get_type(dgmslot->private, struct nbt_netlogon_response); + response = talloc_get_type(dgmslot->private_data, struct nbt_netlogon_response); torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet"); @@ -597,11 +597,11 @@ static bool nbt_test_ntlogon(struct torture_context *tctx) &myname, &logon); torture_assert_ntstatus_ok(tctx, status, "Failed to send ntlogon request"); - while (timeval_elapsed(&tv) < 5 && !dgmslot->private) { + while (timeval_elapsed(&tv) < 5 && !dgmslot->private_data) { event_loop_once(dgmsock->event_ctx); } - response = talloc_get_type(dgmslot->private, struct nbt_netlogon_response); + response = talloc_get_type(dgmslot->private_data, struct nbt_netlogon_response); torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet"); @@ -634,11 +634,11 @@ static bool nbt_test_ntlogon(struct torture_context *tctx) &myname, &logon); torture_assert_ntstatus_ok(tctx, status, "Failed to send ntlogon request"); - while (timeval_elapsed(&tv) < 5 && !dgmslot->private) { + while (timeval_elapsed(&tv) < 5 && !dgmslot->private_data) { event_loop_once(dgmsock->event_ctx); } - response = talloc_get_type(dgmslot->private, struct nbt_netlogon_response); + response = talloc_get_type(dgmslot->private_data, struct nbt_netlogon_response); torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet"); diff --git a/source4/torture/raw/lockbench.c b/source4/torture/raw/lockbench.c index 4077ae97e6..d20175a018 100644 --- a/source4/torture/raw/lockbench.c +++ b/source4/torture/raw/lockbench.c @@ -112,7 +112,7 @@ static void lock_send(struct benchlock_state *state) DEBUG(0,("Failed to setup lock\n")); lock_failed++; } - state->req->async.private = state; + state->req->async.private_data = state; state->req->async.fn = lock_completion; } @@ -222,7 +222,7 @@ static void reopen_connection(struct tevent_context *ev, struct tevent_timer *te */ static void lock_completion(struct smbcli_request *req) { - struct benchlock_state *state = (struct benchlock_state *)req->async.private; + struct benchlock_state *state = (struct benchlock_state *)req->async.private_data; NTSTATUS status = smbcli_request_simple_recv(req); state->req = NULL; if (!NT_STATUS_IS_OK(status)) { @@ -262,7 +262,7 @@ static void lock_completion(struct smbcli_request *req) static void echo_completion(struct smbcli_request *req) { - struct benchlock_state *state = (struct benchlock_state *)req->async.private; + struct benchlock_state *state = (struct benchlock_state *)req->async.private_data; NTSTATUS status = smbcli_request_simple_recv(req); if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE) || NT_STATUS_EQUAL(status, NT_STATUS_LOCAL_DISCONNECT)) { @@ -305,7 +305,7 @@ static void report_rate(struct tevent_context *ev, struct tevent_timer *te, p.in.size = 0; p.in.data = NULL; req = smb_raw_echo_send(state[i].tree->session->transport, &p); - req->async.private = &state[i]; + req->async.private_data = &state[i]; req->async.fn = echo_completion; } } diff --git a/source4/torture/raw/offline.c b/source4/torture/raw/offline.c index 2d97efa049..5322f471a2 100644 --- a/source4/torture/raw/offline.c +++ b/source4/torture/raw/offline.c @@ -159,7 +159,7 @@ static void savefile_callback(struct composite_context *ctx) */ static void setoffline_callback(struct smbcli_request *req) { - struct offline_state *state = req->async.private; + struct offline_state *state = req->async.private_data; NTSTATUS status; status = smbcli_request_simple_recv(req); @@ -183,7 +183,7 @@ static void setoffline_callback(struct smbcli_request *req) */ static void getoffline_callback(struct smbcli_request *req) { - struct offline_state *state = req->async.private; + struct offline_state *state = req->async.private_data; NTSTATUS status; union smb_fileinfo io; @@ -286,7 +286,7 @@ static void test_offline(struct offline_state *state) } state->req->async.fn = setoffline_callback; - state->req->async.private = state; + state->req->async.private_data = state; break; } @@ -303,7 +303,7 @@ static void test_offline(struct offline_state *state) } state->req->async.fn = getoffline_callback; - state->req->async.private = state; + state->req->async.private_data = state; break; } @@ -318,7 +318,7 @@ static void test_offline(struct offline_state *state) static void echo_completion(struct smbcli_request *req) { - struct offline_state *state = (struct offline_state *)req->async.private; + struct offline_state *state = (struct offline_state *)req->async.private_data; NTSTATUS status = smbcli_request_simple_recv(req); if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE) || NT_STATUS_EQUAL(status, NT_STATUS_LOCAL_DISCONNECT)) { @@ -380,7 +380,7 @@ static void report_rate(struct tevent_context *ev, struct tevent_timer *te, p.in.size = 0; p.in.data = NULL; req = smb_raw_echo_send(state[i].tree->session->transport, &p); - req->async.private = &state[i]; + req->async.private_data = &state[i]; req->async.fn = echo_completion; } } diff --git a/source4/torture/raw/openbench.c b/source4/torture/raw/openbench.c index a9ce4aec0d..bdad2b16a5 100644 --- a/source4/torture/raw/openbench.c +++ b/source4/torture/raw/openbench.c @@ -186,7 +186,7 @@ static void next_open(struct benchopen_state *state) state->req_open = smb_raw_open_send(state->tree, &state->open_parms); state->req_open->async.fn = open_completed; - state->req_open->async.private = state; + state->req_open->async.private_data = state; } @@ -203,7 +203,7 @@ static void next_close(struct benchopen_state *state) state->req_close = smb_raw_close_send(state->tree, &state->close_parms); state->req_close->async.fn = close_completed; - state->req_close->async.private = state; + state->req_close->async.private_data = state; } /* @@ -211,7 +211,7 @@ static void next_close(struct benchopen_state *state) */ static void open_completed(struct smbcli_request *req) { - struct benchopen_state *state = (struct benchopen_state *)req->async.private; + struct benchopen_state *state = (struct benchopen_state *)req->async.private_data; TALLOC_CTX *tmp_ctx = talloc_new(state->mem_ctx); NTSTATUS status; @@ -243,7 +243,7 @@ static void open_completed(struct smbcli_request *req) state->open_retries++; state->req_open = smb_raw_open_send(state->tree, &state->open_parms); state->req_open->async.fn = open_completed; - state->req_open->async.private = state; + state->req_open->async.private_data = state; return; } @@ -275,7 +275,7 @@ static void open_completed(struct smbcli_request *req) */ static void close_completed(struct smbcli_request *req) { - struct benchopen_state *state = (struct benchopen_state *)req->async.private; + struct benchopen_state *state = (struct benchopen_state *)req->async.private_data; NTSTATUS status = smbcli_request_simple_recv(req); state->req_close = NULL; @@ -312,7 +312,7 @@ static void close_completed(struct smbcli_request *req) static void echo_completion(struct smbcli_request *req) { - struct benchopen_state *state = (struct benchopen_state *)req->async.private; + struct benchopen_state *state = (struct benchopen_state *)req->async.private_data; NTSTATUS status = smbcli_request_simple_recv(req); if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE) || NT_STATUS_EQUAL(status, NT_STATUS_LOCAL_DISCONNECT)) { @@ -357,7 +357,7 @@ static void report_rate(struct tevent_context *ev, struct tevent_timer *te, p.in.size = 0; p.in.data = NULL; req = smb_raw_echo_send(state[i].tree->session->transport, &p); - req->async.private = &state[i]; + req->async.private_data = &state[i]; req->async.fn = echo_completion; } } diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c index d31d841e13..c10c49ecf3 100644 --- a/source4/torture/raw/oplock.c +++ b/source4/torture/raw/oplock.c @@ -74,9 +74,9 @@ static struct { */ static bool oplock_handler_ack_to_given(struct smbcli_transport *transport, uint16_t tid, uint16_t fnum, - uint8_t level, void *private) + uint8_t level, void *private_data) { - struct smbcli_tree *tree = (struct smbcli_tree *)private; + struct smbcli_tree *tree = (struct smbcli_tree *)private_data; const char *name; break_info.fnum = fnum; @@ -105,9 +105,9 @@ static bool oplock_handler_ack_to_given(struct smbcli_transport *transport, */ static bool oplock_handler_ack_to_none(struct smbcli_transport *transport, uint16_t tid, uint16_t fnum, - uint8_t level, void *private) + uint8_t level, void *private_data) { - struct smbcli_tree *tree = (struct smbcli_tree *)private; + struct smbcli_tree *tree = (struct smbcli_tree *)private_data; break_info.fnum = fnum; break_info.level = level; break_info.count++; @@ -122,7 +122,7 @@ static bool oplock_handler_ack_to_none(struct smbcli_transport *transport, */ static bool oplock_handler_timeout(struct smbcli_transport *transport, uint16_t tid, uint16_t fnum, - uint8_t level, void *private) + uint8_t level, void *private_data) { break_info.fnum = fnum; break_info.level = level; @@ -146,10 +146,10 @@ static void oplock_handler_close_recv(struct smbcli_request *req) a handler function for oplock break requests - close the file */ static bool oplock_handler_close(struct smbcli_transport *transport, uint16_t tid, - uint16_t fnum, uint8_t level, void *private) + uint16_t fnum, uint8_t level, void *private_data) { union smb_close io; - struct smbcli_tree *tree = (struct smbcli_tree *)private; + struct smbcli_tree *tree = (struct smbcli_tree *)private_data; struct smbcli_request *req; break_info.fnum = fnum; @@ -166,7 +166,7 @@ static bool oplock_handler_close(struct smbcli_transport *transport, uint16_t ti } req->async.fn = oplock_handler_close_recv; - req->async.private = NULL; + req->async.private_data = NULL; return true; } @@ -2999,9 +2999,9 @@ static struct hold_oplock_info { static bool oplock_handler_hold(struct smbcli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, - void *private) + void *private_data) { - struct smbcli_tree *tree = (struct smbcli_tree *)private; + struct smbcli_tree *tree = (struct smbcli_tree *)private_data; struct hold_oplock_info *info; int i; @@ -3019,7 +3019,7 @@ static bool oplock_handler_hold(struct smbcli_transport *transport, if (info->close_on_break) { printf("oplock break on %s - closing\n", info->fname); - oplock_handler_close(transport, tid, fnum, level, private); + oplock_handler_close(transport, tid, fnum, level, private_data); return true; } diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c index 2a6aef20b5..8a3168dcc4 100644 --- a/source4/torture/raw/search.c +++ b/source4/torture/raw/search.c @@ -31,9 +31,9 @@ /* callback function for single_search */ -static bool single_search_callback(void *private, const union smb_search_data *file) +static bool single_search_callback(void *private_data, const union smb_search_data *file) { - union smb_search_data *data = (union smb_search_data *)private; + union smb_search_data *data = (union smb_search_data *)private_data; *data = *file; @@ -510,9 +510,9 @@ struct multiple_result { /* callback function for multiple_search */ -static bool multiple_search_callback(void *private, const union smb_search_data *file) +static bool multiple_search_callback(void *private_data, const union smb_search_data *file) { - struct multiple_result *data = (struct multiple_result *)private; + struct multiple_result *data = (struct multiple_result *)private_data; data->count++; diff --git a/source4/torture/rpc/eventlog.c b/source4/torture/rpc/eventlog.c index d5bc4e6501..2fd9d923f1 100644 --- a/source4/torture/rpc/eventlog.c +++ b/source4/torture/rpc/eventlog.c @@ -125,9 +125,10 @@ static bool test_ReadEventLog(struct torture_context *tctx, while (1) { DATA_BLOB blob; - struct eventlog_Record rec; - struct ndr_pull *ndr; + struct EVENTLOGRECORD rec; enum ndr_err_code ndr_err; + uint32_t size = 0; + uint32_t pos = 0; /* Read first for number of bytes in record */ @@ -140,6 +141,7 @@ static bool test_ReadEventLog(struct torture_context *tctx, status = dcerpc_eventlog_ReadEventLogW(p, tctx, &r); if (NT_STATUS_EQUAL(r.out.result, NT_STATUS_END_OF_FILE)) { + /* FIXME: still need to decode then */ break; } @@ -156,17 +158,32 @@ static bool test_ReadEventLog(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "ReadEventLog failed"); /* Decode a user-marshalled record */ + size = IVAL(r.out.data, pos); - blob.length = *r.out.sent_size; - blob.data = talloc_steal(tctx, r.out.data); + while (size > 0) { - ndr = ndr_pull_init_blob(&blob, tctx, lp_iconv_convenience(tctx->lp_ctx)); + blob = data_blob_const(r.out.data + pos, size); + dump_data(0, blob.data, blob.length); - ndr_err = ndr_pull_eventlog_Record( - ndr, NDR_SCALARS|NDR_BUFFERS, &rec); - status = ndr_map_error2ntstatus(ndr_err); + ndr_err = ndr_pull_struct_blob_all(&blob, tctx, + lp_iconv_convenience(tctx->lp_ctx), &rec, + (ndr_pull_flags_fn_t)ndr_pull_EVENTLOGRECORD); + if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + status = ndr_map_error2ntstatus(ndr_err); + torture_assert_ntstatus_ok(tctx, status, + "ReadEventLog failed parsing event log record"); + } - NDR_PRINT_DEBUG(eventlog_Record, &rec); + NDR_PRINT_DEBUG(EVENTLOGRECORD, &rec); + + pos += size; + + if (pos + 4 > *r.out.sent_size) { + break; + } + + size = IVAL(r.out.data, pos); + } torture_assert_ntstatus_ok(tctx, status, "ReadEventLog failed parsing event log record"); diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index 2207786f17..5b493db813 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -49,7 +49,7 @@ #include "libcli/auth/libcli_auth.h" #include "../lib/crypto/crypto.h" #include "auth/ntlmssp/ntlmssp.h" -#include "libcli/security/proto.h" +#include "libcli/security/security.h" #include "param/param.h" #include "lib/registry/registry.h" #include "libcli/resolve/resolve.h" @@ -1867,7 +1867,7 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture) d_printf("(%s) whoami on user connection failed\n", __location__); ret = false; - goto delete; + goto del; } talloc_free(tree); @@ -1881,7 +1881,7 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture) ret = false; } - delete: + del: if (!delete_user(cli, torture->lp_ctx, cmdline_credentials, cli_credentials_get_username(user_creds))) { @@ -3050,7 +3050,7 @@ static NTSTATUS enumkeys(struct dcerpc_pipe *p, struct policy_handle *handle, TALLOC_CTX *mem_ctx, int depth) { struct winreg_EnumKey r; - struct winreg_StringBuf class, name; + struct winreg_StringBuf kclass, name; NTSTATUS status; NTTIME t = 0; @@ -3058,13 +3058,13 @@ static NTSTATUS enumkeys(struct dcerpc_pipe *p, struct policy_handle *handle, return NT_STATUS_OK; } - class.name = ""; - class.size = 1024; + kclass.name = ""; + kclass.size = 1024; r.in.handle = handle; r.in.enum_index = 0; r.in.name = &name; - r.in.keyclass = &class; + r.in.keyclass = &kclass; r.out.name = &name; r.in.last_changed_time = &t; diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c index a3fc6f740f..00798214f3 100644 --- a/source4/torture/rpc/samsync.c +++ b/source4/torture/rpc/samsync.c @@ -830,14 +830,14 @@ static bool samsync_handle_secret(TALLOC_CTX *mem_ctx, struct samsync_state *sam { struct netr_DELTA_SECRET *secret = delta->delta_union.secret; const char *name = delta->delta_id_union.name; - struct samsync_secret *new = talloc(samsync_state, struct samsync_secret); + struct samsync_secret *nsec = talloc(samsync_state, struct samsync_secret); struct samsync_secret *old = talloc(mem_ctx, struct samsync_secret); struct lsa_QuerySecret q; struct lsa_OpenSecret o; struct policy_handle sec_handle; struct lsa_DATA_BUF_PTR bufp1; struct lsa_DATA_BUF_PTR bufp2; - NTTIME new_mtime; + NTTIME nsec_mtime; NTTIME old_mtime; bool ret = true; DATA_BLOB lsa_blob1, lsa_blob_out, session_key; @@ -849,12 +849,12 @@ static bool samsync_handle_secret(TALLOC_CTX *mem_ctx, struct samsync_state *sam creds_arcfour_crypt(samsync_state->creds, secret->old_cipher.cipher_data, secret->old_cipher.maxlen); - new->name = talloc_reference(new, name); - new->secret = data_blob_talloc(new, secret->current_cipher.cipher_data, secret->current_cipher.maxlen); - new->mtime = secret->current_cipher_set_time; + nsec->name = talloc_reference(nsec, name); + nsec->secret = data_blob_talloc(nsec, secret->current_cipher.cipher_data, secret->current_cipher.maxlen); + nsec->mtime = secret->current_cipher_set_time; - new = talloc_reference(samsync_state, new); - DLIST_ADD(samsync_state->secrets, new); + nsec = talloc_reference(samsync_state, nsec); + DLIST_ADD(samsync_state->secrets, nsec); old->name = talloc_reference(old, name); old->secret = data_blob_const(secret->old_cipher.cipher_data, secret->old_cipher.maxlen); @@ -882,13 +882,13 @@ static bool samsync_handle_secret(TALLOC_CTX *mem_ctx, struct samsync_state *sam } - ZERO_STRUCT(new_mtime); + ZERO_STRUCT(nsec_mtime); ZERO_STRUCT(old_mtime); /* fetch the secret back again */ q.in.sec_handle = &sec_handle; q.in.new_val = &bufp1; - q.in.new_mtime = &new_mtime; + q.in.new_mtime = &nsec_mtime; q.in.old_val = &bufp2; q.in.old_mtime = &old_mtime; @@ -957,26 +957,26 @@ static bool samsync_handle_secret(TALLOC_CTX *mem_ctx, struct samsync_state *sam } if (!q.out.new_mtime) { - printf("NEW mtime not available on LSA for secret %s\n", new->name); + printf("NEW mtime not available on LSA for secret %s\n", nsec->name); ret = false; } - if (new->mtime != *q.out.new_mtime) { + if (nsec->mtime != *q.out.new_mtime) { printf("NEW mtime on secret %s does not match between SAMSYNC (%s) and LSA (%s)\n", - new->name, nt_time_string(mem_ctx, new->mtime), + nsec->name, nt_time_string(mem_ctx, nsec->mtime), nt_time_string(mem_ctx, *q.out.new_mtime)); ret = false; } - if (new->secret.length != lsa_blob_out.length) { + if (nsec->secret.length != lsa_blob_out.length) { printf("Returned secret %s doesn't match: %d != %d\n", - new->name, (int)new->secret.length, (int)lsa_blob_out.length); + nsec->name, (int)nsec->secret.length, (int)lsa_blob_out.length); ret = false; } else if (memcmp(lsa_blob_out.data, - new->secret.data, new->secret.length) != 0) { + nsec->secret.data, nsec->secret.length) != 0) { printf("Returned secret %s doesn't match: \n", - new->name); + nsec->name); DEBUG(1, ("SamSync Secret:\n")); - dump_data(1, new->secret.data, new->secret.length); + dump_data(1, nsec->secret.data, nsec->secret.length); DEBUG(1, ("LSA Secret:\n")); dump_data(1, lsa_blob_out.data, lsa_blob_out.length); ret = false; @@ -994,7 +994,7 @@ static bool samsync_handle_trusted_domain(TALLOC_CTX *mem_ctx, struct samsync_st struct netr_DELTA_TRUSTED_DOMAIN *trusted_domain = delta->delta_union.trusted_domain; struct dom_sid *dom_sid = delta->delta_id_union.sid; - struct samsync_trusted_domain *new = talloc(samsync_state, struct samsync_trusted_domain); + struct samsync_trusted_domain *ndom = talloc(samsync_state, struct samsync_trusted_domain); struct lsa_OpenTrustedDomain t; struct policy_handle trustdom_handle; struct lsa_QueryTrustedDomainInfo q; @@ -1003,8 +1003,8 @@ static bool samsync_handle_trusted_domain(TALLOC_CTX *mem_ctx, struct samsync_st int levels [] = {1, 3, 8}; int i; - new->name = talloc_reference(new, trusted_domain->domain_name.string); - new->sid = talloc_reference(new, dom_sid); + ndom->name = talloc_reference(ndom, trusted_domain->domain_name.string); + ndom->sid = talloc_reference(ndom, dom_sid); t.in.handle = samsync_state->lsa_handle; t.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; @@ -1044,8 +1044,8 @@ static bool samsync_handle_trusted_domain(TALLOC_CTX *mem_ctx, struct samsync_st We would like to do this, but it is NOT_SUPPORTED on win2k3 TEST_SEC_DESC_EQUAL(trusted_domain->sdbuf, lsa, &trustdom_handle); */ - new = talloc_reference(samsync_state, new); - DLIST_ADD(samsync_state->trusted_domains, new); + ndom = talloc_reference(samsync_state, ndom); + DLIST_ADD(samsync_state->trusted_domains, ndom); return ret; } diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index b544e74181..b85dac7bf1 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -104,7 +104,7 @@ static bool test_NotifyChangeKeyValue(struct dcerpc_pipe *p, static bool test_CreateKey(struct dcerpc_pipe *p, struct torture_context *tctx, struct policy_handle *handle, const char *name, - const char *class) + const char *kclass) { struct winreg_CreateKey r; struct policy_handle newhandle; @@ -114,7 +114,7 @@ static bool test_CreateKey(struct dcerpc_pipe *p, struct torture_context *tctx, r.in.handle = handle; r.out.new_handle = &newhandle; init_winreg_String(&r.in.name, name); - init_winreg_String(&r.in.keyclass, class); + init_winreg_String(&r.in.keyclass, kclass); r.in.options = 0x0; r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; r.in.action_taken = r.out.action_taken = &action_taken; @@ -135,7 +135,7 @@ static bool test_CreateKey(struct dcerpc_pipe *p, struct torture_context *tctx, static bool test_CreateKey_sd(struct dcerpc_pipe *p, struct torture_context *tctx, struct policy_handle *handle, const char *name, - const char *class, + const char *kclass, struct policy_handle *newhandle) { struct winreg_CreateKey r; @@ -169,7 +169,7 @@ static bool test_CreateKey_sd(struct dcerpc_pipe *p, r.in.handle = handle; r.out.new_handle = newhandle; init_winreg_String(&r.in.name, name); - init_winreg_String(&r.in.keyclass, class); + init_winreg_String(&r.in.keyclass, kclass); r.in.options = 0x0; r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; r.in.action_taken = r.out.action_taken = &action_taken; @@ -1393,7 +1393,7 @@ static bool test_DeleteKey(struct dcerpc_pipe *p, struct torture_context *tctx, static bool test_QueryInfoKey(struct dcerpc_pipe *p, struct torture_context *tctx, - struct policy_handle *handle, char *class) + struct policy_handle *handle, char *kclass) { struct winreg_QueryInfoKey r; uint32_t num_subkeys, max_subkeylen, max_classlen, @@ -1415,7 +1415,7 @@ static bool test_QueryInfoKey(struct dcerpc_pipe *p, r.out.classname = talloc(tctx, struct winreg_String); r.in.classname = talloc(tctx, struct winreg_String); - init_winreg_String(r.in.classname, class); + init_winreg_String(r.in.classname, kclass); torture_assert_ntstatus_ok(tctx, dcerpc_winreg_QueryInfoKey(p, tctx, &r), @@ -1435,18 +1435,18 @@ static bool test_EnumKey(struct dcerpc_pipe *p, struct torture_context *tctx, bool test_security) { struct winreg_EnumKey r; - struct winreg_StringBuf class, name; + struct winreg_StringBuf kclass, name; NTSTATUS status; NTTIME t = 0; - class.name = ""; - class.size = 1024; + kclass.name = ""; + kclass.size = 1024; ZERO_STRUCT(r); r.in.handle = handle; r.in.enum_index = 0; r.in.name = &name; - r.in.keyclass = &class; + r.in.keyclass = &kclass; r.out.name = &name; r.in.last_changed_time = &t; diff --git a/source4/torture/tests/test_gentest.sh b/source4/torture/tests/test_gentest.sh index 2f4d00dc77..c7f66c8445 100755 --- a/source4/torture/tests/test_gentest.sh +++ b/source4/torture/tests/test_gentest.sh @@ -17,8 +17,8 @@ DOMAIN=$4 shift 4 failed=0 -samba4bindir=`dirname $0`/../../bin -gentest=$samba4bindir/gentest +samba4bindir="$BUILDDIR/bin" +gentest="$samba4bindir/gentest$EXEEXT" . `dirname $0`/../../../testprogs/blackbox/subunit.sh diff --git a/source4/torture/tests/test_locktest.sh b/source4/torture/tests/test_locktest.sh index 1fe39b4d1d..a8f11ee0ba 100755 --- a/source4/torture/tests/test_locktest.sh +++ b/source4/torture/tests/test_locktest.sh @@ -18,8 +18,8 @@ PREFIX=$5 shift 5 failed=0 -samba4bindir=`dirname $0`/../../bin -locktest=$samba4bindir/locktest +samba4bindir="$BUILDDIR/bin" +locktest="$samba4bindir/locktest$EXEEXT" . `dirname $0`/../../../testprogs/blackbox/subunit.sh diff --git a/source4/torture/tests/test_masktest.sh b/source4/torture/tests/test_masktest.sh index 59165e47df..e4fa65ccfb 100755 --- a/source4/torture/tests/test_masktest.sh +++ b/source4/torture/tests/test_masktest.sh @@ -18,8 +18,8 @@ PREFIX=$5 shift 5 failed=0 -samba4bindir=`dirname $0`/../../bin -masktest=$samba4bindir/masktest +samba4bindir="$BUILDDIR/bin" +masktest="$samba4bindir/masktest$EXEEXT" . `dirname $0`/../../../testprogs/blackbox/subunit.sh diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c index d0a2c3d041..30fe912234 100644 --- a/source4/torture/unix/unix_info2.c +++ b/source4/torture/unix/unix_info2.c @@ -201,9 +201,9 @@ static bool query_path_info2(void *mem_ctx, -1, fname, info2); } -static bool search_callback(void *private, const union smb_search_data *fdata) +static bool search_callback(void *private_data, const union smb_search_data *fdata) { - struct unix_info2 *info2 = (struct unix_info2 *)private; + struct unix_info2 *info2 = (struct unix_info2 *)private_data; info2->end_of_file = fdata->unix_info2.end_of_file; info2->num_bytes = fdata->unix_info2.num_bytes; diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c index 732b84af73..1c50694279 100644 --- a/source4/torture/util_smb.c +++ b/source4/torture/util_smb.c @@ -583,10 +583,10 @@ _PUBLIC_ bool check_error(const char *location, struct smbcli_state *c, status = smbcli_nt_error(c->tree); if (NT_STATUS_IS_DOS(status)) { - int class, num; - class = NT_STATUS_DOS_CLASS(status); + int classnum, num; + classnum = NT_STATUS_DOS_CLASS(status); num = NT_STATUS_DOS_CODE(status); - if (eclass != class || ecode != num) { + if (eclass != classnum || ecode != num) { printf("unexpected error code %s\n", nt_errstr(status)); printf(" expected %s or %s (at %s)\n", nt_errstr(NT_STATUS_DOS(eclass, ecode)), |