Tom Crummey
2009-Jun-17 14:27 UTC
[Samba] Samba 3.3.5 problem with hostnames in allow hosts list
Hello, My environment is Solaris 10 with samba 3.3.5 compiled with gcc 4.1 using OpenLDAP libraries 2.4. I use netgroups in the allow hosts directive to enable access to my samba server. This worked in our production version of samba (3.0.28c) but does not in 3.3.5. I've done some debugging and it seems the problem occurs in get_peer_name in lib/util_sock.c This routine always returns whatever is in the memcache and never seems to actually perform the sys_getnameinfo call. I don't understand the logic in get_peer_name: nc is declared at the top of the function (line 1816), then if get_peer_name is called with force_lookup==true, the next thing that happens is a lookup_nc(&nc) (line 1840). The bit I don't understand is that nc is not initialised between being declared and the lookup_nc call being performed. To my mind this would lead to undefined results which might explain why sys_getnameinfo is never called. Should there be something like nc.name = get_peer_addr_internal(fd, addr_buf, sizeof(addr_buf), &nc.ss, &length); before the lookup_nc? Any help/explanation gratefully received. Thanks, -- Tom. -------------------------------------------------------------------------- Tom Crummey, Systems and Network Manager, EMAIL: tom@ee.ucl.ac.uk Dept. of Electronic and Electrical Engineering, University College London, Roberts Building, TEL: +44 (0)20 7679 3898 Torrington Place, FAX: +44 (0)20 7388 9325 London, UK, WC1E 7JE. --------------------------------------------------------------------------