Bug 13788 - bug in cmd line parsing in samba-tool dns add SRV/MX/SOA field
bug in cmd line parsing in samba-tool dns add SRV/MX/SOA field
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Python
All All
: P5 normal
: ---
Assigned To: Jelmer Vernooij
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2019-02-15 09:58 UTC by Denis Cardon
Modified: 2019-02-24 05:56 UTC (History)
0 users

See Also:

patch fixing incorrect use of split(' ') (1.40 KB, patch)
2019-02-15 10:29 UTC, Denis Cardon
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Cardon 2019-02-15 09:58:44 UTC
netcmd/dns.py, line 420, 428, 438

the parsing of arguments is done as this:
 tmp = data.split(' ') 

This syntax does not allow to have two spaces between the different values, thus the following line fails with error "ERROR: Data requires 4 elements - server, port, priority, weight" (look at the two space characters between server name and port):

samba-tool dns add dc1 ad.test.fr _kerberos._tcp SRV "dc2.ad.test   88   0 100 "

The aforementioned line should be :
 tmp = data.split()

as this syntax allow one or more space between two arguments.
Comment 1 Denis Cardon 2019-02-15 10:29:35 UTC
Created attachment 14849 [details]
patch fixing incorrect use of split(' ')

bug is present in master and former release. patch applies (with offset 1) on 4.9.4.
Comment 2 Denis Cardon 2019-02-15 15:28:26 UTC
fix pushed to master https://lists.samba.org/archive/samba-technical/2019-February/132537.html
Comment 3 Douglas Bagnall 2019-02-24 05:56:39 UTC
thanks Denis!