1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

41 Commits

Author SHA1 Message Date
Volker Lendecke
1f99ba7749 lib: Fix CID 1273234 Untrusted value as argument
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-23 22:12:08 +02:00
Volker Lendecke
4bd430e05d lib: Fix CID 1034723 Explicit null dereferenced
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-23 22:12:08 +02:00
Volker Lendecke
69160e55db lib: Fix CID 1272913 Calling risky function
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-06-23 22:12:08 +02:00
David Holder
fff774eda3 s3: IPv6 enabled DNS connections for ADS client
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>
2015-05-15 19:31:23 +02:00
Andreas Schneider
7f00fcf558 addns: Remove support for dns_host_file.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-12-18 06:47:40 +01:00
Jeremy Allison
4daf7d475c libs: s3 and s4: make our dns lookup code signal-safe.
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
2014-04-10 22:06:08 +02:00
Stefan Metzmacher
1ecc76b248 lib/addns: remove compiler warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-11-13 22:14:14 +11:00
Stefan Metzmacher
eecc1d2942 lib/addns: don't depend on the order in resp->answers[]
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-11-13 22:14:13 +11:00
Stefan Metzmacher
b59c5db5f7 lib/addns: remove pointless check for resp->num_additionals != 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-11-13 22:14:13 +11:00
Matthieu Patou
03c4dceaab lib-addns: ensure that allocated buffer are pre set to 0
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-10-07 21:51:02 -07:00
Björn Jacke
a79496d90c lib/addns: remove defines we don't need or have for sure via libreplace 2012-07-05 22:00:52 +02:00
Björn Jacke
4b83d61e7d lib/addns: remove use of uint8 uint16 and uint32 in favour of C99 types 2012-07-05 22:00:52 +02:00
Andrew Bartlett
39076c5a3f build: Remove all references to libuuid
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-27 11:08:22 +02:00
Andriy Syrovenko
c85f33458f Eliminate dependency on an external uuid library. 2012-05-27 13:15:56 +10:00
Alexander Bokovoy
518484af8d dns_hosts_file: move to a separate subsystem
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-25 22:22:44 +02:00
Alexander Bokovoy
744f9910c8 libcli/dns: make 'clidns' private library out of DNS code in WAF build
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-23 17:51:50 +03:00
Alexander Bokovoy
2ddf89a2bc Introduce system MIT krb5 build with --with-system-mitkrb5 option.
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.
2012-05-23 17:51:50 +03:00
Alexander Bokovoy
f32d43763d dns: fix comments and make s4/libcli/resolve dns resolver working
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.
2012-05-23 17:51:49 +03:00
Simo Sorce
c54fe86a63 s4-resolve: Remove dependency on libroken
Use available native samba resolver functions
2012-05-23 17:51:49 +03:00
Simo Sorce
a8ee6f2ca5 addns: Make ads_dns_lookup_srv pulic 2012-05-23 17:51:49 +03:00
Simo Sorce
34a65739d3 Move source3/libads/dns.c to lib/addns 2012-05-23 17:51:48 +03:00
Simo Sorce
9c5aa0bef4 addns: Fix talloc hiereachy
Attach request to local memory context not to potentially long lived connection
2012-05-23 17:51:48 +03:00
Simo Sorce
701fc995b7 addns: clean up headers
All this stuff is already included properly in the replace headers on top.
2012-04-26 08:42:35 -04:00
Alexander Bokovoy
594e316181 lib/replace: split out GSSAPI from lib/replace/system/kerberos.h into lib/replace/system/gssapi.h
With waf build include directories are defined by dependencies specified to subsystems.
Without proper dependency <gssapi/gssapi.h> cannot be found for embedded Heimdal builds
when there are no system-wide gssapi/gssapi.h available.

Split out GSSAPI header includes in a separate replacement header and use that explicitly
where needed.

Autobuild-User: Alexander Bokovoy <ab@samba.org>
Autobuild-Date: Wed Apr 25 00:18:33 CEST 2012 on sn-devel-104
2012-04-25 00:18:32 +02:00
Ira Cooper
e19cf64356 addns: Fix the Solaris/Illumos build.
uuid_t is not defined without including sys/uuid.h, configure+waf checks added.

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-03-07 11:01:33 -08:00
Andrew Bartlett
4a0d1b5ac6 s3-libads: Move to using only the HAVE_KRB5 define
HAVE_KRB5 already implies that GSSAPI is present as well.

Andrew Bartlett
2012-02-13 04:41:05 +01:00
Andrew Bartlett
310cf98574 s3-lib/addns: Move to system/kerberos.h and HAVE_KRB5 2012-02-13 04:41:05 +01:00
Jeremy Allison
9c4fdde023 Fix uninitialized variable frees on error paths.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Nov 23 22:38:13 CET 2011 on sn-devel-104
2011-11-23 22:38:13 +01:00
Jeremy Allison
a17e01baa7 Ensure we don't free uninitialized variables.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Nov 23 02:27:53 CET 2011 on sn-devel-104
2011-11-23 02:27:52 +01:00
Kai Blin
81b4db74a7 s3 libaddns: Prevent a crash when dns_create_update fails
When dns_create_update() fails, it does not initialize *req, and then TALLOC_FREE(req) in the
error handling crashes if we're lucky.
Instead of going into the generic error handling, treat the failure in dns_create_update() like
dns_create_update_request() and just pass on the error.

Thanks to Harry Mason for reporting this issue.

Autobuild-User: Kai Blin <kai@samba.org>
Autobuild-Date: Tue Nov 22 14:29:07 CET 2011 on sn-devel-104
2011-11-22 14:29:07 +01:00
Kai Blin
b567694bb0 addns: Remove unused empty header file
Autobuild-User: Kai Blin <kai@samba.org>
Autobuild-Date: Sun Sep 25 09:15:09 CEST 2011 on sn-devel-104
2011-09-25 09:15:09 +02:00
Kai Blin
7466612392 addns: Allow creating AAAA records during updates 2011-09-24 21:46:06 -07:00
Andrew Bartlett
61543577fa lib/addns: Remove unused TALLOC_ macros 2011-09-07 12:16:41 +02:00
Andrew Bartlett
8d4a8389bb s3-talloc Change TALLOC_MEMDUP() to talloc_memdup()
Using the standard macro makes it easier to move code into common, as
TALLOC_MEMDUP isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
ad0a07c531 s3-talloc Change TALLOC_ZERO_P() to talloc_zero()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
3d15137653 s3-talloc Change TALLOC_ARRAY() to talloc_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
73b377432c s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_REALLOC_ARRAY isn't standard talloc.

Andrew Bartlett
2011-06-09 12:40:08 +02:00
Jeremy Allison
7d6ebe0de7 More const fixes. Remove CONST_DISCARD. 2011-05-06 01:44:07 +02:00
Volker Lendecke
d825b5e2cb s3: Eliminate select from libaddns 2011-02-28 16:40:20 +01:00
Volker Lendecke
d7d36724d3 s3: Fix some nonempty blank lines 2011-02-10 16:16:03 +01:00
Günther Deschner
7ee75c9548 lib/addns: move DNS client library to the main directory.
Guenther
2011-01-06 16:42:56 +01:00