summaryrefslogtreecommitdiffstats
path: root/packaging/Caldera/OpenServer/findsmb
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/Caldera/OpenServer/findsmb')
-rwxr-xr-xpackaging/Caldera/OpenServer/findsmb8
1 files changed, 6 insertions, 2 deletions
diff --git a/packaging/Caldera/OpenServer/findsmb b/packaging/Caldera/OpenServer/findsmb
index c87fdb5190a..08c5df11250 100755
--- a/packaging/Caldera/OpenServer/findsmb
+++ b/packaging/Caldera/OpenServer/findsmb
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
#
# Prints info on all smb responding machines on a subnet.
# This script needs to be run on a machine without nmbd running and be
@@ -15,7 +15,7 @@
# that workgroup.
#
-$SAMBABIN = "/usr/local/samba/bin";
+$SAMBABIN = "/usr/lib/samba/bin";
for ($i = 0; $i < 2; $i++) { # test for -d option and broadcast address
$_ = shift;
@@ -73,6 +73,9 @@ foreach $ip (@ipaddrs) # loop through each IP address found
$name = "unknown nis name";
}
} else {
+# 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,6 +106,7 @@ foreach $ip (@ipaddrs) # loop through each IP address found
@name = grep(/<00> - <GROUP>/,@nmblookup);
$_ = @name[0];
if ($_) {
+# Same as before for space and characters
/(.{1,15})\s+<00>\s+/;
$_ = "[$1]";
} else {