- continue when failing to load config file in nmblookup and smbclient
authorAndrew Tridgell <tridge@samba.org>
Mon, 7 Oct 1996 11:06:34 +0000 (11:06 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 7 Oct 1996 11:06:34 +0000 (11:06 +0000)
- fix important bug in nmbd where it set the return code for a
negative name response to 0 (which means success!)
(This used to be commit bfa816cc8f30d9a629b4fe9f71bf0707aa6c4502)

source3/client/client.c
source3/namepacket.c
source3/smbd/reply.c
source3/utils/nmblookup.c

index b8b63207d79cc9c7d4fd90f1afaa7b10aad855c3..477c8fe1f8bf767eaf48091e2219e97a34873f2e 100644 (file)
@@ -4500,7 +4500,6 @@ static void usage(char *pname)
 
   if (!lp_load(servicesf,True)) {
     fprintf(stderr, "Can't load %s - run testparm to debug it\n", servicesf);
-    return (-1);
   }
 
   if (*workgroup == 0)
index 5bfa55d4f1646645c4788f97588a99dd3cb6b943..cd133d0a53bac6c3d5a7d3ebd675114dd7610d89 100644 (file)
@@ -252,7 +252,7 @@ void reply_netbios_packet(struct packet_struct *p1,int trn_id,
   nmb->header.ancount = 1;
   nmb->header.nscount = 0;
   nmb->header.arcount = 0;
-  nmb->header.rcode = 0;
+  nmb->header.rcode = rcode;
   
   bzero((char*)&nmb->question,sizeof(nmb->question));
   
index 89b07f1b9ec880612c6aa5cf4c50469780ca8e2b..48a0732617e2916d8c9e508e5e33667a9124a3be 100644 (file)
@@ -302,7 +302,7 @@ int reply_unknown(char *inbuf,char *outbuf)
 int reply_ioctl(char *inbuf,char *outbuf)
 {
   DEBUG(3,("ignoring ioctl\n"));
-#if 1
+#if 0
   /* we just say it succeeds and hope its all OK. 
      some day it would be nice to interpret them individually */
   return set_message(outbuf,1,0,True); 
index c137b4f93acd48b44c3229a3d535a6280bbdf97a..ccdbec45e6ea984a1eeefeb5d0f9f8e9124a77d7 100644 (file)
@@ -101,6 +101,8 @@ int main(int argc,char *argv[])
   BOOL find_status=False;
   int i;
   static pstring servicesf = CONFIGFILE;
+  struct in_addr bcast_addr;
+  BOOL got_bcast = False;
   
   DEBUGLEVEL = 1;
   *lookup = 0;
@@ -116,6 +118,8 @@ int main(int argc,char *argv[])
       {
       case 'B':
        iface_set_default(NULL,optarg,NULL);
+       bcast_addr = *interpret_addr2(optarg);
+       got_bcast = True;
        break;
       case 'i':
        strcpy(scope,optarg);
@@ -149,14 +153,16 @@ int main(int argc,char *argv[])
 
   if (!lp_load(servicesf,True)) {
     fprintf(stderr, "Can't load %s - run testparm to debug it\n", servicesf);
-    return (-1);
   }
 
   load_interfaces();
   init_structs();
   if (!open_sockets()) return(1);
 
-  DEBUG(1,("Sending queries to %s\n",inet_ntoa(*iface_bcast(ipzero))));
+  if (!got_bcast)
+    bcast_addr = *iface_bcast(ipzero);
+
+  DEBUG(1,("Sending queries to %s\n",inet_ntoa(bcast_addr)));
 
 
   for (i=optind;i<argc;i++)
@@ -187,7 +193,7 @@ int main(int argc,char *argv[])
       }
 
     if (name_query(ServerFD,lookup,lookup_type,bcast,True,
-                    *iface_bcast(ipzero),&ip,NULL)) 
+                  bcast_addr,&ip,NULL)) 
        {
          printf("%s %s\n",inet_ntoa(ip),lookup);
     }