Fix nmblookup parsing
Changes PlannedPublic

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


Diff Detail

R627 Samba Mounter
No Linters Available
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

with output:

Looking up status of
        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 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
[21:45] <[ade]> The specified netbios name [] is too long!
[21:45] <[ade]> [adridg@beastie ~/src/FreeBSD/ports-kde]$ nmblookup smurf
[21:45] <[ade]> smurf<00>