Fix nmblookup parsing
Changes PlannedPublic

Authored by davidedmundson on Fri, Jan 4, 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.Fri, Jan 4, 4:31 PM
davidedmundson created this revision.
apol added a comment.Mon, Jan 7, 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.Wed, Jan 9, 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.Wed, Jan 9, 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>