NT_STATUS_ADDRESS_ALREADY_ASSOCIATED
Andrew Bartlett
abartlet at samba.org
Fri Jan 4 04:18:49 MST 2013
On Fri, 2013-01-04 at 06:37 +0100, Günter Kukkukk wrote:
> In irpc_binding_handle_by_name() an error check is done
> if (sids[0].pid == 0) {
> which is always true for the "samba" main-task.
> It's above my skills why that check is needed here.
> (sure, all server_id arrays are usually terminated with
> a final entry cluster_id(0, 0) )
>
> struct dcerpc_binding_handle *irpc_binding_handle_by_name(TALLOC_CTX *mem_ctx,
> struct imessaging_context *msg_ctx,
> const char *dest_task,
> const struct ndr_interface_table *table)
> {
> struct dcerpc_binding_handle *h;
> struct server_id *sids;
> struct server_id sid;
>
> /* find the server task */
> sids = irpc_servers_byname(msg_ctx, mem_ctx, dest_task);
> if (sids == NULL) {
> errno = EADDRNOTAVAIL;
> return NULL;
> }
> if (sids[0].pid == 0) { <<<<===== !!!!!! always TRUE for "samba"!
> talloc_free(sids);
> errno = EADDRNOTAVAIL;
> return NULL;
> }
> sid = sids[0];
> talloc_free(sids);
>
> h = irpc_binding_handle(mem_ctx, msg_ctx,
> sid, table);
> if (h == NULL) {
> return NULL;
> }
>
> return h;
> }
Thanks for the analysis Günter.
We simply need to terminate this array with something other than
cluster_id(0, 0). The line you indicate is always true because the
array in this case contains both the real 0,0 entry and the terminator
as a 0,0 entry.
The easy option is to make irpc_servers_byname return an array of
pointers to struct server_sid, so we can use a NULL terminator. It
isn't used in many places, so this shouldn't be too hard to fix up.
Andrew Bartlett
--
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
More information about the samba-technical
mailing list