svn commit: samba r3143 - in branches/SAMBA_3_0/source/libsmb: .
vlendec at samba.org
vlendec at samba.org
Sat Oct 23 09:20:08 GMT 2004
Author: vlendec
Date: 2004-10-23 09:20:02 +0000 (Sat, 23 Oct 2004)
New Revision: 3143
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_3_0/source/libsmb&rev=3143&nolog=1
Log:
Allow for multiple DC's to be named as #1c names in lmhosts.
Volker
Modified:
branches/SAMBA_3_0/source/libsmb/namequery.c
Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/namequery.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/namequery.c 2004-10-23 06:22:57 UTC (rev 3142)
+++ branches/SAMBA_3_0/source/libsmb/namequery.c 2004-10-23 09:20:02 UTC (rev 3143)
@@ -855,22 +855,35 @@
fp = startlmhosts(dyn_LMHOSTSFILE);
if(fp) {
- while (getlmhostsent(fp, lmhost_name, &name_type2, &return_ip)) {
- if (strequal(name, lmhost_name) &&
- ((name_type2 == -1) || (name_type == name_type2))
- ) {
- endlmhosts(fp);
- if ( (*return_iplist = (struct ip_service *)malloc(sizeof(struct ip_service))) == NULL ) {
- DEBUG(3,("resolve_lmhosts: malloc fail !\n"));
- return False;
- }
- (*return_iplist)[0].ip = return_ip;
- (*return_iplist)[0].port = PORT_NONE;
- *return_count = 1;
- return True;
+ while (getlmhostsent(fp, lmhost_name, &name_type2,
+ &return_ip)) {
+
+ if (!strequal(name, lmhost_name))
+ continue;
+
+ if ((name_type2 != -1) && (name_type != name_type2))
+ continue;
+
+ *return_iplist = (struct ip_service *)
+ realloc((*return_iplist),
+ sizeof(struct ip_service) *
+ ((*return_count)+1));
+
+ if ((*return_iplist) == NULL) {
+ DEBUG(3,("resolve_lmhosts: malloc fail !\n"));
+ return False;
}
+
+ (*return_iplist)[*return_count].ip = return_ip;
+ (*return_iplist)[*return_count].port = PORT_NONE;
+ *return_count += 1;
+
+ /* Multiple names only for DC lookup */
+ if (name_type != 0x1c)
+ break;
}
endlmhosts(fp);
+ return True;
}
return False;
}
More information about the samba-cvs
mailing list