samba.git
8 years agoWHATSNEW: Add release notes for Samba 4.0.26. v4-0-stable samba-4.0.26
Karolin Seeger [Wed, 6 May 2015 19:02:54 +0000 (21:02 +0200)]
WHATSNEW: Add release notes for Samba 4.0.26.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agos4:auth/gensec_gssapi: let gensec_gssapi_update() return NT_STATUS_LOGON_FAILURE...
Stefan Metzmacher [Fri, 13 Mar 2015 13:39:10 +0000 (14:39 +0100)]
s4:auth/gensec_gssapi: let gensec_gssapi_update() return NT_STATUS_LOGON_FAILURE for unknown errors

The 'nt_status' variable is set to NT_STATUS_OK before.

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

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

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Thu Apr  9 22:54:29 CEST 2015 on sn-devel-104

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>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11144
Memory leak in SMB2 notify handling.

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Mon Mar 16 00:22:31 CET 2015 on sn-devel-104

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-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)

9 years agolibsmb: provide authinfo domain for DFS referral auth
David Disseldorp [Fri, 16 Jan 2015 15:21:23 +0000 (16:21 +0100)]
libsmb: provide authinfo domain for DFS referral auth

libsmbclient uses the smbc_init->smbc_get_auth_data_fn() provided
workgroup/domain in initial connections, but then switches to the
default smb.conf workgroup/domain when handling DFS referrals.

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>
(cherry picked from commit 6c9de0cd056afc0b478c02f1bdb0e06532388037)
[ddiss@samba.org: 4.0 rebase with cli_init_creds() call]

9 years agolibsmb: reuse connections derived from DFS referrals
David Disseldorp [Fri, 16 Jan 2015 15:21:22 +0000 (16:21 +0100)]
libsmb: reuse connections derived from DFS referrals

[MS-DFSC] 3.2.1.1 and 3.2.1.2 states that DFS targets with the same site
location or relative cost are placed in random order in a DFS referral
response.

libsmbclient currently resolves DFS referrals on every API call, always
using the first entry in the referral response. With random ordering,
libsmbclient may open a new server connection, rather than reuse an
existing (cached) connection established in a previous DFS referred API
call.

This change sees libsmbclient check the connection cache for any of the
DFS referral response entries before creating a new connection.

This change is based on a patch by Har Gagan Sahai
<SHarGagan@novell.com>.

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 7b7d4f740fe5017107d3100041cc8c7982f0eac7)
[ddiss@samba.org: 4.0 rebase without smbXcli_tcon context]

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>
9 years agoMerge tag 'samba-4.0.24' into v4-0-test
Karolin Seeger [Thu, 15 Jan 2015 11:11:57 +0000 (12:11 +0100)]
Merge tag 'samba-4.0.24' into v4-0-test

samba: tag release samba-4.0.24

9 years agosmbd: Fix CID 1063259 Uninitialized scalar variable
Volker Lendecke [Sun, 18 Aug 2013 20:35:32 +0000 (20:35 +0000)]
smbd: Fix CID 1063259 Uninitialized scalar variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11041

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit cc983c9a6a92f3d127ec6461b15aed3fa90e6d30)
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agonet: Fix sam addgroupmem
Volker Lendecke [Tue, 13 Jan 2015 11:51:13 +0000 (12:51 +0100)]
net: Fix sam addgroupmem

Domain local groups come across as SID_TYPE_ALIAS and are sent to us in the
PAC/Info3 struct. We should allow this in net sam addgroupmem.

Volker

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11051

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Jan 13 15:28:16 CET 2015 on sn-devel-104

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)

9 years agoVERSION: Disable git snapshots for the 4.0.24 release. samba-4.0.24
Karolin Seeger [Mon, 12 Jan 2015 20:05:40 +0000 (21:05 +0100)]
VERSION: Disable git snapshots for the 4.0.24 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoWHATSNEW: Add release notes for Samba 4.0.24.
Karolin Seeger [Mon, 12 Jan 2015 20:01:33 +0000 (21:01 +0100)]
WHATSNEW: Add release notes for Samba 4.0.24.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
9 years agoCVE-2014-8143:dsdb-samldb: Check for extended access rights before we allow changes...
Andrew Bartlett [Thu, 4 Dec 2014 04:23:29 +0000 (17:23 +1300)]
CVE-2014-8143:dsdb-samldb: Check for extended access rights before we allow changes to userAccountControl

This requires an additional control to be used in the
LSA server to add domain trust account objects.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoCVE-2014-8143:dsdb: Allow use of dsdb_autotransaction_request outside util.c
Andrew Bartlett [Mon, 8 Dec 2014 01:20:21 +0000 (14:20 +1300)]
CVE-2014-8143:dsdb: Allow use of dsdb_autotransaction_request outside util.c

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

Change-Id: If6bc90305a1e9a5a92562a01ba7e44330de91cc1
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoCVE-2014-8143:pydsdb: Pull in UF_USE_AES_KEYS flag
Andrew Bartlett [Sun, 7 Dec 2014 23:19:19 +0000 (12:19 +1300)]
CVE-2014-8143:pydsdb: Pull in UF_USE_AES_KEYS flag

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

Change-Id: I36ad5ebc5d8a4811c41b59af90a3add4ae5fd857
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoCVE-2014-8143:auth: Force talloc type of session_info pointer to match
Andrew Bartlett [Tue, 11 Nov 2014 02:23:02 +0000 (15:23 +1300)]
CVE-2014-8143:auth: Force talloc type of session_info pointer to match

This helps us keep things safe in LDB where we put this in a opaque pointer.

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

Andrew Bartlett

Change-Id: I46fe53ba655ca0810c276b72fbca524884cdf22d
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoVERSION: Bump version up to 4.0.24...
Karolin Seeger [Sun, 7 Dec 2014 20:47:37 +0000 (21:47 +0100)]
VERSION: Bump version up to 4.0.24...

...and re-enable git snapshots.

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

9 years agonsswitch: fix soname of linux nss_*.so.2 modules
Stefan Metzmacher [Thu, 18 Dec 2014 09:33:34 +0000 (10:33 +0100)]
nsswitch: fix soname of linux nss_*.so.2 modules

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(similar to commit 575b093dac3c509b1bfaab0b4ad29b9b4214e487)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Sun Jan 11 16:10:35 CET 2015 on sn-devel-104

9 years agoselftest: use shared/libnss_wrapper_winbind.so.2
Stefan Metzmacher [Thu, 18 Dec 2014 19:13:44 +0000 (20:13 +0100)]
selftest: use shared/libnss_wrapper_winbind.so.2

This library is always available in make test.
nss-wrapper strictly requires the linux nss api.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(similar to commit 4eb24fa545234be506eb1330ccbbfd5c2b9e0d82)

9 years agowafsamba: add optional keep_underscore=True to SAMBA_LIBRARY()
Stefan Metzmacher [Thu, 18 Dec 2014 09:21:30 +0000 (10:21 +0100)]
wafsamba: add optional keep_underscore=True to SAMBA_LIBRARY()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(similar to commit 82e583b04b04e560c121163850d70c52d2fce78d)

9 years agowinbind: Retry after SESSION_EXPIRED error in ping-dc
Christof Schmitt [Fri, 19 Dec 2014 19:24:53 +0000 (12:24 -0700)]
winbind: Retry after SESSION_EXPIRED error in ping-dc

Trying to establish a netlogon connection when the service ticket
expires might fail with NT_STATUS_NETWORK_SESSION_EXPIRED. The
underlying client code already marks the session as invalid, so retry
the netlogon connect in this case.

Signed-off-by: Christof Schmit <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jan  6 02:58:57 CET 2015 on sn-devel-104
(cherry picked from commit a2670f15dea27c10e3827216adf572f9c3894f85)

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

9 years agowinbind: Retry LogonControl RPC in ping-dc after session expiration
Christof Schmitt [Mon, 22 Dec 2014 23:19:47 +0000 (15:19 -0800)]
winbind: Retry LogonControl RPC in ping-dc after session expiration

When the underlying session expires, the LogonControl RPC call used in
ping-dc returns NT_STATUS_IO_DEVICE_ERROR. Retry once in this case,
instead of returning the error to the caller.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Dec 23 02:46:34 CET 2014 on sn-devel-104
(cherry picked from commit 2fdc55160309cec89aeb88243cb18d058c67e918)

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

9 years agolibcli/smb: only force signing of smb2 session setups when binding a new session
Stefan Metzmacher [Fri, 12 Dec 2014 13:55:38 +0000 (13:55 +0000)]
libcli/smb: only force signing of smb2 session setups when binding a new session

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Dec 12 23:11:40 CET 2014 on sn-devel-104

(cherry picked from commit daff0f5d709eca621a7f319c892ecaba7b03e5c2)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Thu Dec 18 23:32:50 CET 2014 on sn-devel-104

9 years agos3:smb2_server: allow reauthentication without signing
Stefan Metzmacher [Fri, 12 Dec 2014 08:22:15 +0000 (09:22 +0100)]
s3:smb2_server: allow reauthentication without signing

If signing is not required we should not require it for reauthentication.
Windows clients would otherwise fail to reauthenticate.

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

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

9 years agos3:smb2_server: use the global signing key to check if signing is required
Stefan Metzmacher [Thu, 12 Jun 2014 13:10:11 +0000 (15:10 +0200)]
s3:smb2_server: use the global signing key to check if signing is required

If we have a channel session key, we also always have a global session key.

For multi-channel it's possible that the channel session key is not in place
yet, in that case the global session key needs to be used.

In both cases (reauth or session bind) we session setup requests need to be
signed.

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

9 years agotestprogs/test_ldb: check rootdse search with extended-dn control
Stefan Metzmacher [Fri, 21 Nov 2014 13:11:54 +0000 (14:11 +0100)]
testprogs/test_ldb: check rootdse search with extended-dn control

Verifies BUG: https://bugzilla.samba.org/show_bug.cgi?id=10949

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Dec 12 20:15:46 CET 2014 on sn-devel-104

(cherry picked from commit 7e81fe282540a5b52dcb8c5396321a67733790d2)

9 years agos4:dsdb/rootdse: expand extended dn values with the AS_SYSTEM control
Stefan Metzmacher [Thu, 20 Nov 2014 13:21:06 +0000 (14:21 +0100)]
s4:dsdb/rootdse: expand extended dn values with the AS_SYSTEM control

Otherwise we can't find the GUID of the 'serverName' attribute
as ANONYMOUS.

This results in

  root@ub1204-161:~# ldbsearch -U% -H ldap://172.31.9.161 -b '' -s base --extended-dn serverName
  search error - LDAP error 1 LDAP_OPERATIONS_ERROR -  <00002020: operations error at ../source4/dsdb/samdb/ldb_modules/rootdse.c:567> <>

While it works as system:

  root@ub1204-161:~# ldbsearch -U% -H /var/lib/samba/private/sam.ldb -b '' -s base --extended-dn serverName
  # record 1
  dn:
  serverName: <GUID=348c35e1-04e3-4988-a32c-32478d584551>;CN=UB1204-161,CN=Serve
   rs,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=s4xdom,DC=base

  # returned 1 records
  # 1 entries
  # 0 referrals

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit a6ecef4532e4529a819219cd814e2979c2df0797)

9 years agos3:utils/profiles fix a use after free
Christian Ambach [Tue, 4 Nov 2014 22:51:23 +0000 (23:51 +0100)]
s3:utils/profiles fix a use after free

path is a talloc-child of subkeys, so subkeys should not be freed before calling
verbose_output

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Wed Dec  3 00:43:19 CET 2014 on sn-devel-104

(cherry picked from commit 3b90bfb1089e6a4b7e05e7ed62bb642521f57917)

9 years agos3:registry/regfio fix some valgrind warnings
Christian Ambach [Tue, 4 Nov 2014 22:50:07 +0000 (23:50 +0100)]
s3:registry/regfio fix some valgrind warnings

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 4b41489901b7f1a78ffd479128c3e0d309e53b53)

9 years agos3:registry/regfio read SD from the correct location
Christian Ambach [Tue, 4 Nov 2014 22:47:26 +0000 (23:47 +0100)]
s3:registry/regfio read SD from the correct location

try to find the security descriptor at the data pointer, not at the beginning of the hbin

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 217a0189c15761f6c7b24c9d7bfdbccf85de8e1d)

9 years agos3: modules: Fix *allocate* calls to follow POSIX error return convention.
Jeremy Allison [Mon, 8 Dec 2014 03:50:54 +0000 (19:50 -0800)]
s3: modules: Fix *allocate* calls to follow POSIX error return convention.

Fix up the time_audit and streams_xattr modules to follow
the -1,errno convention for errors.

Reported by Jones <jones.kstw@gmail.com> who provided the
initial patch. This patch tested and confirmed working
by him as well.

Signed-off-by: Jeremy Allison <jra@samba.org>
9 years agos3: smbd: Fix *allocate* calls to follow POSIX error return convention.
Jeremy Allison [Fri, 5 Dec 2014 23:34:12 +0000 (15:34 -0800)]
s3: smbd: Fix *allocate* calls to follow POSIX error return convention.

Fix vfs_allocate_file_space(), vfs_slow_fallocate(),
vfs_fill_sparse() to follow the -1,errno convention
for errors.

Standardize on the -1,errno convention.

Reported by Jones <jones.kstw@gmail.com> who provided the
initial patch. This patch tested and confirmed working
by him as well.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
(cherry picked from commit cc1f91cec627cb3e4fc89b96aae1e7e4c539cd1c)