mirror of
https://github.com/samba-team/samba.git
synced 2025-01-27 14:04:05 +03:00
added check for one more error case
(This used to be commit 6cba6919ebf65691d2fb6a880da038a6dff9f6b1)
This commit is contained in:
parent
8c5c093b96
commit
ff71b96f42
@ -65,9 +65,17 @@ foreach $ip (@ipaddrs) # loop through each IP address found
|
|||||||
|
|
||||||
@name = grep(/<00>/,@nmblookup);
|
@name = grep(/<00>/,@nmblookup);
|
||||||
$_ = @name[0];
|
$_ = @name[0];
|
||||||
if ($_) { # we have a netbios name
|
if ($_) { # we have a netbios name
|
||||||
/(\S+)/;
|
if (/GROUP/) { # is it a group name
|
||||||
$name = $1;
|
($name, $aliases, $type, $length, @addresses) =
|
||||||
|
gethostbyaddr(pack('C4',split('\.',$ip)),2);
|
||||||
|
if (! $name) { # could not get name
|
||||||
|
$name = "unknown nis name";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/(\S+)/;
|
||||||
|
$name = $1;
|
||||||
|
}
|
||||||
|
|
||||||
# do an smbclient command on the netbios name.
|
# do an smbclient command on the netbios name.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user