Commit d5e2640d authored by Mathieu Parent's avatar Mathieu Parent

New upstream version 2.1.13

parent ff8ae4de
_pytalloc_check_type: int (PyObject *, const char *)
_pytalloc_get_mem_ctx: TALLOC_CTX *(PyObject *)
_pytalloc_get_ptr: void *(PyObject *)
_pytalloc_get_type: void *(PyObject *, const char *)
pytalloc_BaseObject_PyType_Ready: int (PyTypeObject *)
pytalloc_BaseObject_check: int (PyObject *)
pytalloc_BaseObject_size: size_t (void)
pytalloc_CObject_FromTallocPtr: PyObject *(void *)
pytalloc_Check: int (PyObject *)
pytalloc_GenericObject_reference_ex: PyObject *(TALLOC_CTX *, void *)
pytalloc_GenericObject_steal_ex: PyObject *(TALLOC_CTX *, void *)
pytalloc_GetBaseObjectType: PyTypeObject *(void)
pytalloc_GetObjectType: PyTypeObject *(void)
pytalloc_reference_ex: PyObject *(PyTypeObject *, TALLOC_CTX *, void *)
pytalloc_steal: PyObject *(PyTypeObject *, void *)
pytalloc_steal_ex: PyObject *(PyTypeObject *, TALLOC_CTX *, void *)
_pytalloc_check_type: int (PyObject *, const char *)
_pytalloc_get_mem_ctx: TALLOC_CTX *(PyObject *)
_pytalloc_get_ptr: void *(PyObject *)
_pytalloc_get_type: void *(PyObject *, const char *)
pytalloc_BaseObject_PyType_Ready: int (PyTypeObject *)
pytalloc_BaseObject_check: int (PyObject *)
pytalloc_BaseObject_size: size_t (void)
pytalloc_CObject_FromTallocPtr: PyObject *(void *)
pytalloc_Check: int (PyObject *)
pytalloc_GenericObject_reference_ex: PyObject *(TALLOC_CTX *, void *)
pytalloc_GenericObject_steal_ex: PyObject *(TALLOC_CTX *, void *)
pytalloc_GetBaseObjectType: PyTypeObject *(void)
pytalloc_GetObjectType: PyTypeObject *(void)
pytalloc_reference_ex: PyObject *(PyTypeObject *, TALLOC_CTX *, void *)
pytalloc_steal: PyObject *(PyTypeObject *, void *)
pytalloc_steal_ex: PyObject *(PyTypeObject *, TALLOC_CTX *, void *)
_pytalloc_check_type: int (PyObject *, const char *)
_pytalloc_get_mem_ctx: TALLOC_CTX *(PyObject *)
_pytalloc_get_ptr: void *(PyObject *)
_pytalloc_get_type: void *(PyObject *, const char *)
pytalloc_BaseObject_PyType_Ready: int (PyTypeObject *)
pytalloc_BaseObject_check: int (PyObject *)
pytalloc_BaseObject_size: size_t (void)
pytalloc_Check: int (PyObject *)
pytalloc_GenericObject_reference_ex: PyObject *(TALLOC_CTX *, void *)
pytalloc_GenericObject_steal_ex: PyObject *(TALLOC_CTX *, void *)
pytalloc_GetBaseObjectType: PyTypeObject *(void)
pytalloc_GetObjectType: PyTypeObject *(void)
pytalloc_reference_ex: PyObject *(PyTypeObject *, TALLOC_CTX *, void *)
pytalloc_steal: PyObject *(PyTypeObject *, void *)
pytalloc_steal_ex: PyObject *(PyTypeObject *, TALLOC_CTX *, void *)
_pytalloc_check_type: int (PyObject *, const char *)
_pytalloc_get_mem_ctx: TALLOC_CTX *(PyObject *)
_pytalloc_get_ptr: void *(PyObject *)
_pytalloc_get_type: void *(PyObject *, const char *)
pytalloc_BaseObject_PyType_Ready: int (PyTypeObject *)
pytalloc_BaseObject_check: int (PyObject *)
pytalloc_BaseObject_size: size_t (void)
pytalloc_Check: int (PyObject *)
pytalloc_GenericObject_reference_ex: PyObject *(TALLOC_CTX *, void *)
pytalloc_GenericObject_steal_ex: PyObject *(TALLOC_CTX *, void *)
pytalloc_GetBaseObjectType: PyTypeObject *(void)
pytalloc_GetObjectType: PyTypeObject *(void)
pytalloc_reference_ex: PyObject *(PyTypeObject *, TALLOC_CTX *, void *)
pytalloc_steal: PyObject *(PyTypeObject *, void *)
pytalloc_steal_ex: PyObject *(PyTypeObject *, TALLOC_CTX *, void *)
_talloc: void *(const void *, size_t)
_talloc_array: void *(const void *, size_t, unsigned int, const char *)
_talloc_free: int (void *, const char *)
_talloc_get_type_abort: void *(const void *, const char *, const char *)
_talloc_memdup: void *(const void *, const void *, size_t, const char *)
_talloc_move: void *(const void *, const void *)
_talloc_pooled_object: void *(const void *, size_t, const char *, unsigned int, size_t)
_talloc_realloc: void *(const void *, void *, size_t, const char *)
_talloc_realloc_array: void *(const void *, void *, size_t, unsigned int, const char *)
_talloc_reference_loc: void *(const void *, const void *, const char *)
_talloc_set_destructor: void (const void *, int (*)(void *))
_talloc_steal_loc: void *(const void *, const void *, const char *)
_talloc_zero: void *(const void *, size_t, const char *)
_talloc_zero_array: void *(const void *, size_t, unsigned int, const char *)
talloc_asprintf: char *(const void *, const char *, ...)
talloc_asprintf_append: char *(char *, const char *, ...)
talloc_asprintf_append_buffer: char *(char *, const char *, ...)
talloc_autofree_context: void *(void)
talloc_check_name: void *(const void *, const char *)
talloc_disable_null_tracking: void (void)
talloc_enable_leak_report: void (void)
talloc_enable_leak_report_full: void (void)
talloc_enable_null_tracking: void (void)
talloc_enable_null_tracking_no_autofree: void (void)
talloc_find_parent_byname: void *(const void *, const char *)
talloc_free_children: void (void *)
talloc_get_name: const char *(const void *)
talloc_get_size: size_t (const void *)
talloc_increase_ref_count: int (const void *)
talloc_init: void *(const char *, ...)
talloc_is_parent: int (const void *, const void *)
talloc_named: void *(const void *, size_t, const char *, ...)
talloc_named_const: void *(const void *, size_t, const char *)
talloc_parent: void *(const void *)
talloc_parent_name: const char *(const void *)
talloc_pool: void *(const void *, size_t)
talloc_realloc_fn: void *(const void *, void *, size_t)
talloc_reference_count: size_t (const void *)
talloc_reparent: void *(const void *, const void *, const void *)
talloc_report: void (const void *, FILE *)
talloc_report_depth_cb: void (const void *, int, int, void (*)(const void *, int, int, int, void *), void *)
talloc_report_depth_file: void (const void *, int, int, FILE *)
talloc_report_full: void (const void *, FILE *)
talloc_set_abort_fn: void (void (*)(const char *))
talloc_set_log_fn: void (void (*)(const char *))
talloc_set_log_stderr: void (void)
talloc_set_memlimit: int (const void *, size_t)
talloc_set_name: const char *(const void *, const char *, ...)
talloc_set_name_const: void (const void *, const char *)
talloc_show_parents: void (const void *, FILE *)
talloc_strdup: char *(const void *, const char *)
talloc_strdup_append: char *(char *, const char *)
talloc_strdup_append_buffer: char *(char *, const char *)
talloc_strndup: char *(const void *, const char *, size_t)
talloc_strndup_append: char *(char *, const char *, size_t)
talloc_strndup_append_buffer: char *(char *, const char *, size_t)
talloc_test_get_magic: int (void)
talloc_total_blocks: size_t (const void *)
talloc_total_size: size_t (const void *)
talloc_unlink: int (const void *, void *)
talloc_vasprintf: char *(const void *, const char *, va_list)
talloc_vasprintf_append: char *(char *, const char *, va_list)
talloc_vasprintf_append_buffer: char *(char *, const char *, va_list)
talloc_version_major: int (void)
talloc_version_minor: int (void)
_talloc: void *(const void *, size_t)
_talloc_array: void *(const void *, size_t, unsigned int, const char *)
_talloc_free: int (void *, const char *)
_talloc_get_type_abort: void *(const void *, const char *, const char *)
_talloc_memdup: void *(const void *, const void *, size_t, const char *)
_talloc_move: void *(const void *, const void *)
_talloc_pooled_object: void *(const void *, size_t, const char *, unsigned int, size_t)
_talloc_realloc: void *(const void *, void *, size_t, const char *)
_talloc_realloc_array: void *(const void *, void *, size_t, unsigned int, const char *)
_talloc_reference_loc: void *(const void *, const void *, const char *)
_talloc_set_destructor: void (const void *, int (*)(void *))
_talloc_steal_loc: void *(const void *, const void *, const char *)
_talloc_zero: void *(const void *, size_t, const char *)
_talloc_zero_array: void *(const void *, size_t, unsigned int, const char *)
talloc_asprintf: char *(const void *, const char *, ...)
talloc_asprintf_append: char *(char *, const char *, ...)
talloc_asprintf_append_buffer: char *(char *, const char *, ...)
talloc_autofree_context: void *(void)
talloc_check_name: void *(const void *, const char *)
talloc_disable_null_tracking: void (void)
talloc_enable_leak_report: void (void)
talloc_enable_leak_report_full: void (void)
talloc_enable_null_tracking: void (void)
talloc_enable_null_tracking_no_autofree: void (void)
talloc_find_parent_byname: void *(const void *, const char *)
talloc_free_children: void (void *)
talloc_get_name: const char *(const void *)
talloc_get_size: size_t (const void *)
talloc_increase_ref_count: int (const void *)
talloc_init: void *(const char *, ...)
talloc_is_parent: int (const void *, const void *)
talloc_named: void *(const void *, size_t, const char *, ...)
talloc_named_const: void *(const void *, size_t, const char *)
talloc_parent: void *(const void *)
talloc_parent_name: const char *(const void *)
talloc_pool: void *(const void *, size_t)
talloc_realloc_fn: void *(const void *, void *, size_t)
talloc_reference_count: size_t (const void *)
talloc_reparent: void *(const void *, const void *, const void *)
talloc_report: void (const void *, FILE *)
talloc_report_depth_cb: void (const void *, int, int, void (*)(const void *, int, int, int, void *), void *)
talloc_report_depth_file: void (const void *, int, int, FILE *)
talloc_report_full: void (const void *, FILE *)
talloc_set_abort_fn: void (void (*)(const char *))
talloc_set_log_fn: void (void (*)(const char *))
talloc_set_log_stderr: void (void)
talloc_set_memlimit: int (const void *, size_t)
talloc_set_name: const char *(const void *, const char *, ...)
talloc_set_name_const: void (const void *, const char *)
talloc_show_parents: void (const void *, FILE *)
talloc_strdup: char *(const void *, const char *)
talloc_strdup_append: char *(char *, const char *)
talloc_strdup_append_buffer: char *(char *, const char *)
talloc_strndup: char *(const void *, const char *, size_t)
talloc_strndup_append: char *(char *, const char *, size_t)
talloc_strndup_append_buffer: char *(char *, const char *, size_t)
talloc_test_get_magic: int (void)
talloc_total_blocks: size_t (const void *)
talloc_total_size: size_t (const void *)
talloc_unlink: int (const void *, void *)
talloc_vasprintf: char *(const void *, const char *, va_list)
talloc_vasprintf_append: char *(char *, const char *, va_list)
talloc_vasprintf_append_buffer: char *(char *, const char *, va_list)
talloc_version_major: int (void)
talloc_version_minor: int (void)
......@@ -43,7 +43,7 @@ def process(tsk):
if tsk.__class__.stat: ret = tsk.__class__.stat(tsk)
# actual call to task's run() function
else: ret = tsk.call_run()
except Exception, e:
except Exception as e:
tsk.err_msg = Utils.ex_stack()
tsk.hasrun = EXCEPTION
......@@ -177,7 +177,7 @@ class Parallel(object):
try:
st = tsk.runnable_status()
except Exception, e:
except Exception as e:
self.processed += 1
if self.stop and not Options.options.keep:
tsk.hasrun = SKIPPED
......
......@@ -454,7 +454,8 @@ def CHECK_CODE(conf, code, define,
@conf
def CHECK_STRUCTURE_MEMBER(conf, structname, member,
always=False, define=None, headers=None):
always=False, define=None, headers=None,
lib=None):
'''check for a structure member'''
if define is None:
define = 'HAVE_%s' % member.upper()
......@@ -463,6 +464,7 @@ def CHECK_STRUCTURE_MEMBER(conf, structname, member,
define,
execute=False,
link=False,
lib=lib,
always=always,
headers=headers,
local_include=False,
......@@ -709,6 +711,8 @@ def SAMBA_CONFIG_H(conf, path=None):
testflags=True)
conf.ADD_CFLAGS('-Werror=uninitialized -Wuninitialized',
testflags=True)
conf.ADD_CFLAGS('-Wimplicit-fallthrough',
testflags=True)
conf.ADD_CFLAGS('-Wformat=2 -Wno-format-y2k', testflags=True)
conf.ADD_CFLAGS('-Wno-format-zero-length', testflags=True)
......
......@@ -50,7 +50,7 @@ def check(self, *k, **kw):
ret = None
try:
ret = self.run_c_code(*k, **kw)
except Configure.ConfigurationError, e:
except Configure.ConfigurationError as e:
self.check_message_2(kw['errmsg'], 'YELLOW')
if 'mandatory' in kw and kw['mandatory']:
if Logs.verbose > 1:
......
......@@ -167,7 +167,7 @@ def dist(appname='', version=''):
absdir = os.path.join(srcdir, dir)
try:
files = vcs_dir_contents(absdir)
except Exception, e:
except Exception as e:
Logs.error('unable to get contents of %s: %s' % (absdir, e))
sys.exit(1)
add_files_to_tarball(tar, srcdir, dir, dist_base, destdir, blacklist, files)
......
......@@ -353,6 +353,7 @@ def SAMBA_BINARY(bld, binname, source,
modules=None,
ldflags=None,
cflags='',
cflags_end=None,
autoproto=None,
use_hostcc=False,
use_global_deps=True,
......@@ -410,6 +411,7 @@ def SAMBA_BINARY(bld, binname, source,
deps = deps,
includes = includes,
cflags = pie_cflags,
cflags_end = cflags_end,
group = subsystem_group,
autoproto = autoproto,
subsystem_name = subsystem_name,
......@@ -458,6 +460,7 @@ def SAMBA_MODULE(bld, modname, source,
autoproto=None,
autoproto_extra_source='',
cflags='',
cflags_end=None,
internal_module=True,
local_include=True,
global_include=True,
......@@ -488,6 +491,7 @@ def SAMBA_MODULE(bld, modname, source,
autoproto=autoproto,
autoproto_extra_source=autoproto_extra_source,
cflags=cflags,
cflags_end=cflags_end,
local_include=local_include,
global_include=global_include,
allow_warnings=allow_warnings,
......@@ -527,6 +531,7 @@ def SAMBA_MODULE(bld, modname, source,
deps=deps,
includes=includes,
cflags=cflags,
cflags_end=cflags_end,
realname = realname,
autoproto = autoproto,
local_include=local_include,
......@@ -900,7 +905,7 @@ def INSTALL_DIR(bld, path, chmod=0o755, env=None):
try:
os.makedirs(destpath)
os.chmod(destpath, chmod)
except OSError, e:
except OSError as e:
if not os.path.isdir(destpath):
raise Utils.WafError("Cannot create the folder '%s' (error: %s)" % (path, e))
Build.BuildContext.INSTALL_DIR = INSTALL_DIR
......
......@@ -313,10 +313,6 @@ def configure(conf):
conf.env.GIT_LOCAL_CHANGES = Options.options.GIT_LOCAL_CHANGES
conf.CHECK_COMMAND(['uname', '-a'],
msg='Checking build system',
define='BUILD_SYSTEM',
on_target=False)
conf.CHECK_UNAME()
# see if we can compile and run a simple C program
......
......@@ -691,10 +691,12 @@ typedef int bool;
#if !defined(HAVE_INTPTR_T)
typedef long long intptr_t ;
#define __intptr_t_defined
#endif
#if !defined(HAVE_UINTPTR_T)
typedef unsigned long long uintptr_t ;
#define __uintptr_t_defined
#endif
#if !defined(HAVE_PTRDIFF_T)
......@@ -922,6 +924,15 @@ void rep_setproctitle(const char *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
#define setproctitle_init rep_setproctitle_init
void rep_setproctitle_init(int argc, char *argv[], char *envp[]);
#endif
#ifndef FALL_THROUGH
# ifdef HAVE_FALLTHROUGH_ATTRIBUTE
# define FALL_THROUGH __attribute__ ((fallthrough))
# else /* HAVE_FALLTHROUGH_ATTRIBUTE */
# define FALL_THROUGH ((void)0)
# endif /* HAVE_FALLTHROUGH_ATTRIBUTE */
#endif /* FALL_THROUGH */
bool nss_wrapper_enabled(void);
bool nss_wrapper_hosts_enabled(void);
bool socket_wrapper_enabled(void);
......
......@@ -462,7 +462,8 @@ strptime_internal (rp, fmt, tm, decided, era_cnt)
*decided = raw;
}
#endif
/* Fall through. */
FALL_THROUGH;
case 'D':
/* Match standard day format. */
if (!recursive (HERE_D_FMT))
......@@ -611,7 +612,8 @@ strptime_internal (rp, fmt, tm, decided, era_cnt)
*decided = raw;
}
#endif
/* Fall through. */
FALL_THROUGH;
case 'T':
if (!recursive (HERE_T_FMT))
return NULL;
......
/*
Unix SMB/CIFS implementation.
nis system include wrappers
Copyright (C) Andrew Tridgell 2004
** NOTE! The following LGPL license applies to the replace
** library. This does NOT imply that all of Samba is released
** under the LGPL
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _nis_passwd_h
#define _nis_passwd_h
#if defined(HAVE_RPC_RPC_H)
/*
* Check for AUTH_ERROR define conflict with rpc/rpc.h in prot.h.
*/
#if defined(HAVE_SYS_SECURITY_H) && defined(HAVE_RPC_AUTH_ERROR_CONFLICT)
#undef AUTH_ERROR
#endif /* HAVE_SYS_SECURITY_H && HAVE_RPC_AUTH_ERROR_CONFLICT */
/*
* HP-UX 11.X has TCP_NODELAY and TCP_MAXSEG defined in <netinet/tcp.h> which
* was included above. However <rpc/rpc.h> includes <sys/xti.h> which defines
* them again without checking if they already exsist. This generates
* two "Redefinition of macro" warnings for every single .c file that is
* compiled.
*/
#if defined(HPUX) && defined(TCP_NODELAY)
#undef TCP_NODELAY
#endif /* HPUX && TCP_NODELAY */
#if defined(HPUX) && defined(TCP_MAXSEG)
#undef TCP_MAXSEG
#endif /* HPUX && TCP_MAXSEG */
#include <rpc/rpc.h>
#endif /* HAVE_RPC_RPC_H */
#if defined (HAVE_NETGROUP)
#if defined(HAVE_RPCSVC_YP_PROT_H)
/*
* HP-UX 11.X has TCP_NODELAY and TCP_MAXSEG defined in <netinet/tcp.h> which
* was included above. However <rpc/rpc.h> includes <sys/xti.h> which defines
* them again without checking if they already exsist. This generates
* two "Redefinition of macro" warnings for every single .c file that is
* compiled.
*/
#if defined(HPUX) && defined(TCP_NODELAY)
#undef TCP_NODELAY
#endif /* HPUX && TCP_MAXSEG */
#if defined(HPUX) && defined(TCP_MAXSEG)
#undef TCP_MAXSEG
#endif /* HPUX && TCP_MAXSEG */
#include <rpcsvc/yp_prot.h>
#endif /* HAVE_RPCSVC_YP_PROT_H */
#if defined(HAVE_RPCSVC_YPCLNT_H)
#include <rpcsvc/ypclnt.h>
#endif /* HAVE_RPCSVC_YPCLNT_H */
#endif /* HAVE_NETGROUP */
#endif /* _nis_passwd_h */
#!/usr/bin/env python
conf.CHECK_HEADERS('sys/capability.h')
conf.CHECK_FUNCS('getpwnam_r getpwuid_r getpwent_r')
# solaris varients of getXXent_r
conf.CHECK_C_PROTOTYPE('getpwent_r',
'struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)',
......@@ -19,8 +16,3 @@ conf.CHECK_C_PROTOTYPE('getgrent_r',
'struct group *getgrent_r(struct group *src, char *buf, size_t buflen)',
define='SOLARIS_GETGRENT_R', headers='grp.h')
conf.CHECK_FUNCS('getgrouplist')
conf.CHECK_HEADERS('ctype.h locale.h langinfo.h')
conf.CHECK_HEADERS('fnmatch.h locale.h langinfo.h')
conf.CHECK_HEADERS('sys/ipc.h sys/mman.h sys/shm.h')
conf.CHECK_HEADERS('termios.h termio.h sys/termio.h')
......@@ -5,7 +5,7 @@ VERSION = '1.2.1'
blddir = 'bin'
import sys, os
import Logs, sys, os
# find the buildtools directory
srcdir = '.'
......@@ -65,14 +65,49 @@ def configure(conf):
headers='sys/inotify.h')
conf.CHECK_HEADERS('security/pam_appl.h zlib.h asm/unistd.h')
conf.CHECK_HEADERS('aio.h sys/unistd.h rpc/rpc.h rpc/nettype.h alloca.h float.h')
conf.CHECK_HEADERS('aio.h sys/unistd.h alloca.h float.h')
conf.SET_TARGET_TYPE('tirpc', 'EMPTY')
if conf.CHECK_CODE(
'\n#ifndef _TIRPC_RPC_H\n#error "no tirpc headers in system path"\n#endif\n',
'HAVE_RPC_RPC_HEADERS',
headers=['rpc/rpc.h', 'rpc/nettype.h'],
msg='Checking for tirpc rpc headers in default system path'):
if conf.CONFIG_SET('HAVE_RPC_RPC_H'):
conf.undefine('HAVE_RPC_RPC_H')
if not conf.CONFIG_SET('HAVE_RPC_RPC_H'):
if conf.CHECK_CFG(package='libtirpc', args='--cflags --libs',
msg='Checking for libtirpc headers',
uselib_store='TIRPC'):
conf.CHECK_HEADERS('rpc/rpc.h rpc/nettype.h', lib='tirpc', together=True)
conf.SET_TARGET_TYPE('tirpc', 'SYSLIB')
if not conf.CONFIG_SET('HAVE_RPC_RPC_H'):
if conf.CHECK_CFG(package='libntirpc', args='--cflags',
msg='Checking for libntirpc headers',
uselib_store='TIRPC'):
conf.CHECK_HEADERS('rpc/rpc.h rpc/nettype.h', lib='tirpc', together=True)
conf.SET_TARGET_TYPE('tirpc', 'SYSLIB')
if not conf.CONFIG_SET('HAVE_RPC_RPC_H'):
Logs.warn('No rpc/rpc.h header found, tirpc or libntirpc missing?')
conf.SET_TARGET_TYPE('nsl', 'EMPTY')
conf.CHECK_HEADERS('rpc/rpc.h rpcsvc/yp_prot.h', lib='tirpc')
if not conf.CONFIG_SET('HAVE_RPCSVC_YP_PROT_H'):
if conf.CHECK_CFG(package='libnsl', args='--cflags --libs',
msg='Checking for libnsl',
uselib_store='NSL'):
conf.SET_TARGET_TYPE('nsl', 'SYSLIB')
conf.CHECK_HEADERS('rpc/rpc.h rpcsvc/yp_prot.h', lib='tirpc nsl')
else:
conf.SET_TARGET_TYPE('nsl', 'SYSLIB')
conf.CHECK_HEADERS('rpcsvc/nis.h rpcsvc/ypclnt.h', lib='tirpc nsl')
conf.CHECK_HEADERS('rpcsvc/nis.h rpcsvc/ypclnt.h sys/sysctl.h')
conf.CHECK_HEADERS('sys/sysctl.h')
conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h')
conf.CHECK_CODE('', headers='rpc/rpc.h rpcsvc/yp_prot.h', define='HAVE_RPCSVC_YP_PROT_H')
conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
......@@ -87,6 +122,9 @@ def configure(conf):
if conf.CHECK_CFLAGS('-Wno-unused-function'):
conf.define('HAVE_WNO_UNUSED_FUNCTION', '1')
if conf.CHECK_CFLAGS('-Wno-strict-overflow'):
conf.define('HAVE_WNO_STRICT_OVERFLOW', '1')
# Check for process set name support
conf.CHECK_CODE('''
#include <sys/prctl.h>
......@@ -222,6 +260,42 @@ def configure(conf):
headers='stdint.h sys/atomic.h',
msg='Checking for atomic_add_32 compiler builtin')
conf.CHECK_CODE('''
#define FALL_THROUGH __attribute__((fallthrough))
enum direction_e {
UP = 0,
DOWN,
};
int main(void) {
enum direction_e key = UP;
int i = 10;
int j = 0;
switch (key) {
case UP:
i = 5;
FALL_THROUGH;
case DOWN:
j = i * 2;
break;
default:
break;
}
if (j < i) {
return 1;
}
return 0;
}
''',
'HAVE_FALLTHROUGH_ATTRIBUTE',
addmain=False,
cflags='-Werror',
msg='Checking for fallthrough attribute')
# these may be builtins, so we need the link=False strategy
conf.CHECK_FUNCS('strdup memmem printf memset memcpy memmove strcpy strncpy bzero', link=False)
......
......@@ -121,8 +121,12 @@ static unsigned int talloc_magic = TALLOC_MAGIC_NON_RANDOM;
NULL
*/
static void *null_context;
static bool talloc_report_null;
static bool talloc_report_null_full;
static void *autofree_context;
static void talloc_setup_atexit(void);
/* used to enable fill of memory on free, which can be useful for
* catching use after free errors when valgrind is too slow
*/
......@@ -426,6 +430,33 @@ void talloc_lib_init(void)
#warning "No __attribute__((constructor)) support found on this platform, additional talloc security measures not available"
#endif
static void talloc_lib_atexit(void)
{
TALLOC_FREE(autofree_context);
if (talloc_total_size(null_context) == 0) {
return;
}
if (talloc_report_null_full) {
talloc_report_full(null_context, stderr);
} else if (talloc_report_null) {
talloc_report(null_context, stderr);
}
}
static void talloc_setup_atexit(void)
{
static bool done;
if (done) {
return;
}
atexit(talloc_lib_atexit);
done = true;
}
static void talloc_log(const char *fmt, ...) PRINTF_ATTRIBUTE(1,2);
static void talloc_log(const char *fmt, ...)
{
......@@ -2294,26 +2325,6 @@ _PUBLIC_ void talloc_report(const void *ptr, FILE *f)
talloc_report_depth_file(ptr, 0, 1, f);
}
/*
report on any memory hanging off the null context
*/
static void talloc_report_null(void)
{
if (talloc_total_size(null_context) != 0) {
talloc_report(null_context, stderr);
}
}
/*
report on any memory hanging off the null context
*/
static void talloc_report_null_full(void)
{
if (talloc_total_size(null_context) != 0) {
talloc_report_full(null_context, stderr);
}
}
/*
enable tracking of the NULL context
*/
......@@ -2369,7 +2380,8 @@ _PUBLIC_ void talloc_disable_null_tracking(void)
_PUBLIC_ void talloc_enable_leak_report(void)
{
talloc_enable_null_tracking();
atexit(talloc_report_null);
talloc_report_null = true;
talloc_setup_atexit();
}
/*
......@@ -2378,7 +2390,8 @@ _PUBLIC_ void talloc_enable_leak_report(void)
_PUBLIC_ void talloc_enable_leak_report_full(void)
{
talloc_enable_null_tracking();
atexit(talloc_report_null_full);
talloc_report_null_full = true;
talloc_setup_atexit();
}
/*
......@@ -2554,7 +2567,8 @@ static struct talloc_chunk *_vasprintf_tc(const void *t,
const char *fmt,
va_list ap)
{
int len;
int vlen;
size_t len;
char *ret;
va_list ap2;
struct talloc_chunk *tc;
......@@ -2562,9 +2576,13 @@ static struct talloc_chunk *_vasprintf_tc(const void *t,
/* this call looks strange, but it makes it work on older solaris boxes */
va_copy(ap2, ap);
len = vsnprintf(buf, sizeof(buf), fmt, ap2);
vlen = vsnprintf(buf, sizeof(buf), fmt, ap2);
va_end(ap2);
if (unlikely(len < 0)) {
if (unlikely(vlen < 0)) {
return NULL;
}
len = vlen;
if (unlikely(len + 1 < len)) {
return NULL;
}
......@@ -2760,11 +2778,6 @@ static int talloc_autofree_destructor(void *ptr)
return 0;
}
static void talloc_autofree(void)
{
talloc_free(autofree_context);
}
/*
return a context which will be auto-freed on exit
this is useful for reducing the noise in leak reports
......@@ -2774,7 +2787,7 @@ _PUBLIC_ void *talloc_autofree_context(void)
if (autofree_context == NULL) {
autofree_context = _talloc_named_const(NULL, 0, "autofree_context");
talloc_set_destructor(autofree_context, talloc_autofree_destructor);
atexit(talloc_autofree);
talloc_setup_atexit();
}
return autofree_context;
}
......
......@@ -1226,7 +1226,7 @@ size_t talloc_array_length(const void *ctx);
*
* @code
* ptr = talloc_array(ctx, type, count);
* if (ptr) memset(ptr, sizeof(type) * count);
* if (ptr) memset(ptr, 0, sizeof(type) * count);
* @endcode
*/
void *talloc_zero_array(const void *ctx, #type, unsigned count);
......
#!/usr/bin/env python
APPNAME = 'talloc'
VERSION = '2.1.11'
VERSION = '2.1.13'
blddir = 'bin'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment