summaryrefslogtreecommitdiff
path: root/source4/dns_server
Commit message (Collapse)AuthorAgeFilesLines
* Avoid including libds/common/roles.h in public loadparm.h header.Jelmer Vernooij2016-01-131-0/+1
| | | | | | Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-By: Andrew Bartlett <abartlet@samba.org> Reviewed-By: Stefan Metzmacher <metze@samba.org>
* bind_dlz: Fix CID 1347318 Unchecked return valueVolker Lendecke2016-01-081-3/+13
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dns_server: Remove unused handle_questionVolker Lendecke2015-12-151-91/+0
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Kai Blin <kai@samba.org> Autobuild-User(master): Kai Blin <kai@samba.org> Autobuild-Date(master): Tue Dec 15 17:50:32 CET 2015 on sn-devel-104
* dns_server: Add handle_authoritative_send()Volker Lendecke2015-12-151-15/+293
| | | | | | | | An async version of handle_question Bug: https://bugzilla.samba.org/show_bug.cgi?id=9409 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Kai Blin <kai@samba.org>
* dns_server: Add add_dns_res_rec()Volker Lendecke2015-12-151-0/+124
| | | | | | | Same as add_response_rr(), but it copies over a dns_res_rec Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Kai Blin <kai@samba.org>
* dns_server: Convert "ask_forwarder" paramsVolker Lendecke2015-12-151-3/+2
| | | | | | | Usually we have mem_ctx and ev first when doing a _send function Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Kai Blin <kai@samba.org>
* dns_server: Simplify array length handlingVolker Lendecke2015-12-151-21/+17
| | | | | | | talloc objects carry an implicit length Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Kai Blin <kai@samba.org>
* dns_server: Simplify talloc handlingVolker Lendecke2015-12-151-6/+24
| | | | | | | | By making sure that the answers are always allocated, we don't have to pass an explicit mem_ctx anymore Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Kai Blin <kai@samba.org>
* dns_server: Consolidate talloc_reallocVolker Lendecke2015-12-151-23/+18
| | | | | | | | | This puts the talloc_realloc into add_response_rr instead of before create_response_rr. It is a bit less efficient, but as we do not expect hundreds of answers, I think this code is a bit easier to understand. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Kai Blin <kai@samba.org>
* libdns: Convert dns_udp_request to 0/errnoVolker Lendecke2015-12-081-2/+4
| | | | | | | Replaces 5 calls to unix_to_werror with just one Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dns_server: Fix a clang warningVolker Lendecke2015-11-101-1/+1
| | | | | | | | | | | | clang complains that '\0' is converted to a NULL pointer. This seems to work fine, so make this pointer explicitly NULL. If instead we need a "" here, we could of course do that too. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Nov 10 10:13:18 CET 2015 on sn-devel-104
* pydns: Add replace_by_dn()Andrew Bartlett2015-10-261-0/+58
| | | | | | | | This allows us to find a DNS record by searching LDB and unpacking the dnsRecord but replace the record using the common code that will create a tombstone Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dns_server: Give WERR_DNS_ERROR_NAME_DOES_NOT_EXIST on empty recordsAndrew Bartlett2015-10-261-8/+14
| | | | | | | | When not looking for tombstones, a record without a dnsRecord value may as well not be present, so just return WERR_DNS_ERROR_NAME_DOES_NOT_EXIST Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dns_server: Add python method to extract a DNS entry from a ldb.MessageElementAndrew Bartlett2015-10-261-0/+36
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dns_server: Add a python module directly accessing DNS records in sam.ldbAndrew Bartlett2015-10-262-0/+231
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dns_server: Put more code in commonAndrew Bartlett2015-10-265-156/+195
| | | | | | | This will allow a python module to be written to modify DNS entries in sam.ldb directly Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dns_server: Fix a small memleakVolker Lendecke2015-08-071-0/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Fri Aug 7 12:57:02 CEST 2015 on sn-devel-104
* dns_server: Don't call tevent_req_finish twiceVolker Lendecke2015-08-071-3/+7
| | | | | | | | Both tevent_req_werror and tevent_req_done call tevent_req_finish on a request. This should not be done. We should only call either of both. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* dns: always add authority recordsKai Blin2015-08-062-8/+22
| | | | | | | | Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Kai Blin <kai@samba.org> Autobuild-Date(master): Thu Aug 6 14:06:52 CEST 2015 on sn-devel-104
* dns: Add a SOA record to error repliesKai Blin2015-08-061-1/+51
| | | | | Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* dns: Also pass nsrecs to handle_question()Kai Blin2015-08-061-4/+10
| | | | | Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* dns: Just pass the name to create_response_rrKai Blin2015-08-061-4/+4
| | | | | Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* dns: Add dns_get_authoritative_zone helper functionKai Blin2015-08-062-0/+18
| | | | | Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* dns_server: Fix CNAME handlingVolker Lendecke2015-08-041-5/+1
| | | | | | | | | | | | recs[i].wtype is == DNS_TYPE_CNAME, and my understanding of the union is that data.cname is filled. We get away with this, because ipv4 and ipv6 have the same char * representation, but it's confusing. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Aug 4 13:41:17 CEST 2015 on sn-devel-104
* dns_server: Add NULL checkVolker Lendecke2015-08-041-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* dlz_bind9: Fix keytab location.Andreas Schneider2015-03-201-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Do not use popt_common.h in dlz_bind9Andrew Bartlett2015-03-161-1/+1
| | | | | | | We do not use popt_common structures here Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* s4-dns: Reload DNS zones from dsdb when zones are modified through RPC or DRSSamuel Cabrero2014-12-221-38/+95
| | | | | | | | | | | | | Setup a RPC management call on the internal DNS server triggered a new LDB module which sniffs dnsZone object add, delete and modify operations. This way the notification is triggered when zones are modified either from RPC or replicated by inbound DRS. Signed-off-by: Samuel Cabrero <samuelcabrero@kernevil.me> (shadowed variable error corrected by abartlet) Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* dns_server: Only build common library if AD DC is enabled.Andreas Schneider2014-11-261-1/+1
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Nov 26 12:11:18 CET 2014 on sn-devel-104
* s4-dns: dlz-bind: Add trailing '.' to all fqdn stringsAmitay Isaacs2014-11-211-10/+45
| | | | | | | | | | | | | | BIND 9.10.x is strict when sending records via putrr and putnamedrr. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10620 Thanks to Guenter Kukkukk for identifying the problem and resolution. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Guenter Kukkukk <kukks@samba.org> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Fri Nov 21 06:14:55 CET 2014 on sn-devel-104
* s4:dns_server: allocate substructures of struct dns_request_state on the ↵Stefan Metzmacher2014-11-184-3/+5
| | | | | | | correct TALLOC_CTX Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* s4:dns_server: add some const to ↵Stefan Metzmacher2014-11-182-5/+5
| | | | | | | dns_server_process_update/dns_update_allowed arguments Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* dns: Fix a compile warning by casting explicitlyKai Blin2014-10-302-5/+5
| | | | | Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-dns: Add support for BIND 9.10Amitay Isaacs2014-10-252-1/+28
| | | | | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Matthieu Patou <mat@matws.net> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Sat Oct 25 05:42:19 CEST 2014 on sn-devel-104
* s4-dns: Update dlz_minimal.h based on BIND release 9.10Amitay Isaacs2014-10-251-54/+153
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Matthieu Patou <mat@matws.net>
* s4-dns: Check DLZ_DLOPEN_VERSION for different BIND versionsAmitay Isaacs2014-10-252-14/+10
| | | | | Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Matthieu Patou <mat@matws.net>
* s4:dlz_bind9: let dlz_bind9 use dns_common_lookup() before add/modifyStefan Metzmacher2014-08-271-56/+21
| | | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Aug 27 15:21:19 CEST 2014 on sn-devel-104
* s4:dlz_bind9: let dlz_bind9 use dns_common_lookup() before removing recordsStefan Metzmacher2014-08-271-46/+7
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dlz_bind9: let dlz_bind9 use dns_common_replace()Stefan Metzmacher2014-08-271-77/+50
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Change-Id: I2fd2503230cbf89445594e49f39ac321769ff06e Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dlz_bind9: let dlz_bind9 use dns_common_extract()Stefan Metzmacher2014-08-271-57/+61
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Change-Id: I7c661964a3da1a1981f022a06b9bef25bbd33479 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dlz_bind9: let dlz_bind9 use dns_common_lookup() for name lookupStefan Metzmacher2014-08-272-53/+21
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Change-Id: I2632fa0ce120a978f6f400fa5cbf18a7fbbd64a3 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dlz_bind9: do an early talloc_free(el_ctx) in dlz_allnodes()Stefan Metzmacher2014-08-261-0/+2
| | | | | | | We don't have to keep everything arround while walking the whole zone. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dlz_bind9: avoid some compiler warningsStefan Metzmacher2014-08-262-4/+4
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dns_server: handle tombstones in handle_one_update()Stefan Metzmacher2014-08-261-16/+25
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dns_server: add DNS_TYPE_TOMBSTONE support to dns_common_replace()Stefan Metzmacher2014-08-261-4/+77
| | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dns_server: make sure dns_common_lookup() doesn't return tombstonesStefan Metzmacher2014-08-263-6/+53
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dns_server: use .wType = DNS_TYPE_TOMBSTONE instead of ZERO_STRUCT()Stefan Metzmacher2014-08-261-5/+15
| | | | | | | | | | The result is the same, but it is clearer. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dns_server: split out dns_common_replace()Stefan Metzmacher2014-08-264-68/+90
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dns_server: remove const from dns_replace_records()Stefan Metzmacher2014-08-262-2/+2
| | | | | | | | | | All callers are find we the record array gets modified. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dns_server: split out dns_common_extract() and dns_common_lookup()Stefan Metzmacher2014-08-263-44/+92
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>