LMHOSTSFILE is now dynamically configured too.
[tprouty/samba.git] / source / libsmb / namequery.c
index 0dbf4b45642e5fcc8308e66521d84bc4310d37dc..0e696a085b92fd13761ce89b41e890cee67495ff 100644 (file)
@@ -205,7 +205,7 @@ BOOL name_register(int fd, const char *name, int name_type,
 
   register_ip.s_addr = name_ip.s_addr;  /* Fix this ... */
   
-  bzero((char *)&p, sizeof(p));
+  memset((char *)&p, '\0', sizeof(p));
 
   *count = 0;
 
@@ -237,7 +237,7 @@ BOOL name_register(int fd, const char *name, int name_type,
 
   }
 
-  bzero((char *)nmb->additional, sizeof(struct res_rec));
+  memset((char *)nmb->additional, '\0', sizeof(struct res_rec));
 
   nmb->additional->rr_name  = nmb->question.question_name;
   nmb->additional->rr_type  = RR_TYPE_NB;
@@ -748,7 +748,7 @@ static BOOL resolve_lmhosts(const char *name, int name_type,
 
        DEBUG(3,("resolve_lmhosts: Attempting lmhosts lookup for name %s<0x%x>\n", name, name_type));
 
-       fp = startlmhosts( LMHOSTSFILE );
+       fp = startlmhosts(dyn_LMHOSTSFILE);
        if(fp) {
                while (getlmhostsent(fp, lmhost_name, &name_type2, &return_ip)) {
                        if (strequal(name, lmhost_name) && 
@@ -1176,3 +1176,11 @@ BOOL get_dc_list(BOOL pdc_only, char *group, struct in_addr **ip_list, int *coun
 {
        return internal_resolve_name(group, pdc_only ? 0x1B : 0x1C, ip_list, count);
 }
+
+/********************************************************
+  Get the IP address list of the Domain Master Browsers
+ ********************************************************/ 
+BOOL get_dmb_list(struct in_addr **ip_list, int *count)
+{
+    return internal_resolve_name( MSBROWSE, 0x1, ip_list, count);
+}