netcmd/dns: Catch wildcard patterns when querying for name
authorAmitay Isaacs <amitay@gmail.com>
Fri, 2 Aug 2013 08:53:56 +0000 (18:53 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Sat, 30 Nov 2013 03:22:57 +0000 (14:22 +1100)
DNS query should either be '@' to represent entire zone or a fixed string
and not wildcard search pattern.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Kai Blin <kai@samba.org>
python/samba/netcmd/dns.py

index 137cd989f0c5e41bb704956d13079a24e10d8439..de0c94d5166861d8c6a3d15765b6b6195765b84a 100644 (file)
@@ -955,6 +955,9 @@ class cmd_query(Command):
             versionopts=None):
         record_type = dns_type_flag(rtype)
 
+        if name.find('*') != -1:
+            raise CommandError('Wildcard searches not supported. To dump entire zone use "@"')
+
         select_flags = 0
         if authority:
             select_flags |= dnsserver.DNS_RPC_VIEW_AUTHORITY_DATA