diff options
author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2022-12-22 17:48:26 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2023-02-08 00:03:39 +0000 |
commit | 8aef16bbbc1e55f0a9f5a8ec87e5348688d93785 (patch) | |
tree | d070bf723433e371b91fb4d30e39fd2fabac46cd /libcli/named_pipe_auth | |
parent | 5043bbed9993cc08ee752a3fe44f835aedbbc129 (diff) | |
download | samba-8aef16bbbc1e55f0a9f5a8ec87e5348688d93785.tar.gz |
named_pipe_auth: Bump info5 to info6
In the next commit, we shall replace the 'authenticated' field of
named_pipe_auth_req_info.info5.session_info.session_info.info with a
more general 'user_flags' field.
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'libcli/named_pipe_auth')
-rw-r--r-- | libcli/named_pipe_auth/npa_tstream.c | 114 | ||||
-rw-r--r-- | libcli/named_pipe_auth/npa_tstream.h | 4 |
2 files changed, 59 insertions, 59 deletions
diff --git a/libcli/named_pipe_auth/npa_tstream.c b/libcli/named_pipe_auth/npa_tstream.c index 506c4a35681..6f4ab45887b 100644 --- a/libcli/named_pipe_auth/npa_tstream.c +++ b/libcli/named_pipe_auth/npa_tstream.c @@ -73,7 +73,7 @@ struct tevent_req *tstream_npa_connect_send(TALLOC_CTX *mem_ctx, int ret; enum ndr_err_code ndr_err; char *lower_case_npipe; - struct named_pipe_auth_req_info5 *info5; + struct named_pipe_auth_req_info6 *info6; req = tevent_req_create(mem_ctx, &state, struct tstream_npa_connect_state); @@ -119,39 +119,39 @@ struct tevent_req *tstream_npa_connect_send(TALLOC_CTX *mem_ctx, goto post; } - state->auth_req.level = 5; - info5 = &state->auth_req.info.info5; + state->auth_req.level = 6; + info6 = &state->auth_req.info.info6; - info5->transport = transport; - SMB_ASSERT(info5->transport == transport); /* Assert no overflow */ + info6->transport = transport; + SMB_ASSERT(info6->transport == transport); /* Assert no overflow */ - info5->remote_client_name = remote_client_name_in; - info5->remote_client_addr = tsocket_address_inet_addr_string(remote_client_addr, + info6->remote_client_name = remote_client_name_in; + info6->remote_client_addr = tsocket_address_inet_addr_string(remote_client_addr, state); - if (!info5->remote_client_addr) { + if (!info6->remote_client_addr) { /* errno might be EINVAL */ tevent_req_error(req, errno); goto post; } - info5->remote_client_port = tsocket_address_inet_port(remote_client_addr); - if (!info5->remote_client_name) { - info5->remote_client_name = info5->remote_client_addr; + info6->remote_client_port = tsocket_address_inet_port(remote_client_addr); + if (!info6->remote_client_name) { + info6->remote_client_name = info6->remote_client_addr; } - info5->local_server_name = local_server_name_in; - info5->local_server_addr = tsocket_address_inet_addr_string(local_server_addr, + info6->local_server_name = local_server_name_in; + info6->local_server_addr = tsocket_address_inet_addr_string(local_server_addr, state); - if (!info5->local_server_addr) { + if (!info6->local_server_addr) { /* errno might be EINVAL */ tevent_req_error(req, errno); goto post; } - info5->local_server_port = tsocket_address_inet_port(local_server_addr); - if (!info5->local_server_name) { - info5->local_server_name = info5->local_server_addr; + info6->local_server_port = tsocket_address_inet_port(local_server_addr); + if (!info6->local_server_name) { + info6->local_server_name = info6->local_server_addr; } - info5->session_info = discard_const_p(struct auth_session_info_transport, session_info); + info6->session_info = discard_const_p(struct auth_session_info_transport, session_info); if (DEBUGLVL(10)) { NDR_PRINT_DEBUG(named_pipe_auth_req, &state->auth_req); @@ -348,10 +348,10 @@ int _tstream_npa_connect_recv(struct tevent_req *req, npas->unix_stream = talloc_move(stream, &state->unix_stream); switch (state->auth_rep.level) { - case 5: - npas->file_type = state->auth_rep.info.info5.file_type; - device_state = state->auth_rep.info.info5.device_state; - allocation_size = state->auth_rep.info.info5.allocation_size; + case 6: + npas->file_type = state->auth_rep.info.info6.file_type; + device_state = state->auth_rep.info.info6.device_state; + allocation_size = state->auth_rep.info.info6.allocation_size; break; } @@ -1084,7 +1084,7 @@ static void tstream_npa_accept_existing_reply(struct tevent_req *subreq) tevent_req_data(req, struct tstream_npa_accept_state); struct named_pipe_auth_req *pipe_request; struct named_pipe_auth_rep pipe_reply; - struct named_pipe_auth_req_info5 i5; + struct named_pipe_auth_req_info6 i6; enum ndr_err_code ndr_err; DATA_BLOB in, out; int err; @@ -1147,52 +1147,52 @@ static void tstream_npa_accept_existing_reply(struct tevent_req *subreq) NDR_PRINT_DEBUG(named_pipe_auth_req, pipe_request); } - ZERO_STRUCT(i5); + ZERO_STRUCT(i6); - if (pipe_request->level != 5) { + if (pipe_request->level != 6) { DEBUG(0, ("Unknown level %u\n", pipe_request->level)); pipe_reply.level = 0; pipe_reply.status = NT_STATUS_INVALID_LEVEL; goto reply; } - pipe_reply.level = 5; + pipe_reply.level = 6; pipe_reply.status = NT_STATUS_OK; - pipe_reply.info.info5.file_type = state->file_type; - pipe_reply.info.info5.device_state = state->device_state; - pipe_reply.info.info5.allocation_size = state->alloc_size; + pipe_reply.info.info6.file_type = state->file_type; + pipe_reply.info.info6.device_state = state->device_state; + pipe_reply.info.info6.allocation_size = state->alloc_size; - i5 = pipe_request->info.info5; - if (i5.local_server_addr == NULL) { + i6 = pipe_request->info.info6; + if (i6.local_server_addr == NULL) { pipe_reply.status = NT_STATUS_INVALID_ADDRESS; DEBUG(2, ("Missing local server address\n")); goto reply; } - if (i5.remote_client_addr == NULL) { + if (i6.remote_client_addr == NULL) { pipe_reply.status = NT_STATUS_INVALID_ADDRESS; DEBUG(2, ("Missing remote client address\n")); goto reply; } ret = tsocket_address_inet_from_strings(state, "ip", - i5.local_server_addr, - i5.local_server_port, + i6.local_server_addr, + i6.local_server_port, &state->local_server_addr); if (ret != 0) { DEBUG(2, ("Invalid local server address[%s:%u] - %s\n", - i5.local_server_addr, i5.local_server_port, + i6.local_server_addr, i6.local_server_port, strerror(errno))); pipe_reply.status = NT_STATUS_INVALID_ADDRESS; goto reply; } ret = tsocket_address_inet_from_strings(state, "ip", - i5.remote_client_addr, - i5.remote_client_port, + i6.remote_client_addr, + i6.remote_client_port, &state->remote_client_addr); if (ret != 0) { DEBUG(2, ("Invalid remote client address[%s:%u] - %s\n", - i5.remote_client_addr, i5.remote_client_port, + i6.remote_client_addr, i6.remote_client_port, strerror(errno))); pipe_reply.status = NT_STATUS_INVALID_ADDRESS; goto reply; @@ -1249,14 +1249,14 @@ static void tstream_npa_accept_existing_done(struct tevent_req *subreq) tevent_req_done(req); } -static struct named_pipe_auth_req_info5 *copy_npa_info5( - TALLOC_CTX *mem_ctx, const struct named_pipe_auth_req_info5 *src) +static struct named_pipe_auth_req_info6 *copy_npa_info6( + TALLOC_CTX *mem_ctx, const struct named_pipe_auth_req_info6 *src) { - struct named_pipe_auth_req_info5 *dst = NULL; + struct named_pipe_auth_req_info6 *dst = NULL; DATA_BLOB blob; enum ndr_err_code ndr_err; - dst = talloc_zero(mem_ctx, struct named_pipe_auth_req_info5); + dst = talloc_zero(mem_ctx, struct named_pipe_auth_req_info6); if (dst == NULL) { return NULL; } @@ -1265,9 +1265,9 @@ static struct named_pipe_auth_req_info5 *copy_npa_info5( &blob, dst, src, - (ndr_push_flags_fn_t)ndr_push_named_pipe_auth_req_info5); + (ndr_push_flags_fn_t)ndr_push_named_pipe_auth_req_info6); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - DBG_WARNING("ndr_push_named_pipe_auth_req_info5 failed: %s\n", + DBG_WARNING("ndr_push_named_pipe_auth_req_info6 failed: %s\n", ndr_errstr(ndr_err)); TALLOC_FREE(dst); return NULL; @@ -1277,10 +1277,10 @@ static struct named_pipe_auth_req_info5 *copy_npa_info5( &blob, dst, dst, - (ndr_pull_flags_fn_t)ndr_pull_named_pipe_auth_req_info5); + (ndr_pull_flags_fn_t)ndr_pull_named_pipe_auth_req_info6); TALLOC_FREE(blob.data); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - DBG_WARNING("ndr_push_named_pipe_auth_req_info5 failed: %s\n", + DBG_WARNING("ndr_push_named_pipe_auth_req_info6 failed: %s\n", ndr_errstr(ndr_err)); TALLOC_FREE(dst); return NULL; @@ -1294,7 +1294,7 @@ int _tstream_npa_accept_existing_recv( int *perrno, TALLOC_CTX *mem_ctx, struct tstream_context **stream, - struct named_pipe_auth_req_info5 **info5, + struct named_pipe_auth_req_info6 **info6, enum dcerpc_transport_t *transport, struct tsocket_address **remote_client_addr, char **_remote_client_name, @@ -1305,7 +1305,7 @@ int _tstream_npa_accept_existing_recv( { struct tstream_npa_accept_state *state = tevent_req_data(req, struct tstream_npa_accept_state); - struct named_pipe_auth_req_info5 *i5 = &state->pipe_request->info.info5; + struct named_pipe_auth_req_info6 *i6 = &state->pipe_request->info.info6; struct tstream_npa *npas; int ret; @@ -1346,24 +1346,24 @@ int _tstream_npa_accept_existing_recv( npas->unix_stream = state->plain; npas->file_type = state->file_type; - if (info5 != NULL) { + if (info6 != NULL) { /* - * Make a full copy of "info5" because further down we + * Make a full copy of "info6" because further down we * talloc_move() away substructures from * state->pipe_request. */ - struct named_pipe_auth_req_info5 *dst = copy_npa_info5( - mem_ctx, i5); + struct named_pipe_auth_req_info6 *dst = copy_npa_info6( + mem_ctx, i6); if (dst == NULL) { *perrno = ENOMEM; tevent_req_received(req); return -1; } - *info5 = dst; + *info6 = dst; } if (transport != NULL) { - *transport = i5->transport; + *transport = i6->transport; } if (remote_client_addr != NULL) { *remote_client_addr = talloc_move( @@ -1371,7 +1371,7 @@ int _tstream_npa_accept_existing_recv( } if (_remote_client_name != NULL) { *_remote_client_name = discard_const_p( - char, talloc_move(mem_ctx, &i5->remote_client_name)); + char, talloc_move(mem_ctx, &i6->remote_client_name)); } if (local_server_addr != NULL) { *local_server_addr = talloc_move( @@ -1379,10 +1379,10 @@ int _tstream_npa_accept_existing_recv( } if (local_server_name != NULL) { *local_server_name = discard_const_p( - char, talloc_move(mem_ctx, &i5->local_server_name)); + char, talloc_move(mem_ctx, &i6->local_server_name)); } if (session_info != NULL) { - *session_info = talloc_move(mem_ctx, &i5->session_info); + *session_info = talloc_move(mem_ctx, &i6->session_info); } tevent_req_received(req); diff --git a/libcli/named_pipe_auth/npa_tstream.h b/libcli/named_pipe_auth/npa_tstream.h index 1d7e93dc0fa..4aff10f9afd 100644 --- a/libcli/named_pipe_auth/npa_tstream.h +++ b/libcli/named_pipe_auth/npa_tstream.h @@ -27,7 +27,7 @@ struct tevent_req; struct tevent_context; struct auth_session_info_transport; struct tsocket_address; -struct named_pipe_auth_req_info5; +struct named_pipe_auth_req_info6; struct tevent_req *tstream_npa_connect_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, @@ -114,7 +114,7 @@ int _tstream_npa_accept_existing_recv( int *perrno, TALLOC_CTX *mem_ctx, struct tstream_context **stream, - struct named_pipe_auth_req_info5 **info5, + struct named_pipe_auth_req_info6 **info6, enum dcerpc_transport_t *transport, struct tsocket_address **remote_client_addr, char **_remote_client_name, |