Fix nmblookup parsing
AbandonedPublic

Authored by davidedmundson on Jan 4 2019, 4:31 PM.

Details

Diff Detail

Repository
R627 Samba Mounter
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 6638
Build 6656: arc lint + arc unit
davidedmundson requested review of this revision.Jan 4 2019, 4:31 PM
davidedmundson created this revision.
apol added a comment.Jan 7 2019, 3:48 PM

Maybe it would be useful to add a an example of the command as a comment? This does the entire opposite.

davidedmundson planned changes to this revision.Jan 9 2019, 3:02 PM

Aha, so

samba-mounter issues one of two commands:

IP version:

nmblookup -T -A 192.168.1.2

with output:

Looking up status of 192.168.1.2
        DAVID-SERVER    <00> -         B <ACTIVE> 
        DAVID-SERVER    <03> -         B <ACTIVE> 
        DAVID-SERVER    <20> -         B <ACTIVE> 
        ..__MSBROWSE__. <01> - <GROUP> B <ACTIVE> 
        WORKGROUP       <00> - <GROUP> B <ACTIVE> 
        WORKGROUP       <1d> -         B <ACTIVE> 
        WORKGROUP       <1e> - <GROUP> B <ACTIVE> 

        MAC Address = 00-00-00-00-00-00

Host version

nmblookup  pnhub1

with output

192.168.1.1 pnhub1<00>

The parsing is correct for the latter, wrong for the first.

apol added a comment.Jan 9 2019, 7:08 PM

🤯

Thanks for checking.

Third possible output:

[21:45] <[ade]> [adridg@beastie ~/src/FreeBSD/ports-kde]$ nmblookup smurf.someHost.org
[21:45] <[ade]> The specified netbios name [smurf.someHost.org] is too long!
[21:45] <[ade]> [adridg@beastie ~/src/FreeBSD/ports-kde]$ nmblookup smurf
[21:45] <[ade]> 10.0.0.2 smurf<00>

davidedmundson abandoned this revision.Aug 28 2019, 6:09 PM