[SAMBA4][PATCH] don't try to resolv ipaddr-strings into an ip-address

tridge at samba.org tridge at samba.org
Tue Sep 13 00:29:37 GMT 2005


Metze,

 > here's a patch to prevent resolving ip-addr strings into an ip-address.

unfortunately this patch could cause us to block forever, due to a
flaw in the way the events code works. The problem is that if someone
does this:

  ctx = resolve_name_send(name, ev, NULL);

and then returns to the top level event loop, because they want the
name resolution to happen in an async fashion, then with your patch no
event will be generated and so the call is stuck forever. If the
caller uses the resolve_name() sync interface then it isn't a problem,
as that uses composite_wait() which does this:

	while (c->state < SMBCLI_REQUEST_DONE) {
		....
	}

which means it will never go to the event code, and this won't wait.

I can think of a couple of solution to this:

 1) we could require callers of all async functions to check c->state
    before returning to the event loop. This would be quite error
    prone, so I'd prefer not to do this

 2) we can invent some way of triggering a pseudo-event in this sort
    of case.

I'll see if I can find a way to do (2)

 > btw: why do we send a nbt name lookup first to 127.0.0.1:137 and when that 
 > timedout fallback to broadcast?

the default name resolve order is "lmhosts wins host bcast" so I'd
guess you are seeing us talk to ourselves as a wins server. 

Cheers, Tridge


More information about the samba-technical mailing list