summaryrefslogtreecommitdiff
path: root/lib/addns
Commit message (Collapse)AuthorAgeFilesLines
* lib:addns: Don’t call memcpy() with a NULL pointerJoseph Sutton2023-05-051-1/+3
| | | | | | | Doing so is undefined behaviour. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib:addns: Fix code spellingAndreas Schneider2023-04-032-3/+3
| | | | | | | Best reviewed with: `git show --word-diff`. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib:addns: Rename additionals to additionalAndreas Schneider2023-04-033-9/+9
| | | | | | | Fixes code spelling. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* net: add new --dns-ttl option to specify the ttl of dns recordsBjörn Baumbach2023-03-032-2/+12
| | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libaddns: remove duplicate declarationDouglas Bagnall2022-09-161-2/+0
| | | | | | | Also declared on line 257, exactly the same. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* build: Consolidate --with-dnsupdate with --with-ads (which implied HAVE_KRB5)Andrew Bartlett2021-03-261-1/+1
| | | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Mar 26 04:06:41 UTC 2021 on sn-devel-184
* dnsupdates: clean up all RRSets and not only type ABjörn Jacke2020-12-231-2/+2
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13706 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14244 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libsmb: Remove unused ads_dns_query_* routinesVolker Lendecke2020-12-112-189/+0
| | | | | | | | 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): Fri Dec 11 19:30:16 UTC 2020 on sn-devel-184
* libcli: Add ads_dns_query_srv_send()/recv()Volker Lendecke2020-12-113-0/+615
| | | | | | | | | | | | | This issues the "query" for SRV records site-aware and siteless. If there are SRV records returned without IP addresses, it will issue A and AAAA requests, waiting up to async_dns_timeout seconds. If that timeout is reached, ads_dns_query_srv_recv() returns whatever is around. Superdebug added by Jeremy <jra@samba.org> :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* build: Wrap a long lineVolker Lendecke2020-12-111-1/+9
| | | | | | | There will be one more .c file Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli: Add required #includes to dnsquery.hVolker Lendecke2020-12-111-0/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Make dnsquery.h #ifdef align to our conventionsVolker Lendecke2020-12-111-3/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: addns: Fix ads_dns_lookup_ns(), ads_dns_query_dcs(), ↵Jeremy Allison2020-09-152-17/+13
| | | | | | | | | ads_dns_query_gcs(), ads_dns_query_kdcs(), ads_dns_query_pdc() to return size_t *. Easier to do all callers at once. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* lib: addns: Fix ads_dns_lookup_srv() and functions to return size_t * num ↵Jeremy Allison2020-09-152-6/+11
| | | | | | | servers. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* lib: addns: Add code for asynchronously looking up AAAA records.Jeremy Allison2020-08-072-0/+222
| | | | | | Returns an array of struct samba_sockaddr. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* lib: addns: Add code for asynchronously looking up A records.Jeremy Allison2020-08-072-0/+217
| | | | | | Returns an array of struct samba_sockaddr. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* lib/addns: clang: Fix 'Assigned value is garbage or undefined'Noel Power2019-07-241-2/+4
| | | | | | | | | | | | | | Fixes: lib/addns/dnsquery.c:222:10: warning: Assigned value is garbage or undefined <--[clang] *numdcs = num_srvs; /* size_t->int */ ^ 1 warning generated. Also fixes the out param being modified even on failure Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* lib/addns: clang: Fix 'Value stored to 'err' is never read'Noel Power2019-07-241-4/+6
| | | | | | | | | | | | | | | Fixes: /home/samba/samba/lib/addns/dnsmarshall.c:406:2: warning: Value stored to 'err' is never read <--[clang] err = ERROR_DNS_NO_MEMORY; ^ ~~~~~~~~~~~~~~~~~~~ /home/samba/samba/lib/addns/dnsmarshall.c:447:3: warning: Value stored to 'err' is never read <--[clang] err = buf->error; ^ ~~~~~~~~~~ 2 warnings generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* lib/adnss: clang: Fix The left operand of '!=' is a garbage valueNoel Power2019-07-241-1/+1
| | | | | | | | | | | | Fixes: lib/addns/dnssock.c:143:3: warning: The left operand of '!=' is a garbage value <--[clang] TALLOC_FREE(conn); ^ 1 warning generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* addns: Remove some unused definesVolker Lendecke2019-02-271-50/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* addns: Async ads_dns_lookup_nsVolker Lendecke2019-01-152-358/+121
| | | | | | | | | | Use dns_lookup_send/recv to get NS records Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Jan 15 11:16:00 CET 2019 on sn-devel-144
* addns: Async ads_dns_lookup_srvVolker Lendecke2019-01-153-207/+151
| | | | | | | | Use dns_lookup_send/recv to get SRV records. This avoids synchronous libresolv calls and provides the infrastructure to get dsgetdcname async. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* addns: Centralize siteless lookup fallbackVolker Lendecke2019-01-151-60/+29
| | | | | | | We had the same logic 3 times, coalesce into one Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Fix spelling mistakesOlly Betts2018-11-301-1/+1
| | | | | | Signed-off-by: Olly Betts <olly@survex.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* addns: Fix a typoVolker Lendecke2018-06-161-1/+1
| | | | | | | | 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): Sat Jun 16 04:21:18 CEST 2018 on sn-devel-144
* Fix UDP DNS queries in addnsTimur I. Bakeyev2018-06-131-3/+1
| | | | | | | | | | | | | The addns code tries to use common approach for TCP and UDP queries, calling connect() for both types of sockets. In case of UDP that requires to use send() instead of sendto(). Signed-off-by: Timur I. Bakeyev <timur@iXsystems.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jun 13 03:51:04 CEST 2018 on sn-devel-144
* wscript: remove executable bits for all wscript* filesStefan Metzmacher2017-01-111-0/+0
| | | | | | | | | | These files should not be executable. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Jan 11 20:21:01 CET 2017 on sn-devel-144
* Refactor the dns_open_connection code so that duplicate code is removed and ↵Richard Sharpe2016-04-261-55/+39
| | | | | | | ensure that EINTR is handled in the UDP path. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* lib: dns: Clean up allocated structure on error exit.Jeremy Allison2016-04-221-4/+6
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <rsharpe@samba.org>
* lib: Fix CID 1273234 Untrusted value as argumentVolker Lendecke2015-06-231-1/+1
| | | | | | | | buf->size has been sanitized in the checks done in talloc_array(). This makes the "trust" flow more explicit. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Fix CID 1034723 Explicit null dereferencedVolker Lendecke2015-06-231-7/+8
| | | | | | | Do an early return if there's nothing to receive Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Fix CID 1272913 Calling risky functionVolker Lendecke2015-06-231-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: IPv6 enabled DNS connections for ADS clientDavid Holder2015-05-152-43/+86
| | | | | | | | | This patch makes DNS client connections protocol independent. For example DNS updates. This makes IPv6-only clients possible. Signed-off-by: David Holder <david.holder@erion.co.uk> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <rb@sernet.de>
* addns: Remove support for dns_host_file.Andreas Schneider2014-12-183-48/+57
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libs: s3 and s4: make our dns lookup code signal-safe.Jeremy Allison2014-04-101-5/+24
| | | | | | | | | | | | | | Cope with -1,EINTR returns. Needed as this code can be called from inside smbd. Also fixes a bug in not checking the return from poll() correctly. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Kai Blin <kai@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Apr 10 22:06:08 CEST 2014 on sn-devel-104
* lib/addns: remove compiler warningsStefan Metzmacher2012-11-131-2/+2
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/addns: don't depend on the order in resp->answers[]Stefan Metzmacher2012-11-131-3/+12
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib/addns: remove pointless check for resp->num_additionals != 1Stefan Metzmacher2012-11-131-2/+1
| | | | | | | | | | We never use resp->additionals, so there's no reason to check. This fixes dns updates against BIND9 (used in a Samba4 domain). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib-addns: ensure that allocated buffer are pre set to 0Matthieu Patou2012-10-071-12/+12
| | | | | | It avoid bugs when one of the buffer is supposed to contain a string that is not null terminated (ie. label->label) and that we don't force the last byte to 0.
* lib/addns: remove defines we don't need or have for sure via libreplaceBjörn Jacke2012-07-051-84/+0
|
* lib/addns: remove use of uint8 uint16 and uint32 in favour of C99 typesBjörn Jacke2012-07-056-112/+112
|
* build: Remove all references to libuuidAndrew Bartlett2012-05-271-7/+0
| | | | | | | | | We simply do not need this library any more. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Sun May 27 11:08:22 CEST 2012 on sn-devel-104
* Eliminate dependency on an external uuid library.Andriy Syrovenko2012-05-274-19/+10
|
* dns_hosts_file: move to a separate subsystemAlexander Bokovoy2012-05-251-1/+1
| | | | | | | | | | | After discussion with Kai move dns_hosts_file to a separate subsystem and merge it into libaddns private library for s3/s4 client use. Also remove dependency in libcli/nbt, the code from libcli/dns subsystems is not used there at all. Autobuild-User: Alexander Bokovoy <ab@samba.org> Autobuild-Date: Fri May 25 22:22:44 CEST 2012 on sn-devel-104
* libcli/dns: make 'clidns' private library out of DNS code in WAF buildAlexander Bokovoy2012-05-231-1/+1
| | | | | | | | | | | | | | | | After consolidating DNS resolver code to lib/addns, there is one piece that still needs to be moved into a common DNS resolver library: DNS_HOSTS_FILE subsystem. Unfortunately, direct move would require lib/addns to depend on libcli/util/{ntstatus.h,werror.h} (provided by errors subsystem). In addition, moving libcli/dns/* code to lib/addns/ would make conflicting the dns_tkey_record struct. The conflict comes from source4/dns_server/ and is due to use of IDL to define the struct. lib/addns/ library also provides its own definition so we either need to keep them in sync (rewrite code in lib/addns/ a bit) or depend on generated IDL headers. Thus, making a private library and subsystem clidns is an intermediate step that allows to buy some time fore refactoring.
* Introduce system MIT krb5 build with --with-system-mitkrb5 option.Alexander Bokovoy2012-05-233-5/+5
| | | | | | | | | | | | | | | | | System MIT krb5 build also enabled by specifying --without-ad-dc When --with-system-mitkrb5 (or --withou-ad-dc) option is passed to top level configure in WAF build we are trying to detect and use system-wide MIT krb5 libraries. As result, Samba 4 DC functionality will be disabled due to the fact that it is currently impossible to implement embedded KDC server with MIT krb5. Thus, --with-system-mitkrb5/--without-ad-dc build will only produce * Samba 4 client libraries and their Python bindings * Samba 3 server (smbd, nmbd, winbindd from source3/) * Samba 3 client libraries In addition, Samba 4 DC server-specific tests will not be compiled into smbtorture. This in particular affects spoolss_win, spoolss_notify, and remote_pac rpc tests.
* dns: fix comments and make s4/libcli/resolve dns resolver workingAlexander Bokovoy2012-05-231-3/+3
| | | | | | | | After migrating to use libaddns, reply_to_addrs() needed to change the way answers are iterated through. Originally libroken implementation gave all answers as separate records with last one being explicitly NULL. libaddns unmarshalling code gives all non-NULL answers and should be iterated with explicit reply->num_answers in use.
* s4-resolve: Remove dependency on librokenSimo Sorce2012-05-231-7/+2
| | | | Use available native samba resolver functions
* addns: Make ads_dns_lookup_srv pulicSimo Sorce2012-05-232-1/+6
|
* Move source3/libads/dns.c to lib/addnsSimo Sorce2012-05-233-0/+976
|