Had some environment problem to test the fix, so it would be really appreciated if...
authorSimo Sorce <idra@samba.org>
Wed, 1 May 2002 10:05:52 +0000 (10:05 +0000)
committerSimo Sorce <idra@samba.org>
Wed, 1 May 2002 10:05:52 +0000 (10:05 +0000)
This fix is to make findsmb aware that the space a valid NetBIOS name character and to not get only the first part of the name as the NetBIOS name if it contains spaces.

Simo.
(This used to be commit 58cf23f4da2b36f173fcb6a695ff6798be5c589b)

packaging/Caldera/OpenLinux/findsmb
packaging/Caldera/OpenServer/findsmb
packaging/Caldera/UnixWare/findsmb
packaging/Mandrake/findsmb
packaging/PHT/TurboLinux/findsmb
packaging/RedHat/findsmb
packaging/SGI/findsmb

index 986c2481779664268161168de8861f2953dca8ff..f70d18dcbdc1019163443dee92cb043df6f10f9b 100755 (executable)
@@ -73,7 +73,7 @@ foreach $ip (@ipaddrs)                # loop through each IP address found
            $name = "unknown nis name";
        }
     } else {
-       /(\S+)/;
+       /(.{1,15})\s+<00>\s+/;
        $name = $1;
     }
 
@@ -103,7 +103,7 @@ foreach $ip (@ipaddrs)              # loop through each IP address found
       @name = grep(/<00> - <GROUP>/,@nmblookup);
       $_ = @name[0];
       if ($_) {
-        /(\S+)/;
+        /(.{1,15})\s+<00>\s+/;
         $_ = "[$1]";
       } else {
        $_ = "Unknown Workgroup";
index bb91c784b89eb52ed0805368732090f2ed9ad61e..c87fdb5190a7eb8a57dcd65f9bcf1d0b629ad3f8 100755 (executable)
@@ -73,7 +73,7 @@ foreach $ip (@ipaddrs)                # loop through each IP address found
            $name = "unknown nis name";
        }
     } else {
-       /(\S+)/;
+       /(.{1,15})\s+<00>\s+/;
        $name = $1;
     }
 
@@ -103,7 +103,7 @@ foreach $ip (@ipaddrs)              # loop through each IP address found
       @name = grep(/<00> - <GROUP>/,@nmblookup);
       $_ = @name[0];
       if ($_) {
-        /(\S+)/;
+        /(.{1,15})\s+<00>\s+/;
         $_ = "[$1]";
       } else {
        $_ = "Unknown Workgroup";
index bb91c784b89eb52ed0805368732090f2ed9ad61e..c87fdb5190a7eb8a57dcd65f9bcf1d0b629ad3f8 100755 (executable)
@@ -73,7 +73,7 @@ foreach $ip (@ipaddrs)                # loop through each IP address found
            $name = "unknown nis name";
        }
     } else {
-       /(\S+)/;
+       /(.{1,15})\s+<00>\s+/;
        $name = $1;
     }
 
@@ -103,7 +103,7 @@ foreach $ip (@ipaddrs)              # loop through each IP address found
       @name = grep(/<00> - <GROUP>/,@nmblookup);
       $_ = @name[0];
       if ($_) {
-        /(\S+)/;
+        /(.{1,15})\s+<00>\s+/;
         $_ = "[$1]";
       } else {
        $_ = "Unknown Workgroup";
index 986c2481779664268161168de8861f2953dca8ff..f70d18dcbdc1019163443dee92cb043df6f10f9b 100755 (executable)
@@ -73,7 +73,7 @@ foreach $ip (@ipaddrs)                # loop through each IP address found
            $name = "unknown nis name";
        }
     } else {
-       /(\S+)/;
+       /(.{1,15})\s+<00>\s+/;
        $name = $1;
     }
 
@@ -103,7 +103,7 @@ foreach $ip (@ipaddrs)              # loop through each IP address found
       @name = grep(/<00> - <GROUP>/,@nmblookup);
       $_ = @name[0];
       if ($_) {
-        /(\S+)/;
+        /(.{1,15})\s+<00>\s+/;
         $_ = "[$1]";
       } else {
        $_ = "Unknown Workgroup";
index 986c2481779664268161168de8861f2953dca8ff..f70d18dcbdc1019163443dee92cb043df6f10f9b 100755 (executable)
@@ -73,7 +73,7 @@ foreach $ip (@ipaddrs)                # loop through each IP address found
            $name = "unknown nis name";
        }
     } else {
-       /(\S+)/;
+       /(.{1,15})\s+<00>\s+/;
        $name = $1;
     }
 
@@ -103,7 +103,7 @@ foreach $ip (@ipaddrs)              # loop through each IP address found
       @name = grep(/<00> - <GROUP>/,@nmblookup);
       $_ = @name[0];
       if ($_) {
-        /(\S+)/;
+        /(.{1,15})\s+<00>\s+/;
         $_ = "[$1]";
       } else {
        $_ = "Unknown Workgroup";
index 986c2481779664268161168de8861f2953dca8ff..04bc60805085369961e7f35532793ed0f1acb325 100755 (executable)
@@ -73,7 +73,10 @@ foreach $ip (@ipaddrs)               # loop through each IP address found
            $name = "unknown nis name";
        }
     } else {
-       /(\S+)/;
+# The Netbios name can contain lot of characters also '<' '>'
+# and spaces. The follwing cure inside name space but not
+# names starting or ending with spaces
+       /(.{1,15})\s+<00>\s+/;
        $name = $1;
     }
 
@@ -103,7 +106,8 @@ foreach $ip (@ipaddrs)              # loop through each IP address found
       @name = grep(/<00> - <GROUP>/,@nmblookup);
       $_ = @name[0];
       if ($_) {
-        /(\S+)/;
+# Same as before for space and characters
+        /(.{1,15})\s+<00>\s+/;
         $_ = "[$1]";
       } else {
        $_ = "Unknown Workgroup";
index a48ec592e80f814e0dae6bd4115ecc1d148ae63d..336ff07c16f3295da6371bf8ac50a81a02f6c014 100755 (executable)
@@ -73,7 +73,7 @@ foreach $ip (@ipaddrs)                # loop through each IP address found
            $name = "unknown nis name";
        }
     } else {
-       /(\S+)/;
+       /(.{1,15})\s+<00>\s+/;
        $name = $1;
     }
 
@@ -103,7 +103,7 @@ foreach $ip (@ipaddrs)              # loop through each IP address found
       @name = grep(/<00> - <GROUP>/,@nmblookup);
       $_ = @name[0];
       if ($_) {
-        /(\S+)/;
+        /(.{1,15})\s+<00>\s+/;
         $_ = "[$1]";
       } else {
        $_ = "Unknown Workgroup";