summaryrefslogtreecommitdiff
path: root/lib/addns
AgeCommit message (Collapse)AuthorFilesLines
2024-09-29lib/addns: match additional names in a non case insensitive wayStefan Metzmacher1-1/+5
Sometime proxy dns servers mess up the case of parts of the name... So we should match with strequal() instead of strcmp(), which results in much less dns packets on the wire... 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): Sun Sep 29 08:09:46 UTC 2024 on atb-devel-224
2024-08-27lib: Make a few functions staticVolker Lendecke2-20/+14
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jennifer Sutton <jsutton@samba.org>
2024-06-06lib/addns: remove unused kerberos/gssapi includes in dns.hStefan Metzmacher1-2/+0
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-05-14lib/addns: rewrite signed dns update code to use gensec instead of plain gssapiStefan Metzmacher3-185/+75
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2023-05-05lib:addns: Don’t call memcpy() with a NULL pointerJoseph Sutton1-1/+3
Doing so is undefined behaviour. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-04-03lib:addns: Fix code spellingAndreas Schneider2-3/+3
Best reviewed with: `git show --word-diff`. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-04-03lib:addns: Rename additionals to additionalAndreas Schneider3-9/+9
Fixes code spelling. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-03-03net: add new --dns-ttl option to specify the ttl of dns recordsBjörn Baumbach2-2/+12
Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-09-16libaddns: remove duplicate declarationDouglas Bagnall1-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>
2021-03-26build: Consolidate --with-dnsupdate with --with-ads (which implied HAVE_KRB5)Andrew Bartlett1-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
2020-12-23dnsupdates: clean up all RRSets and not only type ABjörn Jacke1-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>
2020-12-11libsmb: Remove unused ads_dns_query_* routinesVolker Lendecke2-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
2020-12-11libcli: Add ads_dns_query_srv_send()/recv()Volker Lendecke3-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>
2020-12-11build: Wrap a long lineVolker Lendecke1-1/+9
There will be one more .c file Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-11libcli: Add required #includes to dnsquery.hVolker Lendecke1-0/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-12-11lib: Make dnsquery.h #ifdef align to our conventionsVolker Lendecke1-3/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-09-15lib: addns: Fix ads_dns_lookup_ns(), ads_dns_query_dcs(), ↵Jeremy Allison2-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>
2020-09-15lib: addns: Fix ads_dns_lookup_srv() and functions to return size_t * num ↵Jeremy Allison2-6/+11
servers. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
2020-08-07lib: addns: Add code for asynchronously looking up AAAA records.Jeremy Allison2-0/+222
Returns an array of struct samba_sockaddr. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2020-08-07lib: addns: Add code for asynchronously looking up A records.Jeremy Allison2-0/+217
Returns an array of struct samba_sockaddr. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-24lib/addns: clang: Fix 'Assigned value is garbage or undefined'Noel Power1-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>
2019-07-24lib/addns: clang: Fix 'Value stored to 'err' is never read'Noel Power1-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>
2019-07-24lib/adnss: clang: Fix The left operand of '!=' is a garbage valueNoel Power1-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>
2019-02-27addns: Remove some unused definesVolker Lendecke1-50/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-15addns: Async ads_dns_lookup_nsVolker Lendecke2-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
2019-01-15addns: Async ads_dns_lookup_srvVolker Lendecke3-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>
2019-01-15addns: Centralize siteless lookup fallbackVolker Lendecke1-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>
2018-11-30Fix spelling mistakesOlly Betts1-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>
2018-06-16addns: Fix a typoVolker Lendecke1-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
2018-06-13Fix UDP DNS queries in addnsTimur I. Bakeyev1-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
2017-01-11wscript: remove executable bits for all wscript* filesStefan Metzmacher1-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
2016-04-26Refactor the dns_open_connection code so that duplicate code is removed and ↵Richard Sharpe1-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>
2016-04-22lib: dns: Clean up allocated structure on error exit.Jeremy Allison1-4/+6
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <rsharpe@samba.org>
2015-06-23lib: Fix CID 1273234 Untrusted value as argumentVolker Lendecke1-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>
2015-06-23lib: Fix CID 1034723 Explicit null dereferencedVolker Lendecke1-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>
2015-06-23lib: Fix CID 1272913 Calling risky functionVolker Lendecke1-1/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-15s3: IPv6 enabled DNS connections for ADS clientDavid Holder2-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>
2014-12-18addns: Remove support for dns_host_file.Andreas Schneider3-48/+57
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-10libs: s3 and s4: make our dns lookup code signal-safe.Jeremy Allison1-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
2012-11-13lib/addns: remove compiler warningsStefan Metzmacher1-2/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-11-13lib/addns: don't depend on the order in resp->answers[]Stefan Metzmacher1-3/+12
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-11-13lib/addns: remove pointless check for resp->num_additionals != 1Stefan Metzmacher1-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>
2012-10-07lib-addns: ensure that allocated buffer are pre set to 0Matthieu Patou1-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.
2012-07-05lib/addns: remove defines we don't need or have for sure via libreplaceBjörn Jacke1-84/+0
2012-07-05lib/addns: remove use of uint8 uint16 and uint32 in favour of C99 typesBjörn Jacke6-112/+112
2012-05-27build: Remove all references to libuuidAndrew Bartlett1-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
2012-05-27Eliminate dependency on an external uuid library.Andriy Syrovenko4-19/+10
2012-05-25dns_hosts_file: move to a separate subsystemAlexander Bokovoy1-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
2012-05-23libcli/dns: make 'clidns' private library out of DNS code in WAF buildAlexander Bokovoy1-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.
2012-05-23Introduce system MIT krb5 build with --with-system-mitkrb5 option.Alexander Bokovoy3-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.