metze/samba/wip.git
9 years agos3:smbd: avoid calling fd_is_readable() without async echo handler v4-0-test
Stefan Metzmacher [Wed, 11 Dec 2013 14:02:27 +0000 (15:02 +0100)]
s3:smbd: avoid calling fd_is_readable() without async echo handler

Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agos3:lib: avoid talloc_zero_array() in poll_one_fd()
Stefan Metzmacher [Wed, 4 Dec 2013 22:31:10 +0000 (23:31 +0100)]
s3:lib: avoid talloc_zero_array() in poll_one_fd()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agolibrpc/ndr_drsuapi: Allow ndrdump to dump dsinfo52 blobs
Matthieu Patou [Tue, 23 Sep 2014 20:45:32 +0000 (13:45 -0700)]
librpc/ndr_drsuapi: Allow ndrdump to dump dsinfo52 blobs

Change-Id: I6968b25c67587296b928b2193a9d48093c69c01a
Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 1ac96a416d7d6db2476f56129166fd9e018e7306)

9 years agoidl:drsuapi: Manage all possible lengths of drsuapi_DsBindInfo
Samuel Cabrero [Fri, 4 Jul 2014 10:45:59 +0000 (12:45 +0200)]
idl:drsuapi: Manage all possible lengths of drsuapi_DsBindInfo

Signed-off-by: Samuel Cabrero <scabrero@zentyal.com>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
(cherry picked from commit d747372d28273542298f86530e715e8faaf907f2)

9 years agolibrpc-idl: change the drsuapi_DsBindInfoCtr so that it match what is on the wire...
Matthieu Patou [Sun, 20 Oct 2013 20:37:17 +0000 (13:37 -0700)]
librpc-idl: change the drsuapi_DsBindInfoCtr so that it match what is on the wire both in NDR32 and NDR64.

Previous implementation had a problem with NDR64 with uint32 and
uint3264 being in the wrong order

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Oct 30 10:16:02 CET 2013 on sn-devel-104

(cherry picked from commit 8dc931bafca00c1c61a4366ffb6cfa72a98bb412)

9 years agolibrpc-idl: replace int32 by uint32 as the values are always > 0
Stefan Metzmacher [Mon, 21 Oct 2013 06:40:28 +0000 (08:40 +0200)]
librpc-idl: replace int32 by uint32 as the values are always > 0

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 1e2e421632c275f8cf7529935f72ef3639ddea14)

9 years agolibrpc-idl: replace int32 by the enumeration as it's the type that we use in union...
Matthieu Patou [Mon, 21 Oct 2013 03:16:27 +0000 (20:16 -0700)]
librpc-idl: replace int32 by the enumeration as it's the type that we use in union's switch drsuapi_DsGetDCInfoCtrLevels

Signed-off-by: Matthieu Patou <mat@matws.net>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 568bf16dfadb4bd3003ed18b19098a3d1473f2fe)

9 years agodrsuapi.idl: change the range for attribute values to 26214400 bytes.
Stefan Metzmacher [Mon, 23 Sep 2013 06:05:41 +0000 (08:05 +0200)]
drsuapi.idl: change the range for attribute values to 26214400 bytes.

This matches the IDL from [MS-DRSR].

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Matthieu Patou <mat@matws.net>
(cherry picked from commit 51d8eba8417c58c2ade30d58a838441008209542)

9 years agosamba-tool/ldapcmp: update the list of non replicated attributes
Stefan Metzmacher [Wed, 27 Aug 2014 13:13:30 +0000 (15:13 +0200)]
samba-tool/ldapcmp: update the list of non replicated attributes

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10788

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Sep  2 03:49:49 CEST 2014 on sn-devel-104

(cherry picked from commit eee14f775e6f2075729d68fa9598dd99f9b9b05d)

9 years agos4:dlz_bind9: let dlz_bind9 use dns_common_lookup() before add/modify
Stefan Metzmacher [Thu, 31 Jul 2014 07:30:16 +0000 (09:30 +0200)]
s4:dlz_bind9: let dlz_bind9 use dns_common_lookup() before add/modify

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

(cherry picked from commit d68a2ebecd244181b1238635ee54dadd05835525)

9 years agos4:dlz_bind9: let dlz_bind9 use dns_common_lookup() before removing records
Stefan Metzmacher [Wed, 30 Jul 2014 18:12:08 +0000 (20:12 +0200)]
s4:dlz_bind9: let dlz_bind9 use dns_common_lookup() before removing records

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>
(cherry picked from commit 11bbfd932c113b3222bc93d59702271a3777b6f3)

9 years agos4:dlz_bind9: let dlz_bind9 use dns_common_replace()
Stefan Metzmacher [Wed, 30 Jul 2014 16:51:39 +0000 (18:51 +0200)]
s4:dlz_bind9: let dlz_bind9 use dns_common_replace()

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>
(cherry picked from commit fd952bf814835c4860ab10794225fbd583ee3ad5)

9 years agos4:dlz_bind9: let dlz_bind9 use dns_common_extract()
Stefan Metzmacher [Wed, 30 Jul 2014 15:59:08 +0000 (17:59 +0200)]
s4:dlz_bind9: let dlz_bind9 use dns_common_extract()

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>
(cherry picked from commit dedcf30fd12821c272002e3b4cbfda4ca38650fd)

9 years agos4:dlz_bind9: let dlz_bind9 use dns_common_lookup() for name lookup
Stefan Metzmacher [Wed, 30 Jul 2014 06:40:32 +0000 (08:40 +0200)]
s4:dlz_bind9: let dlz_bind9 use dns_common_lookup() for name lookup

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>
(cherry picked from commit 96dcebe8c20b9aa954a96a4deabe16957576be2c)

9 years agotorture-dns: Add test for dlz_bind9 updates
Stefan Metzmacher [Tue, 26 Aug 2014 10:04:59 +0000 (12:04 +0200)]
torture-dns: Add test for dlz_bind9 updates

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(similar to commit 914a3667471ced3199f51db8bc1d4a6d3fbc4e8f)

9 years agotorture-dns: Add test for dlz_bind9 zonedumps
Stefan Metzmacher [Tue, 26 Aug 2014 08:34:17 +0000 (10:34 +0200)]
torture-dns: Add test for dlz_bind9 zonedumps

Change-Id: I074b3e4cdad1a0b69c085dcaa44d6f48e68e863b
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit e23621e9dab67c8997d24b2ac7e4fd181fc5907c)

9 years agotorture-dns: Add test for dlz_bind9 lookups
Andrew Bartlett [Mon, 25 Aug 2014 22:24:27 +0000 (10:24 +1200)]
torture-dns: Add test for dlz_bind9 lookups

Change-Id: I3b9d1b56e3aa873fb8540b98e196b713b82332ca
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 2189470c2f55afe29e9e8dad1d2659a7eb2d06f9)

9 years agos4:torture:dlz_bind9: fix spnego tests
Stefan Metzmacher [Tue, 26 Aug 2014 11:48:21 +0000 (13:48 +0200)]
s4:torture:dlz_bind9: fix spnego tests

The dlz_bind9 module uses the special dns-${NETBIOSNAME} account,
and this is only available under the dns/hostname.domain SPN, not
host/hostname.

Also the dlz_ssumatch() function returns isc_boolean_t instead
of isc_result_t. As ISC_R_SUCCESS and ISC_FALSE have the same value
we didn't notice this problem.

Change-Id: I48539c3f48f5dde9eaa2fff6da0f3be2f9f66311
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 76943bf0ac259fb8855bd123fe4bc85a103ba418)

9 years agos4:dlz_bind9: do an early talloc_free(el_ctx) in dlz_allnodes()
Stefan Metzmacher [Wed, 30 Jul 2014 15:57:13 +0000 (17:57 +0200)]
s4:dlz_bind9: do an early talloc_free(el_ctx) in dlz_allnodes()

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>
(cherry picked from commit 5d397c8198bcd2cdccc3deda57377d4696e6abd1)

9 years agos4:dlz_bind9: avoid some compiler warnings
Stefan Metzmacher [Thu, 27 Feb 2014 08:59:51 +0000 (09:59 +0100)]
s4:dlz_bind9: avoid some compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit fbebe7e756e4ccd0684e94e9b1e787f98f399ccc)

9 years agos4:dns_server: handle tombstones in handle_one_update()
Stefan Metzmacher [Thu, 31 Jul 2014 07:35:26 +0000 (09:35 +0200)]
s4:dns_server: handle tombstones in handle_one_update()

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>
(cherry picked from commit 491715399ff7e1ab788fec5e254581dc312e2cef)

9 years agos4:dns_server: add DNS_TYPE_TOMBSTONE support to dns_common_replace()
Stefan Metzmacher [Thu, 31 Jul 2014 08:44:41 +0000 (10:44 +0200)]
s4:dns_server: add DNS_TYPE_TOMBSTONE support to dns_common_replace()

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>
(cherry picked from commit bb3ca930cc57964487bd23a74f4caabd1616a8bf)

9 years agos4:dns_server: make sure dns_common_lookup() doesn't return tombstones
Stefan Metzmacher [Thu, 31 Jul 2014 06:54:17 +0000 (08:54 +0200)]
s4:dns_server: make sure dns_common_lookup() doesn't return tombstones

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>
(cherry picked from commit a0a81ab01cb1d509b04f9af25177c8e0941b43aa)

9 years agos4:dns_server: use .wType = DNS_TYPE_TOMBSTONE instead of ZERO_STRUCT()
Stefan Metzmacher [Thu, 31 Jul 2014 07:32:00 +0000 (09:32 +0200)]
s4:dns_server: use .wType = DNS_TYPE_TOMBSTONE instead of ZERO_STRUCT()

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>
(cherry picked from commit 3ff025a02cca3ff209668edd419d0e440e9865c6)

9 years agos4:dns_server: split out dns_common_replace()
Stefan Metzmacher [Wed, 30 Jul 2014 16:27:56 +0000 (18:27 +0200)]
s4:dns_server: split out dns_common_replace()

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>
(cherry picked from commit 0689e795e073008d2ad539c0ef5ddbdc6d9efdac)

9 years agos4:dns_server: remove const from dns_replace_records()
Stefan Metzmacher [Thu, 31 Jul 2014 09:32:02 +0000 (11:32 +0200)]
s4:dns_server: remove const from dns_replace_records()

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>
(cherry picked from commit 7e7df78bd7ae5575da7443b45c0e2e4167eebde2)

9 years agos4:dns_server: split out dns_common_extract() and dns_common_lookup()
Stefan Metzmacher [Wed, 30 Jul 2014 06:24:10 +0000 (08:24 +0200)]
s4:dns_server: split out dns_common_extract() and dns_common_lookup()

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>
(cherry picked from commit 342a087349f8a10833338a3fa49fbd4d4d29f3e5)

9 years agos4:dns_server: split out a private 'dnsserver_common' library
Stefan Metzmacher [Wed, 30 Jul 2014 06:01:11 +0000 (08:01 +0200)]
s4:dns_server: split out a private 'dnsserver_common' library

This will contain common code for the internal dns server, the dlz_bind9 module
and the rpc dns management server.

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>
(similar to commit 99d5a5ead4f33723c25e8716a79d34b53822521e)

9 years agos4:dns_server: map LDB_ERR_NO_SUCH_OBJECT to WERR_DNS_ERROR_NAME_DOES_NOT_EXIST
Stefan Metzmacher [Thu, 31 Jul 2014 06:19:50 +0000 (08:19 +0200)]
s4:dns_server: map LDB_ERR_NO_SUCH_OBJECT to WERR_DNS_ERROR_NAME_DOES_NOT_EXIST

This is the correct fix for commit 8b24c43b382740106474e26dec59e1419ba77306
and Bug: https://bugzilla.samba.org/show_bug.cgi?id=9559

With this change we have a consistent behavior between internal server
and the bind dlz module. We keep a dangling LDAP object without
dnsRecord attribute arround forever. This will be fixed in the following
commits.

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>
(cherry picked from commit d0f424a23dc915d9fce625438d2bd63519757cba)

9 years agos4:dns_server: handle WERR_DNS_ERROR_NAME_DOES_NOT_EXIST in werr_to_dns_err()
Stefan Metzmacher [Wed, 30 Jul 2014 15:55:57 +0000 (17:55 +0200)]
s4:dns_server: handle WERR_DNS_ERROR_NAME_DOES_NOT_EXIST in werr_to_dns_err()

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>
(cherry picked from commit deb21a9afe77591743fda522355a5a9eb08fb27b)

9 years agos4-dns: dlz_bind9: Check result to avoid segfault
Stefan Gohmann [Fri, 8 Mar 2013 19:57:31 +0000 (20:57 +0100)]
s4-dns: dlz_bind9: Check result to avoid segfault

We saw this issue in a customer environment with many CNF objects. I
wasn't able to reproduce it, but I got the following core dump:

 (gdb) directory samba4-4.0.0~rc6/source4/dns_server/
 Source directories searched: /root/samba4-4.0.0~rc6/source4/dns_server:$cdir:$cwd
 (gdb) bt
 #0  0xb4b0bc13 in dlz_lookup_types (state=0x9648e48, zone=0xb659b9a8 "xxxxxx.xxxxx.de", name=0xb659bda8 "client9173", lookup=0xb6db7588, types=0x0) at ../source4/dns_server/dlz_bind9.c:830
 #1  0xb4b0bdb8 in dlz_lookup (zone=0xb659b9a8 "xxxxxx.xxxxx.de", name=0xb659bda8 "client9173", dbdata=0x9648e48, lookup=0xb6db7588) at ../source4/dns_server/dlz_bind9.c:875
 #2  0x080b43d8 in dlopen_dlz_lookup ()
 #3  0xb7701755 in findnode () from /usr/lib/libdns.so.81
 #4  0xb7701d22 in find () from /usr/lib/libdns.so.81
 #5  0xb7639e5f in dns_db_find () from /usr/lib/libdns.so.81
 #6  0x08075476 in query_find ()
 #7  0x0807acb9 in ns_query_start ()
 #8  0x08060712 in client_request ()
 #9  0xb743022b in run () from /usr/lib/libisc.so.81
 #10 0xb7216955 in start_thread () from /lib/i686/cmov/libpthread.so.0
 #11 0xb706c1de in clone () from /lib/i686/cmov/libc.so.6
 (gdb) f 0
 #0  0xb4b0bc13 in dlz_lookup_types (state=0x9648e48, zone=0xb659b9a8 "xxxxxx.xxxxx.de", name=0xb659bda8 "client9173", lookup=0xb6db7588, types=0x0) at ../source4/dns_server/dlz_bind9.c:830
 830             el = ldb_msg_find_element(res->msgs[0], "dnsRecord");
 (gdb) p res->msgs
 $1 = (struct ldb_message **) 0x0
 (gdb) p res->count
 $2 = 0
 (gdb)

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 666a5630ef3b03640089a0b6e81bf578b91b88ab)

9 years agos3:configure: require external talloc >= 2.1.2
Stefan Metzmacher [Tue, 10 Mar 2015 09:51:11 +0000 (10:51 +0100)]
s3:configure: require external talloc >= 2.1.2

Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agotalloc: version 2.1.2
Stefan Metzmacher [Mon, 9 Mar 2015 08:07:24 +0000 (09:07 +0100)]
talloc: version 2.1.2

Changes:
- Allow destructors to reparent the object
- Allow destructors to remove itself
- Build improvements

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
(cherry picked from commit 7bef5e4f0e5ff4a4187f3d63e51a1725ff32b771)

9 years agotalloc: fix _talloc_total_limit_size prototype
Stefan Metzmacher [Tue, 27 Jan 2015 12:07:34 +0000 (13:07 +0100)]
talloc: fix _talloc_total_limit_size prototype

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 3929abfc6b5a3ae8a27da57d4dbee9524e3585e3)

9 years agolib: talloc: Test suite for the new destructor reparent logic.
Jeremy Allison [Wed, 4 Mar 2015 01:12:32 +0000 (17:12 -0800)]
lib: talloc: Test suite for the new destructor reparent logic.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Mar  8 20:52:43 CET 2015 on sn-devel-104

(cherry picked from commit 6b0cecee1b864a0589836caf9f5f2892f8cb6926)

9 years agolib: talloc: Allow destructors to reparent the object they're called on.
Jeremy Allison [Wed, 4 Mar 2015 01:02:47 +0000 (17:02 -0800)]
lib: talloc: Allow destructors to reparent the object they're called on.

If a destructor returns failure (-1) when freeing a child, talloc
must then reparent the child.

Firstly it tries the owner of any reference, next the parent of the
current object calling _talloc_free_children_internal(), and finally
the null context in the last resort.

If a destructor reparented its own object, which can be a very
desirable thing to do (a destructor can make a decision it isn't
time to die yet, and as the parent may be going away it might
want to move itself to longer-term storage) then this new parent
gets overwritten by the existing reparenting logic.

This patch checks when freeing a child if it already reparented
itself, and if it did doesn't then overwrite the new parent.

Makes destructors more flexible.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
(cherry picked from commit cc4e5481ea060db7f6d8a83619d859b2e002eb90)

9 years agolib: talloc: Fix bug when calling a destructor.
Jeremy Allison [Thu, 5 Mar 2015 20:48:47 +0000 (12:48 -0800)]
lib: talloc: Fix bug when calling a destructor.

If the destructor itself calls talloc_set_destructor()
and returns -1, the new destructor set is overwritten
by talloc.

Dectect that and leave the new destructor in place.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
(cherry picked from commit 3289a5d84f73bf044e5767a6c47a3f7bf8357c08)

9 years agotalloc:build: improve detection of srcdir
Michael Adam [Fri, 20 Jun 2014 16:04:44 +0000 (18:04 +0200)]
talloc:build: improve detection of srcdir

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit cc86b4107acebf56c7bb17f59dd358615aed57b7)

9 years agotalloc: version 2.1.1
Stefan Metzmacher [Thu, 15 May 2014 12:53:49 +0000 (14:53 +0200)]
talloc: version 2.1.1

Changes:
- documentation updates
- a fix for pytalloc-util.pc
- performance improvements here and there
- fixed compiler warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri May 16 19:51:26 CEST 2014 on sn-devel-104

(cherry picked from commit b8e5b68de3cff8d16e4be07fdc2e780d2c3c5750)

9 years agotalloc/tests: avoid some unused variable warnings
Stefan Metzmacher [Thu, 27 Feb 2014 08:28:02 +0000 (09:28 +0100)]
talloc/tests: avoid some unused variable warnings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 8fbb81923ddf3449b4ad1fa1a562c9fab8c74103)

9 years agotalloc: fix compiler warning
Stefan Metzmacher [Wed, 20 Nov 2013 08:58:09 +0000 (09:58 +0100)]
talloc: fix compiler warning

This avoids the following warning when using:

CFLAGS="-O3 -g -fstrict-overflow -Wstrict-overflow=5"

../talloc.c: In Funktion »talloc_is_parent«:
../talloc.c:2658:21: Warnung: assuming signed overflow does not occur when
changing X +- C1 cmp C2 to X cmp C1 +- C2 [-Wstrict-overflow]

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit de822b58476093dc43c27577d2f7074541113cc5)

9 years agotalloc: check for TALLOC_GET_TYPE_ABORT_NOOP
Stefan Metzmacher [Thu, 5 Dec 2013 07:36:13 +0000 (08:36 +0100)]
talloc: check for TALLOC_GET_TYPE_ABORT_NOOP

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit eb95fc8866dd1710b4cc2f4a4e1dc9867424def2)

9 years agotalloc: avoid a function call in TALLOC_FREE() if possible.
Stefan Metzmacher [Wed, 4 Dec 2013 14:35:37 +0000 (15:35 +0100)]
talloc: avoid a function call in TALLOC_FREE() if possible.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit b9fcfc6399eab750880ee0b9806311dd351a8ff6)

9 years agotalloc: inline talloc_get_name()
Stefan Metzmacher [Wed, 4 Dec 2013 22:22:04 +0000 (23:22 +0100)]
talloc: inline talloc_get_name()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 014eecd0b2aead3a160af0d864feddd53c85b580)

9 years agotalloc: inline more static functions
Stefan Metzmacher [Wed, 20 Nov 2013 08:57:58 +0000 (09:57 +0100)]
talloc: inline more static functions

We need the code to be as fast as possible.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 3aa35354724b88acc63f6b4439f7203d10db4e90)

9 years agotalloc: Tune talloc_vasprintf
Volker Lendecke [Fri, 10 Jan 2014 09:45:22 +0000 (10:45 +0100)]
talloc: Tune talloc_vasprintf

vsnprintf is significantly more expensive than memcpy. For the
common case where the string we print is less than a kilobyte, avoid
the second vsnprintf.

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): Thu May 15 12:49:14 CEST 2014 on sn-devel-104

(cherry picked from commit 593c8103af5a5ed6b3c915369fed5b90efb42c25)

9 years agotalloc: Update flags in pytalloc-util pkgconfig file
Lukas Slebodnik [Fri, 4 Apr 2014 11:29:39 +0000 (13:29 +0200)]
talloc: Update flags in pytalloc-util pkgconfig file

After exapnding, @LIB_RPATH@ will be -Wl,-rpatch,/usr/local/lib if rpath is
used on install. But "-Wl," will be passed to linker and should not be among
CFLAGS. Other pkgconfig files have @LIB_RPATH@ in the right place.
    @see commit 735c1cd2da15167748e92ba6de48fdb5169db587

Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Apr  4 23:50:25 CEST 2014 on sn-devel-104

(cherry picked from commit e1df75b5a965829db0c1f76673dcc824447b3ae7)

9 years agoAdd a basic guide on pytalloc.
Jelmer Vernooij [Wed, 27 Nov 2013 02:12:02 +0000 (02:12 +0000)]
Add a basic guide on pytalloc.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Thu Nov 28 02:24:45 CET 2013 on sn-devel-104

(cherry picked from commit 91c1053413e1f309b2d5b215a423f37e3883aa91)

9 years agotalloc: Add a warning to talloc_reference() documentation.
Andreas Schneider [Mon, 14 Oct 2013 11:17:12 +0000 (13:17 +0200)]
talloc: Add a warning to talloc_reference() documentation.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Oct 14 23:05:54 CEST 2013 on sn-devel-104

(cherry picked from commit 2343df451a13115eebfd46f9247ec2ae8c3a85c0)

9 years agotalloc: Test the pooled object
Volker Lendecke [Fri, 6 Sep 2013 22:30:38 +0000 (15:30 -0700)]
talloc: Test the pooled object

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 256d10f5792a37d20cbb45f2af3f8578bd354110)

9 years agotalloc: Add talloc_pooled_object
Volker Lendecke [Fri, 6 Sep 2013 22:15:32 +0000 (15:15 -0700)]
talloc: Add talloc_pooled_object

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit e82320e5197bcdd0330bc829c0963ad09854a36c)

9 years agotalloc: Allow nested pools.
Volker Lendecke [Fri, 6 Sep 2013 21:52:28 +0000 (14:52 -0700)]
talloc: Allow nested pools.

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 20ad6d7aa3dc5e7db4d886202f757ac1f68287d4)

9 years agotalloc: Add a separate pool size
Volker Lendecke [Fri, 6 Sep 2013 21:20:20 +0000 (14:20 -0700)]
talloc: Add a separate pool size

This is necessary to allow talloc pools to be objects on their own. It
is an incompatible change in the sense that talloc_get_size(pool) now
returns 0 instead of the pool size. When the talloc_pooled_object()
call is added, this will start to make sense again.

Maybe we should add a talloc_pool_size call? Or is that overkill?

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit a3d9099d9a96b36df21ee0733adc5210438fe9dc)

9 years agotalloc: Put pool-specific data before the chunk
Volker Lendecke [Fri, 6 Sep 2013 21:08:43 +0000 (14:08 -0700)]
talloc: Put pool-specific data before the chunk

This is a preparation to make talloc pool real objects themselves.

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit b87c8fd435d1863d6efcec03830ecd85ddfcd7fb)

9 years agotalloc: Introduce __talloc_with_prefix
Volker Lendecke [Fri, 6 Sep 2013 19:18:26 +0000 (12:18 -0700)]
talloc: Introduce __talloc_with_prefix

This will allow to exchange the extra talloc pool header with the
talloc_chunk structure

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 9887f387a10e94f71790c0c3c7dc5f8cde7e4eb2)

9 years agotalloc: Decouple the dual use of chunk->pool
Volker Lendecke [Fri, 6 Sep 2013 17:54:43 +0000 (10:54 -0700)]
talloc: Decouple the dual use of chunk->pool

If we want nested pools, we will have pools that are pool members. So
we will have to have a separate "next object" pointer  for pools. As
we have struct talloc_pool_chunk now, this additional pointer does not
affect normal talloc objects.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 1334c745e1f2157b66e14f9d8b4f6f7750238717)

9 years agoFix valgrind errors with memmove and talloc pools.
Jeremy Allison [Tue, 27 Aug 2013 20:20:43 +0000 (13:20 -0700)]
Fix valgrind errors with memmove and talloc pools.

bin/smbtorture //127.0.0.1 local.talloc now runs with no valgrind errors.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Aug 28 02:44:17 CEST 2013 on sn-devel-104

(cherry picked from commit 617c647b8ef562ace589a11a15eb460e6db71f2a)

9 years agoAdd simple limited pool tests to test_memlimit().
Jeremy Allison [Tue, 27 Aug 2013 20:09:03 +0000 (13:09 -0700)]
Add simple limited pool tests to test_memlimit().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
(cherry picked from commit cbfc3efbfd4a3a6f3b031ce8ef375d37f2c545f3)

9 years agoRemove talloc_memlimit_update(). No longer used.
Jeremy Allison [Tue, 27 Aug 2013 20:08:33 +0000 (13:08 -0700)]
Remove talloc_memlimit_update(). No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
(cherry picked from commit 3d0f717d437bb24f430fad788b9eb35e8fe8e0e8)

9 years agoInside _talloc_realloc(), keep track of size changes over malloc/realloc/free.
Jeremy Allison [Tue, 27 Aug 2013 20:07:04 +0000 (13:07 -0700)]
Inside _talloc_realloc(), keep track of size changes over malloc/realloc/free.

Replace the last use of talloc_memlimit_update() with talloc_memlimit_grow()/
talloc_memlimit_shrink().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
(cherry picked from commit 8e2a543e088cac36a5b6bbab1a6be961fa00cc4d)

9 years agoDon't call talloc_memlimit_update() inside _talloc_realloc() when we're just manipula...
Jeremy Allison [Tue, 27 Aug 2013 20:03:27 +0000 (13:03 -0700)]
Don't call talloc_memlimit_update() inside _talloc_realloc() when we're just manipulating pool members.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
(cherry picked from commit 314508dd73105138d756f4ca3dfb65f1d368a9f7)

9 years agoFix a conditional check. (size - tc->size > 0) is always true if size and tc->size...
Jeremy Allison [Tue, 27 Aug 2013 19:59:04 +0000 (12:59 -0700)]
Fix a conditional check. (size - tc->size > 0) is always true if size and tc->size are unsigned.

Replace with (size > tc->size).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
(cherry picked from commit 0fbcfcc824e474874c15d7c0b2ea0df408448906)

9 years agoIn _talloc_steal_internal(), correctly decrement the memory limit in the source,...
Jeremy Allison [Tue, 27 Aug 2013 19:57:43 +0000 (12:57 -0700)]
In _talloc_steal_internal(), correctly decrement the memory limit in the source, and increment in the destination.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
(cherry picked from commit 43860293225d14ca2c339277b42f8705322463ab)

9 years agoInside _talloc_free_internal(), always call talloc_memlimit_update_on_free() before...
Jeremy Allison [Tue, 27 Aug 2013 19:54:38 +0000 (12:54 -0700)]
Inside _talloc_free_internal(), always call talloc_memlimit_update_on_free() before we free the real memory.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
(cherry picked from commit 6bc190d6dd7fd0ab028c39c1463477a863f6943a)

9 years agoUpdate memory limits when we call free() on a pool.
Jeremy Allison [Tue, 27 Aug 2013 19:51:20 +0000 (12:51 -0700)]
Update memory limits when we call free() on a pool.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
(cherry picked from commit 4dfde7d33e7ac6c94833ecc758baff487ab67e4e)

9 years agoChange __talloc() to only call talloc_memlimit_check()/talloc_memlimit_grow() on...
Jeremy Allison [Tue, 27 Aug 2013 19:49:00 +0000 (12:49 -0700)]
Change __talloc() to only call talloc_memlimit_check()/talloc_memlimit_grow() on actual malloc allocation.

Don't check the memlimit if the allocation was successful from a pool. We already
checked the memory limit when we created the pool.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
(cherry picked from commit a4ebbe73b4b8dcab4d344e693ad9796ec8997f87)

9 years agoChange _talloc_total_mem_internal() to ignore memory allocated from a pool when calcu...
Jeremy Allison [Tue, 27 Aug 2013 19:46:09 +0000 (12:46 -0700)]
Change _talloc_total_mem_internal() to ignore memory allocated from a pool when calculating limit size.

We must only count normal tallocs, or a talloc pool itself.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
(cherry picked from commit 4159a78ed7eda340758e22286f16186987a20f2f)

9 years agoRemove magic TC_HDR_SIZE handling inside talloc_memlimit_check().
Jeremy Allison [Tue, 27 Aug 2013 19:43:50 +0000 (12:43 -0700)]
Remove magic TC_HDR_SIZE handling inside talloc_memlimit_check().

Callers already account for TC_HDR_SIZE, do not add it twice.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
(cherry picked from commit 7a6beae68ee3f9a97e9e56f4e24a437839fb3e19)

9 years agoStart to fix talloc memlimits with talloc pools.
Jeremy Allison [Tue, 27 Aug 2013 19:36:23 +0000 (12:36 -0700)]
Start to fix talloc memlimits with talloc pools.

Add the functions:

talloc_memlimit_grow(), talloc_memlimit_shrink(),
talloc_memlimit_update_on_free().

as replacements for talloc_memlimit_update().
The interface to talloc_memlimit_update() is very
hard to understand and use. The above functions
are (to me) much clearer.

The goal of these changes is to only update
the memlimits on malloc/free/realloc, not
on every pool allocation. That way we only
count pool creation as allocation from any
imposed limits, not allocation from an already
created pool.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
(cherry picked from commit fe790f6cbc9b888a8d613cfb515f0d0c76daad47)

9 years agotalloc: Fix a typo
Volker Lendecke [Mon, 20 May 2013 12:26:08 +0000 (14:26 +0200)]
talloc: Fix a typo

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): Mon May 20 18:48:49 CEST 2013 on sn-devel-104

(cherry picked from commit d7708fd360c1fa1e3111fd4df266b52c96cca196)

9 years agotalloc: only provide the --enable-talloc-compat1 in standalone build
Stefan Metzmacher [Tue, 7 May 2013 12:15:35 +0000 (14:15 +0200)]
talloc: only provide the --enable-talloc-compat1 in standalone build

The compat library is already only built in standalone build,
so we need the configure option also only in the standalone build.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 8a878ec74bd24180aa73cfb39ff4a6c3e72d9d0b)

9 years agotalloc: Simplify _talloc_free_poolmem a bit
Volker Lendecke [Mon, 15 Apr 2013 20:19:25 +0000 (22:19 +0200)]
talloc: Simplify _talloc_free_poolmem a bit

Early returns are easier to understand than "else if"

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): Thu Apr 18 22:50:42 CEST 2013 on sn-devel-104

(cherry picked from commit 79fe1381a3a78ad2316343fc8c1c27360b46ebbf)

9 years agotalloc: Do an early return
Volker Lendecke [Mon, 15 Apr 2013 20:12:50 +0000 (22:12 +0200)]
talloc: Do an early return

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit a796e48b1dfe96b194f3a3a0d70e25c3ab92690d)

9 years agotalloc: Avoid some "else" by doing early returns
Volker Lendecke [Mon, 15 Apr 2013 20:11:44 +0000 (22:11 +0200)]
talloc: Avoid some "else" by doing early returns

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit ccf33dd0547f32104041c8611626f3e02e22cbe9)

9 years agotalloc: Fix nonblank line endings
Volker Lendecke [Mon, 15 Apr 2013 19:44:38 +0000 (21:44 +0200)]
talloc: Fix nonblank line endings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit d3928b0c8af01f7751191b81a72590ca35751a8c)

9 years agotalloc: Convert error cecking macros into fns
Simo Sorce [Fri, 5 Oct 2012 14:32:32 +0000 (10:32 -0400)]
talloc: Convert error cecking macros into fns

This will avoid 'surprise returns' and makes the code cleare to readers.
These macros were complex enough to warrant a full function anyway not
just for readability but also for debuggability.

Thanks David for pointing out this issue.

Autobuild-User(master): Simo Sorce <idra@samba.org>
Autobuild-Date(master): Fri Oct  5 23:24:17 CEST 2012 on sn-devel-104

(cherry picked from commit 36ea39edf8dd9ede756debaf9632f3ded2a51abb)

9 years agoAdd tests for talloc_memlimit
Simo Sorce [Sat, 22 Sep 2012 20:35:21 +0000 (16:35 -0400)]
Add tests for talloc_memlimit

Autobuild-User(master): Simo Sorce <idra@samba.org>
Autobuild-Date(master): Fri Oct  5 07:36:38 CEST 2012 on sn-devel-104

(cherry picked from commit 7d7e33c624875a9694fcebdde942147ac3bf5f74)

9 years agoAdd memory limiting capability to talloc
Simo Sorce [Sat, 22 Sep 2012 20:15:47 +0000 (16:15 -0400)]
Add memory limiting capability to talloc

By calling talloc_set_memlimit() we can now set a max memory limit
for a whole talloc hierarchy.
ANy attempt to allocate memory beyond the max allowed for the whole
hierarchy wil cause an allocation failure.

Stealing memory correctly accounts for used memory in the old and the new
hierarchy but exceeding the memory limit in the new parent will not cause
a failure.

(cherry picked from commit a33a78c302fde61fdb7a6e71669f19be2cf5c836)

9 years agosmbd: Stop using vfs_Chdir after SMB_VFS_DISCONNECT.
Ira Cooper [Thu, 15 Jan 2015 16:41:50 +0000 (11:41 -0500)]
smbd: Stop using vfs_Chdir after SMB_VFS_DISCONNECT.

This sequencing is causing problems for vfs_ceph, and likely
other vfs modules.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 16 00:13:17 CET 2015 on sn-devel-104

(cherry picked from commit 81464daea71e5fa3067ec7d5f5c69c890c0f7949)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11115
S3: vfs_Chdir() is called after SMB_VFS_DISCONNECT in
source3/smbd/service.c::close_cnum().

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Mon Mar  2 23:25:27 CET 2015 on sn-devel-104

9 years agoMerge tag 'samba-4.0.25' into v4-0-test
Stefan Metzmacher [Thu, 26 Feb 2015 10:18:38 +0000 (11:18 +0100)]
Merge tag 'samba-4.0.25' into v4-0-test

samba: tag release samba-4.0.25

9 years agoVERSION: Bump version up to 4.0.26.
Karolin Seeger [Mon, 23 Feb 2015 13:39:52 +0000 (14:39 +0100)]
VERSION: Bump version up to 4.0.26.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoVERSION: Disable git snapshots for the 3.0.25 release.
Karolin Seeger [Sun, 22 Feb 2015 13:24:55 +0000 (14:24 +0100)]
VERSION: Disable git snapshots for the 3.0.25 release.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11077
CVE-2015-0240: talloc free on uninitialized stack pointer in netlogon server
could lead to security vulnerability.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoWHATSNEW: Add release notes for Samba 3.0.25.
Karolin Seeger [Sat, 21 Feb 2015 20:29:36 +0000 (21:29 +0100)]
WHATSNEW: Add release notes for Samba 3.0.25.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11077
CVE-2015-0240: talloc free on uninitialized stack pointer in netlogon server
could lead to security vulnerability.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoauth: Make sure that creds_out is initialized with NULL.
Andreas Schneider [Mon, 16 Feb 2015 09:56:03 +0000 (10:56 +0100)]
auth: Make sure that creds_out is initialized with NULL.

This is an additional patch for CVE-2015-0240.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11077#c32

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 years agos3-netlogon: Make sure we do not deference a NULL pointer.
Andreas Schneider [Mon, 16 Feb 2015 09:59:23 +0000 (10:59 +0100)]
s3-netlogon: Make sure we do not deference a NULL pointer.

This is an additional patch for CVE-2015-0240.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11077#c32

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 years agoCVE-2015-0240: s3: netlogon: Ensure we don't call talloc_free on an uninitialized...
Jeremy Allison [Wed, 28 Jan 2015 22:47:31 +0000 (14:47 -0800)]
CVE-2015-0240: s3: netlogon: Ensure we don't call talloc_free on an uninitialized pointer.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11077

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoVERSION: Disable git snapshots for the 3.0.25 release. samba-upstream/tags/samba-4.0.25
Karolin Seeger [Sun, 22 Feb 2015 13:24:55 +0000 (14:24 +0100)]
VERSION: Disable git snapshots for the 3.0.25 release.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11077
CVE-2015-0240: talloc free on uninitialized stack pointer in netlogon server
could lead to security vulnerability.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoWHATSNEW: Add release notes for Samba 3.0.25.
Karolin Seeger [Sat, 21 Feb 2015 20:29:36 +0000 (21:29 +0100)]
WHATSNEW: Add release notes for Samba 3.0.25.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11077
CVE-2015-0240: talloc free on uninitialized stack pointer in netlogon server
could lead to security vulnerability.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoauth: Make sure that creds_out is initialized with NULL.
Andreas Schneider [Mon, 16 Feb 2015 09:56:03 +0000 (10:56 +0100)]
auth: Make sure that creds_out is initialized with NULL.

This is an additional patch for CVE-2015-0240.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11077#c32

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 years agos3-netlogon: Make sure we do not deference a NULL pointer.
Andreas Schneider [Mon, 16 Feb 2015 09:59:23 +0000 (10:59 +0100)]
s3-netlogon: Make sure we do not deference a NULL pointer.

This is an additional patch for CVE-2015-0240.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11077#c32

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 years agoCVE-2015-0240: s3: netlogon: Ensure we don't call talloc_free on an uninitialized...
Jeremy Allison [Wed, 28 Jan 2015 22:47:31 +0000 (14:47 -0800)]
CVE-2015-0240: s3: netlogon: Ensure we don't call talloc_free on an uninitialized pointer.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11077

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoVERSION: Re-enable git snapshots.
Karolin Seeger [Sun, 22 Feb 2015 13:21:34 +0000 (14:21 +0100)]
VERSION: Re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoVERSION: Bump version up to 4.0.25.
Karolin Seeger [Thu, 15 Jan 2015 11:12:10 +0000 (12:12 +0100)]
VERSION: Bump version up to 4.0.25.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
(cherry picked from commit f9693a1766b88ce068bb04c88f1a41ce3330e2cc)

9 years agos3: smbclient: Allinfo leaves the file handle open.
Jeremy Allison [Tue, 10 Feb 2015 17:32:11 +0000 (09:32 -0800)]
s3: smbclient: Allinfo leaves the file handle open.

https://bugzilla.samba.org/show_bug.cgi?id=11094

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Feb 10 23:28:46 CET 2015 on sn-devel-104

(cherry picked from commit 080ec0f7d9735b27138deb5f91a397935f089f02)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Mon Feb 16 23:13:45 CET 2015 on sn-devel-104

9 years agoprinting/cups: pack requested-attributes with IPP_TAG_KEYWORD
David Disseldorp [Tue, 3 Feb 2015 18:26:42 +0000 (19:26 +0100)]
printing/cups: pack requested-attributes with IPP_TAG_KEYWORD

The CUPS IPP_GET_JOBS requested-attributes array indicates which job
attributes the caller would like in the cupsd response.

Until now, Samba has packed these attributes with a IPP_TAG_NAME
format tag. In recent versions of CUPS, this results in the IPP_GET_JOBS
response only including the job-id and job-printer-uri fields, even with
JobPrivateValues=none configured.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10808

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Feb 10 01:38:58 CET 2015 on sn-devel-104

(cherry picked from commit 2f4998113e539ea4ba6fb0a72ba6ac25c9d74bd6)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Tue Feb 10 23:14:19 CET 2015 on sn-devel-104

9 years agos3:smb2_server: protect against integer wrap with "smb2 max credits = 65535"
Stefan Metzmacher [Thu, 29 Jan 2015 09:12:30 +0000 (10:12 +0100)]
s3:smb2_server: protect against integer wrap with "smb2 max credits = 65535"

Bug: https://bugzilla.samba.org/show_bug.cgi?id=9702

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jan 29 14:58:40 CET 2015 on sn-devel-104

(similar to commit 8aed0fc38ae28cce7fd1a443844a865265fc719c)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Thu Feb  5 23:44:30 CET 2015 on sn-devel-104

9 years agos3:smb2_server: always try to grant the credits the client just consumed
Stefan Metzmacher [Wed, 28 Jan 2015 14:22:30 +0000 (15:22 +0100)]
s3:smb2_server: always try to grant the credits the client just consumed

It turns out that the effective credits_requested is always at least 1,
even if the client sends credits_requested == 0.

This means the client is not able to reduce the amount of credits
itself.

Without this fix a client (e.g. Windows7) would reach the case
where it has been granted all credits it asked for.
When copying a large file with a lot of parallel requests,
all these requests have credits_requested == 0.
This means the amount of granted credits where reduced by each
request and only when the granted credits reached 0,
the server granted one credit to allow the client to go on.
The client might require more than one credit ([MS-SMB2] says
Windows clients require at least 4 credits) and freezes
with just 1 credit.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=9702

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(similar to commit 1944c857e59922a2ebfc88a6a824a6ed9396f2d5)

9 years agodsdb: Add tokenGroupsGlobalAndUniversal, tokenGroups, tokenGroupsNoGCAcceptable
Garming Sam [Wed, 3 Dec 2014 22:53:12 +0000 (11:53 +1300)]
dsdb: Add tokenGroupsGlobalAndUniversal, tokenGroups, tokenGroupsNoGCAcceptable

This includes additional tests based directly on the docs, rather than
simply testing our internal implementation in client and server contexts,
that create a user and groups.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11022

Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming-Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Dec 22 17:17:02 CET 2014 on sn-devel-104

(similar to commit e4213512d0a967e87a74a1ae816c903fb38dd8b9)

Change-Id: Ia98bf5a62bb69e15ae6420b34e09a65c1f3e79dd

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Thu Jan 29 23:19:43 CET 2015 on sn-devel-104

9 years agoRevert "dsdb: Add tokenGroupsGlobalAndUniversal, tokenGroups, tokenGroupsNoGCAcceptable"
Stefan Metzmacher [Mon, 26 Jan 2015 22:48:01 +0000 (23:48 +0100)]
Revert "dsdb: Add tokenGroupsGlobalAndUniversal, tokenGroups, tokenGroupsNoGCAcceptable"

This reverts commit 017ff207a6883a50705de985e8653e2a05f3b024.

9 years agolibsmb: provide authinfo domain for encrypted session referrals
David Disseldorp [Mon, 19 Jan 2015 12:39:35 +0000 (13:39 +0100)]
libsmb: provide authinfo domain for encrypted session referrals

6c9de0cd056afc0b478c02f1bdb0e06532388037 requires this extra change.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11059

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan 21 04:29:06 CET 2015 on sn-devel-104

(cherry picked from commit 6da86012a2ca521efe0cf1bf05fcd04c3099b190)