summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* VERSION: Bump version up to 4.0.27...v4-0-testKarolin Seeger2015-05-061-2/+2
| | | | | | and re-enable git snapshots. Signed-off-by: Karolin Seeger <kseeger@samba.org>
* WHATSNEW: Add release notes for Samba 4.0.26.samba-4.0.26v4-0-stableKarolin Seeger2015-05-061-2/+80
| | | | Signed-off-by: Karolin Seeger <kseeger@samba.org>
* s4:auth/gensec_gssapi: let gensec_gssapi_update() return ↵Stefan Metzmacher2015-04-091-2/+2
| | | | | | | | | | | | | | | 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
* s3:configure: require external talloc >= 2.1.2Stefan Metzmacher2015-03-161-1/+1
| | | | | | | | | | 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
* talloc: version 2.1.2Stefan Metzmacher2015-03-153-1/+71
| | | | | | | | | | | 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)
* talloc: fix _talloc_total_limit_size prototypeStefan Metzmacher2015-03-151-1/+1
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 3929abfc6b5a3ae8a27da57d4dbee9524e3585e3)
* lib: talloc: Test suite for the new destructor reparent logic.Jeremy Allison2015-03-151-0/+82
| | | | | | | | | | | 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)
* lib: talloc: Allow destructors to reparent the object they're called on.Jeremy Allison2015-03-151-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | 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)
* lib: talloc: Fix bug when calling a destructor.Jeremy Allison2015-03-151-1/+7
| | | | | | | | | | | | 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)
* talloc:build: improve detection of srcdirMichael Adam2015-03-151-1/+1
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit cc86b4107acebf56c7bb17f59dd358615aed57b7)
* talloc: version 2.1.1Stefan Metzmacher2015-03-153-1/+71
| | | | | | | | | | | | | | | | 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)
* talloc/tests: avoid some unused variable warningsStefan Metzmacher2015-03-151-0/+13
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 8fbb81923ddf3449b4ad1fa1a562c9fab8c74103)
* talloc: fix compiler warningStefan Metzmacher2015-03-151-1/+4
| | | | | | | | | | | | | | 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)
* talloc: check for TALLOC_GET_TYPE_ABORT_NOOPStefan Metzmacher2015-03-151-0/+4
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit eb95fc8866dd1710b4cc2f4a4e1dc9867424def2)
* talloc: avoid a function call in TALLOC_FREE() if possible.Stefan Metzmacher2015-03-151-1/+1
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit b9fcfc6399eab750880ee0b9806311dd351a8ff6)
* talloc: inline talloc_get_name()Stefan Metzmacher2015-03-151-6/+10
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 014eecd0b2aead3a160af0d864feddd53c85b580)
* talloc: inline more static functionsStefan Metzmacher2015-03-151-19/+26
| | | | | | | | 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)
* talloc: Tune talloc_vasprintfVolker Lendecke2015-03-151-5/+9
| | | | | | | | | | | | | | 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)
* talloc: Update flags in pytalloc-util pkgconfig fileLukas Slebodnik2015-03-151-2/+2
| | | | | | | | | | | | | | | | 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)
* Add a basic guide on pytalloc.Jelmer Vernooij2015-03-152-0/+156
| | | | | | | | | | 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)
* talloc: Add a warning to talloc_reference() documentation.Andreas Schneider2015-03-151-0/+8
| | | | | | | | | | 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)
* talloc: Test the pooled objectVolker Lendecke2015-03-151-0/+36
| | | | | | | 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)
* talloc: Add talloc_pooled_objectVolker Lendecke2015-03-155-1/+174
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit e82320e5197bcdd0330bc829c0963ad09854a36c)
* talloc: Allow nested pools.Volker Lendecke2015-03-153-24/+52
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 20ad6d7aa3dc5e7db4d886202f757ac1f68287d4)
* talloc: Add a separate pool sizeVolker Lendecke2015-03-151-12/+23
| | | | | | | | | | | | | | 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)
* talloc: Put pool-specific data before the chunkVolker Lendecke2015-03-151-79/+125
| | | | | | | | 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)
* talloc: Introduce __talloc_with_prefixVolker Lendecke2015-03-151-10/+22
| | | | | | | | | 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)
* talloc: Decouple the dual use of chunk->poolVolker Lendecke2015-03-151-25/+23
| | | | | | | | | | | | 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)
* Fix valgrind errors with memmove and talloc pools.Jeremy Allison2015-03-151-0/+21
| | | | | | | | | | | | 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)
* Add simple limited pool tests to test_memlimit().Jeremy Allison2015-03-151-0/+27
| | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> (cherry picked from commit cbfc3efbfd4a3a6f3b031ce8ef375d37f2c545f3)
* Remove talloc_memlimit_update(). No longer used.Jeremy Allison2015-03-151-24/+0
| | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> (cherry picked from commit 3d0f717d437bb24f430fad788b9eb35e8fe8e0e8)
* Inside _talloc_realloc(), keep track of size changes over malloc/realloc/free.Jeremy Allison2015-03-151-4/+15
| | | | | | | | | 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)
* Don't call talloc_memlimit_update() inside _talloc_realloc() when we're just ↵Jeremy Allison2015-03-151-15/+0
| | | | | | | | manipulating pool members. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> (cherry picked from commit 314508dd73105138d756f4ca3dfb65f1d368a9f7)
* Fix a conditional check. (size - tc->size > 0) is always true if size and ↵Jeremy Allison2015-03-151-1/+1
| | | | | | | | | | 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)
* In _talloc_steal_internal(), correctly decrement the memory limit in the ↵Jeremy Allison2015-03-151-12/+5
| | | | | | | | 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)
* Inside _talloc_free_internal(), always call talloc_memlimit_update_on_free() ↵Jeremy Allison2015-03-151-23/+4
| | | | | | | | 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)
* Update memory limits when we call free() on a pool.Jeremy Allison2015-03-151-0/+2
| | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> (cherry picked from commit 4dfde7d33e7ac6c94833ecc758baff487ab67e4e)
* Change __talloc() to only call ↵Jeremy Allison2015-03-151-12/+9
| | | | | | | | | | | 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)
* Change _talloc_total_mem_internal() to ignore memory allocated from a pool ↵Jeremy Allison2015-03-151-1/+8
| | | | | | | | | | 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)
* Remove magic TC_HDR_SIZE handling inside talloc_memlimit_check().Jeremy Allison2015-03-151-1/+1
| | | | | | | | 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)
* Start to fix talloc memlimits with talloc pools.Jeremy Allison2015-03-151-0/+72
| | | | | | | | | | | | | | | | | | | | | | | 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)
* talloc: Fix a typoVolker Lendecke2015-03-151-1/+1
| | | | | | | | | | 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)
* talloc: only provide the --enable-talloc-compat1 in standalone buildStefan Metzmacher2015-03-151-4/+6
| | | | | | | | | 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)
* talloc: Simplify _talloc_free_poolmem a bitVolker Lendecke2015-03-151-2/+14
| | | | | | | | | | | | 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)
* talloc: Do an early returnVolker Lendecke2015-03-151-3/+6
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit a796e48b1dfe96b194f3a3a0d70e25c3ab92690d)
* talloc: Avoid some "else" by doing early returnsVolker Lendecke2015-03-151-4/+8
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit ccf33dd0547f32104041c8611626f3e02e22cbe9)
* talloc: Fix nonblank line endingsVolker Lendecke2015-03-151-34/+34
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit d3928b0c8af01f7751191b81a72590ca35751a8c)
* talloc: Convert error cecking macros into fnsSimo Sorce2015-03-151-37/+74
| | | | | | | | | | | | | 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)
* Add tests for talloc_memlimitSimo Sorce2015-03-151-0/+172
| | | | | | | 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)
* Add memory limiting capability to tallocSimo Sorce2015-03-155-40/+327
| | | | | | | | | | | | | 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)