ports/net/samba4/files/patch-source3__wscript
Timur I. Bakeyev a5ced76f06 Upgrade port to the 4.0.12 version, closing CVE-2013-4475 and CVE-2013-4476.
Remove dependency from gettext. Converted to STAGEDIR.

PR:		183872, 183885
Security:	CVE-2013-4475
		CVE-2013-4476
Sponsored by:	my wife
2013-11-19 21:49:39 +00:00

105 lines
5 KiB
Text

--- ./source3/wscript.orig 2013-10-07 08:49:10.000000000 +0000
+++ ./source3/wscript 2013-11-18 22:45:12.808702339 +0000
@@ -35,6 +35,7 @@
opt.SAMBA3_ADD_OPTION('utmp')
opt.SAMBA3_ADD_OPTION('pthreadpool', with_name="enable", without_name="disable", default=True)
opt.SAMBA3_ADD_OPTION('avahi', with_name="enable", without_name="disable")
+ opt.SAMBA3_ADD_OPTION('dnssd', with_name="enable", without_name="disable")
opt.SAMBA3_ADD_OPTION('iconv')
opt.SAMBA3_ADD_OPTION('acl-support')
opt.SAMBA3_ADD_OPTION('dnsupdate')
@@ -312,7 +312,9 @@
# Check if the compiler will optimize out functions
conf.CHECK_CODE('''
-if (0) {
+char s = "string";
+int len = 6;
+if (sizeof(s) != len && sizeof(s) != sizeof(char *)) {
this_function_does_not_exist();
} else {
return 1;
@@ -502,7 +504,7 @@
conf.CHECK_CODE('struct aiocb a; return aio_return(&a);', 'HAVE_AIO_RETURN', msg='Checking for aio_return', headers='aio.h', lib='aio rt')
conf.CHECK_CODE('struct aiocb a; return aio_error(&a);', 'HAVE_AIO_ERROR', msg='Checking for aio_error', headers='aio.h', lib='aio rt')
conf.CHECK_CODE('struct aiocb a; return aio_cancel(1, &a);', 'HAVE_AIO_CANCEL', msg='Checking for aio_cancel', headers='aio.h', lib='aio rt')
- conf.CHECK_CODE('struct aiocb a; struct timespec t; return aio_suspend(&a, 1, &t);', 'HAVE_AIO_SUSPEND', msg='Checking for aio_suspend', headers='aio.h', lib='aio rt')
+ conf.CHECK_CODE('const struct aiocb * const a[1]; struct timespec t; return aio_suspend(a, 1, &t);', 'HAVE_AIO_SUSPEND', msg='Checking for aio_suspend', headers='aio.h', lib='aio rt')
if not conf.CONFIG_SET('HAVE_AIO'):
conf.DEFINE('HAVE_NO_AIO', '1')
else:
@@ -812,6 +813,17 @@
conf.SET_TARGET_TYPE('avahi-common', 'EMPTY')
conf.SET_TARGET_TYPE('avahi-client', 'EMPTY')
+ if Options.options.with_dnssd:
+ conf.env.with_dnssd = True
+ if not conf.CHECK_HEADERS('dns_sd.h'):
+ conf.env.with_dnssd = False
+ if not conf.CHECK_FUNCS_IN('DNSServiceRegister', 'dns_sd'):
+ conf.env.with_dnssd = False
+ if conf.env.with_dnssd:
+ conf.DEFINE('WITH_DNSSD_SUPPORT', 1)
+ else:
+ conf.SET_TARGET_TYPE('dns_sd', 'EMPTY')
+
if Options.options.with_iconv:
conf.env.with_iconv = True
if not conf.CHECK_FUNCS_IN('iconv_open', 'iconv', headers='iconv.h'):
@@ -1670,26 +1670,8 @@
if PTHREAD_LDFLAGS == 'error':
if conf.CHECK_FUNCS_IN('pthread_attr_init', 'pthread'):
- PTHREAD_CFLAGS='-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS'
- PTHREAD_LDFLAGS='-lpthread'
- if PTHREAD_LDFLAGS == 'error':
- if conf.CHECK_FUNCS_IN('pthread_attr_init', 'pthreads'):
- PTHREAD_CFLAGS='-D_THREAD_SAFE'
- PTHREAD_LDFLAGS='-lpthreads'
- if PTHREAD_LDFLAGS == 'error':
- if conf.CHECK_FUNCS_IN('pthread_attr_init', 'c_r'):
- PTHREAD_CFLAGS='-D_THREAD_SAFE -pthread'
+ PTHREAD_CFLAGS='-pthread'
PTHREAD_LDFLAGS='-pthread'
- if PTHREAD_LDFLAGS == 'error':
- if conf.CHECK_FUNCS('pthread_attr_init'):
- PTHREAD_CFLAGS='-D_REENTRANT'
- PTHREAD_LDFLAGS='-lpthread'
- # especially for HP-UX, where the CHECK_FUNC macro fails to test for
- # pthread_attr_init. On pthread_mutex_lock it works there...
- if PTHREAD_LDFLAGS == 'error':
- if conf.CHECK_FUNCS_IN('pthread_mutex_lock', 'pthread'):
- PTHREAD_CFLAGS='-D_REENTRANT'
- PTHREAD_LDFLAGS='-lpthread'
if PTHREAD_CFLAGS != 'error' and PTHREAD_LDFLAGS != 'error':
conf.ADD_CFLAGS(PTHREAD_CFLAGS)
@@ -1719,8 +1701,8 @@
auth_script vfs_readahead vfs_xattr_tdb vfs_posix_eadb
vfs_streams_xattr vfs_streams_depot vfs_acl_xattr vfs_acl_tdb
vfs_smb_traffic_analyzer vfs_preopen vfs_catia vfs_scannedonly
- vfs_media_harmony
- vfs_commit
+ vfs_media_harmony
+ vfs_commit
vfs_crossrename vfs_linux_xfs_sgid
vfs_time_audit idmap_autorid idmap_tdb2
idmap_rid idmap_hash'''))
@@ -1733,7 +1715,7 @@
if Options.options.enable_selftest or Options.options.developer:
default_shared_modules.extend(TO_LIST('vfs_fake_acls'))
-
+
if conf.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'):
default_static_modules.extend(TO_LIST('pdb_samba_dsdb auth_samba4 vfs_dfs_samba4'))
@@ -1766,7 +1748,7 @@
default_static_modules.extend(TO_LIST('charset_macosxfs'))
if conf.CONFIG_SET('HAVE_GPFS'):
- default_shared_modules.extend(TO_LIST('vfs_gpfs'))
+ default_shared_modules.extend(TO_LIST('vfs_gpfs'))
if conf.CONFIG_SET('SAMBA_FAM_LIBS'):
default_shared_modules.extend(TO_LIST('vfs_notify_fam'))