1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
samba-mirror/source3/nsswitch
Volker Lendecke 929e1d9920 r24809: Consolidate the use of temporary talloc contexts.
This adds the two functions talloc_stackframe() and talloc_tos().

 * When a new talloc stackframe is allocated with talloc_stackframe(), then
 * the TALLOC_CTX returned with talloc_tos() is reset to that new
 * frame. Whenever that stack frame is TALLOC_FREE()'ed, then the reverse
 * happens: The previous talloc_tos() is restored.
 *
 * This API is designed to be robust in the sense that if someone forgets to
 * TALLOC_FREE() a stackframe, then the next outer one correctly cleans up and
 * resets the talloc_tos().

The original motivation for this patch was to get rid of the
sid_string_static & friends buffers. Explicitly passing talloc context
everywhere clutters code too much for my taste, so an implicit
talloc_tos() is introduced here. Many of these static buffers are
replaced by a single static pointer.

The intended use would thus be that low-level functions can rather
freely push stuff to talloc_tos, the upper layers clean up by freeing
the stackframe. The more of these stackframes are used and correctly
freed the more exact the memory cleanup happens.

This patch removes the main_loop_talloc_ctx, tmp_talloc_ctx and
lp_talloc_ctx (did I forget any?)

So, never do a

tmp_ctx = talloc_init("foo");

anymore, instead, use

tmp_ctx = talloc_stackframe()

:-)

Volker
(This used to be commit 6585ea2cb7)
2007-10-10 12:30:24 -05:00
..
idmap_ad.c r23801: The FSF has moved around a lot. This fixes their Mass Ave address. 2007-10-10 12:28:27 -05:00
idmap_cache.c r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
idmap_ldap.c r24649: Attempt to fix bug 4917. Simo, please check! 2007-10-10 12:30:13 -05:00
idmap_nss.c r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
idmap_passdb.c r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
idmap_rid.c r23801: The FSF has moved around a lot. This fixes their Mass Ave address. 2007-10-10 12:28:27 -05:00
idmap_tdb.c r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
idmap_util.c r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
idmap.c r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
nss_info_template.c r24331: Fix an error where gid_t != 32 bit 2007-10-10 12:29:30 -05:00
nss_info.c r24087: Fix bug 4836, patch by Matthijs Kooijman <matthijs@stdin.nl>. Thanks! 2007-10-10 12:29:04 -05:00
pam_winbind.c r24786: Fix another build warning. 2007-10-10 12:30:21 -05:00
pam_winbind.h r23708: - Add define for WINBIND_WARN_PWD_EXPIRE. 2007-10-10 12:23:47 -05:00
wb_client.c r23974: Fix Coverity ID 361. num_rids == 0 is caught on function entry 2007-10-10 12:28:51 -05:00
wb_common.c r24746: As the winbindd pipe is officially broken since a while: split out request 2007-10-10 12:30:17 -05:00
wbinfo.c r24747: Add WINBINDD_DSGETDCNAME call. 2007-10-10 12:30:17 -05:00
winbind_client.h r24734: Move nss_err_str() to a more public place. 2007-10-10 12:30:16 -05:00
winbind_nss_aix.c r23800: LGPL is now called GNU Lesser General Public License 2007-10-10 12:28:26 -05:00
winbind_nss_config.h r23800: LGPL is now called GNU Lesser General Public License 2007-10-10 12:28:26 -05:00
winbind_nss_freebsd.c r23800: LGPL is now called GNU Lesser General Public License 2007-10-10 12:28:26 -05:00
winbind_nss_hpux.h r23800: LGPL is now called GNU Lesser General Public License 2007-10-10 12:28:26 -05:00
winbind_nss_irix.c r23800: LGPL is now called GNU Lesser General Public License 2007-10-10 12:28:26 -05:00
winbind_nss_irix.h r23800: LGPL is now called GNU Lesser General Public License 2007-10-10 12:28:26 -05:00
winbind_nss_linux.c r24734: Move nss_err_str() to a more public place. 2007-10-10 12:30:16 -05:00
winbind_nss_linux.h r23800: LGPL is now called GNU Lesser General Public License 2007-10-10 12:28:26 -05:00
winbind_nss_netbsd.c r23800: LGPL is now called GNU Lesser General Public License 2007-10-10 12:28:26 -05:00
winbind_nss_netbsd.h r23800: LGPL is now called GNU Lesser General Public License 2007-10-10 12:28:26 -05:00
winbind_nss_solaris.c r23800: LGPL is now called GNU Lesser General Public License 2007-10-10 12:28:26 -05:00
winbind_nss_solaris.h r23800: LGPL is now called GNU Lesser General Public License 2007-10-10 12:28:26 -05:00
winbind_nss.h r23800: LGPL is now called GNU Lesser General Public License 2007-10-10 12:28:26 -05:00
winbindd_ads.c r24330: Fix a 64-bit error 2007-10-10 12:29:30 -05:00
winbindd_async.c r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
winbindd_cache.c r24801: When told to ignore the winbind cache also do so while trying to store entries. 2007-10-10 12:30:22 -05:00
winbindd_ccache_access.c r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
winbindd_cm.c r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
winbindd_cred_cache.c r24578: Fix build warning. 2007-10-10 12:30:07 -05:00
winbindd_creds.c r24438: Use dump_data_pw() instead of dump_data() on sensitive data in winbindd. 2007-10-10 12:29:47 -05:00
winbindd_dual.c r24809: Consolidate the use of temporary talloc contexts. 2007-10-10 12:30:24 -05:00
winbindd_group.c r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
winbindd_misc.c r24799: Prefer IP address to dns name when replying in winbindd dsgetdcname. 2007-10-10 12:30:22 -05:00
winbindd_nss.h r24807: Add WINBINDD_LOCATOR_KDC_ADDRESS env which will be used for the case when the 2007-10-10 12:30:23 -05:00
winbindd_pam.c r24584: Merge all pam post-processing code (in particular all extra_data code) into 2007-10-10 12:30:07 -05:00
winbindd_passdb.c r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
winbindd_reconnect.c r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
winbindd_rpc.c r24713: Fix obvious error in enum_dom_groups. We were returning NT_STATUS_OK when the realloc failed. 2007-10-10 12:30:15 -05:00
winbindd_sid.c r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
winbindd_sockinit.c r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
winbindd_user.c r23884: Fix Coverity ID 379 2007-10-10 12:28:38 -05:00
winbindd_util.c r24807: Add WINBINDD_LOCATOR_KDC_ADDRESS env which will be used for the case when the 2007-10-10 12:30:23 -05:00
winbindd_wins.c r24737: Remove older TODO: Convert internal_resolve_name() and friends to NTSTATUS. 2007-10-10 12:30:16 -05:00
winbindd.c r24809: Consolidate the use of temporary talloc contexts. 2007-10-10 12:30:24 -05:00
winbindd.h r23800: LGPL is now called GNU Lesser General Public License 2007-10-10 12:28:26 -05:00
wins.c r24737: Remove older TODO: Convert internal_resolve_name() and friends to NTSTATUS. 2007-10-10 12:30:16 -05:00