@ -0,0 +1,10 @@
|
||||
--- a/source3/libsmb/wscript
|
||||
+++ b/source3/libsmb/wscript
|
||||
@@ -22,6 +22,7 @@
|
||||
libsmb
|
||||
KRBCLIENT
|
||||
msrpc3
|
||||
+ RPC_NDR_SRVSVC
|
||||
libcli_lsa3''',
|
||||
public_headers='../include/libsmbclient.h',
|
||||
abi_directory='ABI',
|
||||
290
Plugins/BuildFFmpeg/patch/libsmbclient/02-cross_compile.patch
Normal file
290
Plugins/BuildFFmpeg/patch/libsmbclient/02-cross_compile.patch
Normal file
@ -0,0 +1,290 @@
|
||||
--- a/buildtools/wafsamba/samba_autoconf.py
|
||||
+++ b/buildtools/wafsamba/samba_autoconf.py
|
||||
@@ -320,7 +320,7 @@
|
||||
|
||||
|
||||
@conf
|
||||
-def CHECK_SIZEOF(conf, vars, headers=None, define=None, critical=True):
|
||||
+def CHECK_SIZEOF(conf, vars, headers=None, define=None, cflags='', critical=True):
|
||||
'''check the size of a type'''
|
||||
for v in TO_LIST(vars):
|
||||
v_define = define
|
||||
@@ -333,6 +333,7 @@
|
||||
define=v_define,
|
||||
quote=False,
|
||||
headers=headers,
|
||||
+ cflags=cflags,
|
||||
local_include=False,
|
||||
msg="Checking if size of %s == %d" % (v, size)):
|
||||
conf.DEFINE(v_define, size)
|
||||
@@ -843,7 +844,6 @@
|
||||
for key in conf.env.define_key:
|
||||
conf.undefine(key, from_env=False)
|
||||
conf.env.define_key = []
|
||||
- conf.SAMBA_CROSS_CHECK_COMPLETE()
|
||||
|
||||
|
||||
@conf
|
||||
--- a/buildtools/wafsamba/samba_conftests.py
|
||||
+++ b/buildtools/wafsamba/samba_conftests.py
|
||||
@@ -101,25 +101,24 @@
|
||||
else:
|
||||
conf.DEFINE(flag_split[0], flag_split[1])
|
||||
|
||||
- if conf.CHECK_CODE('if (sizeof(off_t) < 8) return 1',
|
||||
- define,
|
||||
- execute=True,
|
||||
- msg='Checking for large file support without additional flags'):
|
||||
+ conf.undefine("SIZEOF_OFF_T")
|
||||
+ conf.CHECK_SIZEOF("off_t")
|
||||
+ if int(conf.get_define("SIZEOF_OFF_T")) >= 8:
|
||||
+ conf.undefine("SIZEOF_OFF_T")
|
||||
+ conf.DEFINE(define, 1)
|
||||
return True
|
||||
|
||||
- if conf.CHECK_CODE('if (sizeof(off_t) < 8) return 1',
|
||||
- define,
|
||||
- execute=True,
|
||||
- cflags='-D_FILE_OFFSET_BITS=64',
|
||||
- msg='Checking for -D_FILE_OFFSET_BITS=64'):
|
||||
+ conf.undefine("SIZEOF_OFF_T")
|
||||
+ conf.CHECK_SIZEOF("off_t", cflags='-D_FILE_OFFSET_BITS=64')
|
||||
+ if int(conf.get_define("SIZEOF_OFF_T")) >= 8:
|
||||
+ conf.undefine("SIZEOF_OFF_T")
|
||||
conf.DEFINE('_FILE_OFFSET_BITS', 64)
|
||||
return True
|
||||
|
||||
- if conf.CHECK_CODE('if (sizeof(off_t) < 8) return 1',
|
||||
- define,
|
||||
- execute=True,
|
||||
- cflags='-D_LARGE_FILES',
|
||||
- msg='Checking for -D_LARGE_FILES'):
|
||||
+ conf.undefine("SIZEOF_OFF_T")
|
||||
+ conf.CHECK_SIZEOF("off_t", cflags='-D_LARGE_FILES')
|
||||
+ if int(conf.get_define("SIZEOF_OFF_T")) >= 8:
|
||||
+ conf.undefine("SIZEOF_OFF_T")
|
||||
conf.DEFINE('_LARGE_FILES', 1)
|
||||
return True
|
||||
return False
|
||||
--- a/buildtools/wafsamba/wscript
|
||||
+++ b/buildtools/wafsamba/wscript
|
||||
@@ -317,7 +317,7 @@
|
||||
conf.CHECK_CODE('printf("hello world")',
|
||||
define='HAVE_SIMPLE_C_PROG',
|
||||
mandatory=True,
|
||||
- execute=True,
|
||||
+ execute=False,
|
||||
headers='stdio.h',
|
||||
msg='Checking simple C program')
|
||||
|
||||
--- a/lib/replace/wscript
|
||||
+++ b/lib/replace/wscript
|
||||
@@ -41,6 +41,7 @@
|
||||
conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h')
|
||||
conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')
|
||||
conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')
|
||||
+ conf.CHECK_FUNCS('nl_langinfo', headers='langinfo.h')
|
||||
conf.CHECK_HEADERS('locale.h ndir.h pwd.h')
|
||||
conf.CHECK_HEADERS('shadow.h sys/acl.h')
|
||||
conf.CHECK_HEADERS('sys/attributes.h attr/attributes.h sys/capability.h sys/dir.h sys/epoll.h')
|
||||
@@ -692,7 +693,7 @@
|
||||
conf.CHECK_CODE('''#define LIBREPLACE_CONFIGURE_TEST_STRPTIME
|
||||
#include "tests/strptime.c"''',
|
||||
define='HAVE_WORKING_STRPTIME',
|
||||
- execute=True,
|
||||
+ execute=False,
|
||||
addmain=False,
|
||||
msg='Checking for working strptime')
|
||||
|
||||
@@ -707,7 +708,7 @@
|
||||
|
||||
conf.CHECK_CODE('#include "tests/snprintf.c"',
|
||||
define="HAVE_C99_VSNPRINTF",
|
||||
- execute=True,
|
||||
+ execute=False,
|
||||
addmain=False,
|
||||
msg="Checking for C99 vsnprintf")
|
||||
|
||||
@@ -802,7 +803,7 @@
|
||||
exit(0);
|
||||
''',
|
||||
define='HAVE_SECURE_MKSTEMP',
|
||||
- execute=True,
|
||||
+ execute=False,
|
||||
mandatory=True) # lets see if we get a mandatory failure for this one
|
||||
|
||||
# look for a method of finding the list of network interfaces
|
||||
@@ -814,6 +815,7 @@
|
||||
#define %s 1
|
||||
#define NO_CONFIG_H 1
|
||||
#define AUTOCONF_TEST 1
|
||||
+ #define __STDC_WANT_LIB_EXT1__ 1
|
||||
#include "replace.c"
|
||||
#include "inet_ntop.c"
|
||||
#include "snprintf.c"
|
||||
@@ -824,7 +826,7 @@
|
||||
method,
|
||||
lib='nsl socket' + bsd_for_strlcpy,
|
||||
addmain=False,
|
||||
- execute=True):
|
||||
+ execute=False):
|
||||
break
|
||||
|
||||
conf.RECURSE('system')
|
||||
--- a/lib/socket/wscript
|
||||
+++ b/lib/socket/wscript
|
||||
@@ -4,4 +4,5 @@
|
||||
conf.CHECK_HEADERS('linux/sockios.h linux/ethtool.h')
|
||||
if (conf.CONFIG_SET('HAVE_LINUX_SOCKIOS_H') and \
|
||||
conf.CONFIG_SET('HAVE_LINUX_ETHTOOL_H')):
|
||||
- conf.DEFINE('HAVE_ETHTOOL', 1)
|
||||
+ if conf.CHECK_FUNCS('ethtool_cmd_speed', headers='linux/sockios.h linux/ethtool.h'):
|
||||
+ conf.DEFINE('HAVE_ETHTOOL', 1)
|
||||
--- a/source3/lib/util.c
|
||||
+++ b/source3/lib/util.c
|
||||
@@ -51,6 +51,10 @@
|
||||
/* Max allowable allococation - 256mb - 0x10000000 */
|
||||
#define MAX_ALLOC_SIZE (1024*1024*256)
|
||||
|
||||
+#ifndef YPERR_KEY
|
||||
+#define YPERR_KEY 5
|
||||
+#endif
|
||||
+
|
||||
static enum protocol_types Protocol = PROTOCOL_COREPLUS;
|
||||
|
||||
enum protocol_types get_Protocol(void)
|
||||
--- a/source3/wscript
|
||||
+++ b/source3/wscript
|
||||
@@ -156,7 +156,7 @@
|
||||
|
||||
# Check for inotify support (Skip if we are SunOS)
|
||||
#NOTE: illumos provides sys/inotify.h but is not an exact match for linux
|
||||
- host_os = sys.platform
|
||||
+ host_os = os.getenv('HOST', sys.platform)
|
||||
if host_os.rfind('sunos') == -1:
|
||||
conf.CHECK_HEADERS('sys/inotify.h')
|
||||
if conf.env.HAVE_SYS_INOTIFY_H:
|
||||
@@ -455,8 +455,8 @@
|
||||
|
||||
# FIXME: these should be tests for features, but the old build system just
|
||||
# checks for OSes.
|
||||
- host_os = sys.platform
|
||||
- Logs.info("building on %s" % host_os)
|
||||
+ host_os = os.getenv('HOST', sys.platform)
|
||||
+ Logs.info("building for %s" % host_os)
|
||||
|
||||
# Python doesn't have case switches... :/
|
||||
# FIXME: original was *linux* | gnu* | k*bsd*-gnu | kopensolaris*-gnu | *qnx*)
|
||||
@@ -1027,7 +1027,7 @@
|
||||
''',
|
||||
'USE_SETREUID',
|
||||
addmain=False,
|
||||
- execute=True,
|
||||
+ execute=False,
|
||||
msg="Checking whether setreuid is available")
|
||||
if not seteuid:
|
||||
seteuid = conf.CHECK_CODE('''
|
||||
@@ -1088,7 +1088,7 @@
|
||||
''',
|
||||
'HAVE_FCNTL_LOCK',
|
||||
addmain=False,
|
||||
- execute=True,
|
||||
+ execute=False,
|
||||
msg='Checking whether fcntl locking is available')
|
||||
|
||||
conf.CHECK_CODE('''
|
||||
--- a/tests/summary.c
|
||||
+++ b/tests/summary.c
|
||||
@@ -9,7 +9,7 @@
|
||||
#endif
|
||||
|
||||
#if !(defined(HAVE_IFACE_GETIFADDRS) || defined(HAVE_IFACE_IFCONF) || defined(HAVE_IFACE_IFREQ) || defined(HAVE_IFACE_AIX))
|
||||
-#warning "WARNING: No automated network interface determination"
|
||||
+#error "ERROR: No automated network interface determination"
|
||||
#endif
|
||||
|
||||
#if !(defined(USE_SETEUID) || defined(USE_SETREUID) || defined(USE_SETRESUID) || defined(USE_SETUIDX) || defined(HAVE_LINUX_THREAD_CREDENTIALS))
|
||||
--- a/third_party/popt/poptconfig.c
|
||||
+++ b/third_party/popt/poptconfig.c
|
||||
@@ -24,7 +24,7 @@
|
||||
#if defined(HAVE_GLOB_H)
|
||||
#include <glob.h>
|
||||
|
||||
-#if defined(__LCLINT__)
|
||||
+#if defined(HAVE_GLOB) && defined(__LCLINT__)
|
||||
/*@-declundef -exportheader -incondefs -protoparammatch -redecl -type @*/
|
||||
extern int glob (const char *__pattern, int __flags,
|
||||
/*@null@*/ int (*__errfunc) (const char *, int),
|
||||
@@ -104,7 +104,7 @@
|
||||
if (pat[0] == '@' && pat[1] != '(')
|
||||
pat++;
|
||||
|
||||
-#if defined(HAVE_GLOB_H)
|
||||
+#if defined(HAVE_GLOB)
|
||||
if (glob_pattern_p(pat, 0)) {
|
||||
glob_t _g, *pglob = &_g;
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
} else
|
||||
rc = POPT_ERROR_ERRNO;
|
||||
} else
|
||||
-#endif /* HAVE_GLOB_H */
|
||||
+#endif /* HAVE_GLOB */
|
||||
{
|
||||
if (acp)
|
||||
*acp = 1;
|
||||
--- a/third_party/popt/poptint.c
|
||||
+++ b/third_party/popt/poptint.c
|
||||
@@ -86,7 +86,7 @@
|
||||
if (istr == NULL)
|
||||
return NULL;
|
||||
|
||||
-#ifdef HAVE_LANGINFO_H
|
||||
+#ifdef HAVE_NL_LANGINFO
|
||||
codeset = nl_langinfo ((nl_item)CODESET);
|
||||
#endif
|
||||
|
||||
--- a/third_party/popt/poptint.h
|
||||
+++ b/third_party/popt/poptint.h
|
||||
@@ -174,7 +174,7 @@
|
||||
|
||||
#ifdef HAVE_LANGINFO_H
|
||||
#include <langinfo.h>
|
||||
-#if defined(__LCLINT__)
|
||||
+#if defined(HAVE_NL_LANGINFO) && defined(__LCLINT__)
|
||||
/*@-declundef -incondefs @*/
|
||||
extern char *nl_langinfo (nl_item __item)
|
||||
/*@*/;
|
||||
--- a/wscript
|
||||
+++ b/wscript
|
||||
@@ -175,7 +175,7 @@
|
||||
conf.SAMBA_CHECK_PYTHON()
|
||||
conf.SAMBA_CHECK_PYTHON_HEADERS()
|
||||
|
||||
- if sys.platform == 'darwin' and not conf.env['HAVE_ENVIRON_DECL']:
|
||||
+ if os.getenv('HOST', sys.platform).find('darwin') > -1 and not conf.env['HAVE_ENVIRON_DECL']:
|
||||
# Mac OSX needs to have this and it's also needed that the python is compiled with this
|
||||
# otherwise you face errors about common symbols
|
||||
if not conf.CHECK_SHLIB_W_PYTHON("Checking if -fno-common is needed"):
|
||||
@@ -183,7 +183,7 @@
|
||||
if not conf.CHECK_SHLIB_W_PYTHON("Checking if -undefined dynamic_lookup is not need"):
|
||||
conf.env.append_value('cshlib_LINKFLAGS', ['-undefined', 'dynamic_lookup'])
|
||||
|
||||
- if sys.platform == 'darwin':
|
||||
+ if os.getenv('HOST', sys.platform).find('darwin') > -1:
|
||||
conf.ADD_LDFLAGS('-framework CoreFoundation')
|
||||
|
||||
conf.RECURSE('dynconfig')
|
||||
--- a/wscript_configure_embedded_heimdal
|
||||
+++ b/wscript_configure_embedded_heimdal
|
||||
@@ -8 +8,10 @@
|
||||
conf.RECURSE('source4/heimdal_build')
|
||||
+
|
||||
+def check_system_heimdal_binary(name):
|
||||
+ if not conf.find_program(name, var=name.upper()):
|
||||
+ raise Exception("not conf.find_program(%s, var=%s)" % (name, name.upper()))
|
||||
+ conf.define('USING_SYSTEM_%s' % name.upper(), 1)
|
||||
+ return True
|
||||
+
|
||||
+check_system_heimdal_binary("compile_et")
|
||||
+check_system_heimdal_binary("asn1_compile")
|
||||
@ -0,0 +1,45 @@
|
||||
--- a/lib/ldb/wscript
|
||||
+++ b/lib/ldb/wscript
|
||||
@@ -519,10 +519,6 @@
|
||||
install=False)
|
||||
|
||||
bld.SAMBA_BINARY('ldb_key_value_sub_txn_tdb_test',
|
||||
- bld.SUBDIR('ldb_key_value',
|
||||
- '''ldb_kv_search.c
|
||||
- ldb_kv_index.c
|
||||
- ldb_kv_cache.c''') +
|
||||
'tests/ldb_key_value_sub_txn_test.c',
|
||||
cflags='-DTEST_BE=\"tdb\"',
|
||||
deps='cmocka ldb ldb_tdb_err_map',
|
||||
--- a/source4/heimdal_build/wscript_build
|
||||
+++ b/source4/heimdal_build/wscript_build
|
||||
@@ -5,6 +5,7 @@
|
||||
from samba_utils import SET_TARGET_TYPE
|
||||
from samba_autoconf import CURRENT_CFLAGS
|
||||
from samba_utils import LOAD_ENVIRONMENT, TO_LIST
|
||||
+from samba_bundled import BUILTIN_LIBRARY
|
||||
|
||||
def heimdal_path(p, absolute=False):
|
||||
hpath = os.path.join("../heimdal", p)
|
||||
@@ -215,7 +216,10 @@
|
||||
def HEIMDAL_LIBRARY(libname, source, deps, vnum, version_script, includes='', cflags=[]):
|
||||
'''define a Heimdal library'''
|
||||
|
||||
- obj_target = libname + '.objlist'
|
||||
+ if BUILTIN_LIBRARY(bld, libname):
|
||||
+ obj_target = libname
|
||||
+ else:
|
||||
+ obj_target = libname + '.objlist'
|
||||
|
||||
# first create a target for building the object files for this library
|
||||
# by separating in this way, we avoid recompiling the C files
|
||||
@@ -227,6 +231,9 @@
|
||||
cflags = cflags,
|
||||
group = 'main')
|
||||
|
||||
+ if BUILTIN_LIBRARY(bld, libname):
|
||||
+ return
|
||||
+
|
||||
if not SET_TARGET_TYPE(bld, libname, "LIBRARY"):
|
||||
return
|
||||
|
||||
52
Plugins/BuildFFmpeg/patch/libsmbclient/04-built-static.patch
Normal file
52
Plugins/BuildFFmpeg/patch/libsmbclient/04-built-static.patch
Normal file
@ -0,0 +1,52 @@
|
||||
--- a/buildtools/wafsamba/pkgconfig.py
|
||||
+++ b/buildtools/wafsamba/pkgconfig.py
|
||||
@@ -60,6 +60,15 @@
|
||||
t.env.LIB_RPATH = ''
|
||||
if vnum:
|
||||
t.env.PACKAGE_VERSION = vnum
|
||||
+ LIBS_PRIVATE = []
|
||||
+ REQUIRES_PRIVATE = []
|
||||
+ for _target, _type in t.env['TARGET_TYPE'].items():
|
||||
+ if _type == "SYSLIB" and 'LIB_' + _target.upper() in t.env:
|
||||
+ LIBS_PRIVATE.append('-l%s' % _target)
|
||||
+ if 'INCLUDES_' + _target.upper() in t.env and 'LIBPATH_' + _target.upper() in t.env and _target not in ['z']:
|
||||
+ REQUIRES_PRIVATE.append(_target)
|
||||
+ t.env.LIBS_PRIVATE = ' '.join(LIBS_PRIVATE)
|
||||
+ t.env.REQUIRES_PRIVATE = ' '.join(REQUIRES_PRIVATE)
|
||||
for v in [ 'PREFIX', 'EXEC_PREFIX', 'LIB_RPATH' ]:
|
||||
t.vars.append(t.env[v])
|
||||
bld.INSTALL_FILES(dest, target, flat=True, destname=base)
|
||||
--- a/buildtools/wafsamba/wafsamba.py
|
||||
+++ b/buildtools/wafsamba/wafsamba.py
|
||||
@@ -241,7 +241,7 @@
|
||||
if bld.env['ENABLE_RELRO'] is True:
|
||||
ldflags.extend(TO_LIST('-Wl,-z,relro,-z,now'))
|
||||
|
||||
- features = 'c cshlib symlink_lib install_lib'
|
||||
+ features = 'c cstlib'
|
||||
if pyext:
|
||||
features += ' pyext'
|
||||
if pyembed:
|
||||
--- a/source3/libsmb/smbclient.pc.in
|
||||
+++ b/source3/libsmb/smbclient.pc.in
|
||||
@@ -7,5 +7,7 @@
|
||||
Description: A SMB library interface
|
||||
Version: @PACKAGE_VERSION@
|
||||
Libs: @LIB_RPATH@ -L${libdir} -lsmbclient
|
||||
+Libs.private: @LIBS_PRIVATE@
|
||||
+Requires.private: @REQUIRES_PRIVATE@
|
||||
Cflags: -I${includedir}
|
||||
URL: http://www.samba.org/
|
||||
--- a/source4/heimdal/lib/hcrypto/camellia-ntt.h
|
||||
+++ b/source4/heimdal/lib/hcrypto/camellia-ntt.h
|
||||
@@ -35,6 +35,10 @@
|
||||
|
||||
typedef u32 KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN];
|
||||
|
||||
+/* symbol renaming */
|
||||
+#define Camellia_Ekeygen hc_Camellia_Ekeygen
|
||||
+#define Camellia_EncryptBlock hc_Camellia_EncryptBlock
|
||||
+#define Camellia_DecryptBlock hc_Camellia_DecryptBlock
|
||||
|
||||
void Camellia_Ekeygen(const int keyBitLength,
|
||||
const unsigned char *rawKey,
|
||||
239
Plugins/BuildFFmpeg/patch/libsmbclient/05-no_fork_and_exec.patch
Normal file
239
Plugins/BuildFFmpeg/patch/libsmbclient/05-no_fork_and_exec.patch
Normal file
@ -0,0 +1,239 @@
|
||||
--- a/lib/util/become_daemon.c
|
||||
+++ b/lib/util/become_daemon.c
|
||||
@@ -53,7 +53,7 @@
|
||||
{
|
||||
pid_t newpid;
|
||||
if (do_fork) {
|
||||
- newpid = fork();
|
||||
+ newpid = -1;
|
||||
if (newpid == -1) {
|
||||
exit_daemon("Fork failed", errno);
|
||||
}
|
||||
--- a/lib/util/fault.c
|
||||
+++ b/lib/util/fault.c
|
||||
@@ -150,7 +150,7 @@
|
||||
}
|
||||
|
||||
DEBUG(0, ("smb_panic(): calling panic action [%s]\n", cmdstring));
|
||||
- result = system(cmdstring);
|
||||
+ result = -1;
|
||||
|
||||
if (result == -1)
|
||||
DEBUG(0, ("smb_panic(): fork failed in panic action: %s\n",
|
||||
--- a/lib/util/sys_popen.c
|
||||
+++ b/lib/util/sys_popen.c
|
||||
@@ -74,7 +74,7 @@
|
||||
goto err_exit;
|
||||
}
|
||||
|
||||
- entry->child_pid = fork();
|
||||
+ entry->child_pid = -1;
|
||||
|
||||
if (entry->child_pid == -1) {
|
||||
DBG_ERR("fork failed: %s\n", strerror(errno));
|
||||
@@ -105,7 +105,7 @@
|
||||
for (p = popen_chain; p; p = p->next)
|
||||
close(p->fd);
|
||||
|
||||
- ret = execv(argl[0], argl);
|
||||
+ ret = -1;
|
||||
if (ret == -1) {
|
||||
DBG_ERR("ERROR executing command "
|
||||
"'%s': %s\n", command, strerror(errno));
|
||||
--- a/lib/util/tfork.c
|
||||
+++ b/lib/util/tfork.c
|
||||
@@ -511,7 +511,7 @@
|
||||
ready_pipe_worker_fd = p[0];
|
||||
ready_pipe_caller_fd = p[1];
|
||||
|
||||
- pid = fork();
|
||||
+ pid = -1;
|
||||
if (pid == -1) {
|
||||
close(status_sp_caller_fd);
|
||||
close(status_sp_waiter_fd);
|
||||
@@ -580,7 +580,7 @@
|
||||
close(event_pipe_caller_fd);
|
||||
close(ready_pipe_caller_fd);
|
||||
|
||||
- pid = fork();
|
||||
+ pid = -1;
|
||||
if (pid == -1) {
|
||||
state->waiter_errno = errno;
|
||||
_exit(0);
|
||||
--- a/lib/util/util_runcmd.c
|
||||
+++ b/lib/util/util_runcmd.c
|
||||
@@ -261,7 +261,6 @@
|
||||
}
|
||||
va_end(ap);
|
||||
|
||||
- (void)execvp(state->arg0, argv);
|
||||
fprintf(stderr, "Failed to exec child - %s\n", strerror(errno));
|
||||
_exit(255);
|
||||
return NULL;
|
||||
--- a/source3/lib/background.c
|
||||
+++ b/source3/lib/background.c
|
||||
@@ -159,7 +159,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
- res = fork();
|
||||
+ res = -1;
|
||||
if (res == -1) {
|
||||
int err = errno;
|
||||
close(fds[0]);
|
||||
--- a/source3/lib/server_prefork.c
|
||||
+++ b/source3/lib/server_prefork.c
|
||||
@@ -109,7 +109,7 @@
|
||||
pfp->pool[i].allowed_clients = 1;
|
||||
pfp->pool[i].started = now;
|
||||
|
||||
- pid = fork();
|
||||
+ pid = -1;
|
||||
switch (pid) {
|
||||
case -1:
|
||||
DEBUG(1, ("Failed to prefork child n. %d !\n", i));
|
||||
@@ -199,7 +199,7 @@
|
||||
pfp->pool[i].allowed_clients = 1;
|
||||
pfp->pool[i].started = now;
|
||||
|
||||
- pid = fork();
|
||||
+ pid = -1;
|
||||
switch (pid) {
|
||||
case -1:
|
||||
DEBUG(1, ("Failed to prefork child n. %d !\n", j));
|
||||
--- a/source3/lib/smbrun.c
|
||||
+++ b/source3/lib/smbrun.c
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
saved_handler = CatchChildLeaveStatus();
|
||||
|
||||
- if ((pid=fork()) < 0) {
|
||||
+ if ((pid=-1) < 0) {
|
||||
DEBUG(0,("smbrun: fork failed with error %s\n", strerror(errno) ));
|
||||
(void)CatchSignal(SIGCLD, saved_handler);
|
||||
if (outfd) {
|
||||
@@ -193,15 +193,6 @@
|
||||
exit(82);
|
||||
}
|
||||
|
||||
- if (env != NULL) {
|
||||
- execle("/bin/sh","sh","-c",
|
||||
- newcmd ? (const char *)newcmd : cmd, NULL,
|
||||
- env);
|
||||
- } else {
|
||||
- execl("/bin/sh","sh","-c",
|
||||
- newcmd ? (const char *)newcmd : cmd, NULL);
|
||||
- }
|
||||
-
|
||||
SAFE_FREE(newcmd);
|
||||
}
|
||||
|
||||
@@ -263,7 +254,7 @@
|
||||
|
||||
saved_handler = CatchChildLeaveStatus();
|
||||
|
||||
- if ((pid=fork()) < 0) {
|
||||
+ if ((pid=-1) < 0) {
|
||||
DEBUG(0, ("smbrunsecret: fork failed with error %s\n", strerror(errno)));
|
||||
(void)CatchSignal(SIGCLD, saved_handler);
|
||||
return errno;
|
||||
@@ -346,8 +333,6 @@
|
||||
2 point to /dev/null from the startup code */
|
||||
closefrom(3);
|
||||
|
||||
- execl("/bin/sh", "sh", "-c", cmd, NULL);
|
||||
-
|
||||
/* not reached */
|
||||
exit(82);
|
||||
return 1;
|
||||
--- a/source3/lib/util.c
|
||||
+++ b/source3/lib/util.c
|
||||
@@ -695,7 +695,7 @@
|
||||
cmd = lp_panic_action(talloc_tos(), lp_sub);
|
||||
if (cmd && *cmd) {
|
||||
DEBUG(0, ("smb_panic(): calling panic action [%s]\n", cmd));
|
||||
- result = system(cmd);
|
||||
+ result = -1;
|
||||
|
||||
if (result == -1)
|
||||
DEBUG(0, ("smb_panic(): fork failed in panic action: %s\n",
|
||||
--- a/source4/heimdal/lib/roken/simple_exec.c
|
||||
+++ b/source4/heimdal/lib/roken/simple_exec.c
|
||||
@@ -155,7 +155,7 @@
|
||||
pipe(out_fd);
|
||||
if(stderr_fd != NULL)
|
||||
pipe(err_fd);
|
||||
- pid = fork();
|
||||
+ pid = -1;
|
||||
switch(pid) {
|
||||
case 0:
|
||||
va_start(ap, file);
|
||||
@@ -196,7 +196,6 @@
|
||||
|
||||
closefrom(3);
|
||||
|
||||
- execv(file, argv);
|
||||
exit((errno == ENOENT) ? EX_NOTFOUND : EX_NOEXEC);
|
||||
case -1:
|
||||
if(stdin_fd != NULL) {
|
||||
@@ -233,12 +232,11 @@
|
||||
simple_execvp_timed(const char *file, char *const args[],
|
||||
time_t (*func)(void *), void *ptr, time_t timeout)
|
||||
{
|
||||
- pid_t pid = fork();
|
||||
+ pid_t pid = -1;
|
||||
switch(pid){
|
||||
case -1:
|
||||
return SE_E_FORKFAILED;
|
||||
case 0:
|
||||
- execvp(file, args);
|
||||
exit((errno == ENOENT) ? EX_NOTFOUND : EX_NOEXEC);
|
||||
default:
|
||||
return wait_for_process_timed(pid, func, ptr, timeout);
|
||||
@@ -256,12 +254,11 @@
|
||||
simple_execve_timed(const char *file, char *const args[], char *const envp[],
|
||||
time_t (*func)(void *), void *ptr, time_t timeout)
|
||||
{
|
||||
- pid_t pid = fork();
|
||||
+ pid_t pid = -1;
|
||||
switch(pid){
|
||||
case -1:
|
||||
return SE_E_FORKFAILED;
|
||||
case 0:
|
||||
- execve(file, args, envp);
|
||||
exit((errno == ENOENT) ? EX_NOTFOUND : EX_NOEXEC);
|
||||
default:
|
||||
return wait_for_process_timed(pid, func, ptr, timeout);
|
||||
--- a/source4/libcli/resolve/dns_ex.c
|
||||
+++ b/source4/libcli/resolve/dns_ex.c
|
||||
@@ -620,7 +620,7 @@
|
||||
}
|
||||
tevent_fd_set_auto_close(state->fde);
|
||||
|
||||
- state->child = fork();
|
||||
+ state->child = -1;
|
||||
if (state->child == (pid_t)-1) {
|
||||
composite_error(c, map_nt_error_from_unix_common(errno));
|
||||
return c;
|
||||
--- a/tests/fcntl_lock.c
|
||||
+++ b/tests/fcntl_lock.c
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
alarm(10);
|
||||
|
||||
- if (!(pid=fork())) {
|
||||
+ if (!(pid=-1)) {
|
||||
sleep(2);
|
||||
fd = open(DATA, O_RDONLY);
|
||||
|
||||
--- a/third_party/popt/popt.c
|
||||
+++ b/third_party/popt/popt.c
|
||||
@@ -562,7 +562,7 @@
|
||||
#endif
|
||||
|
||||
/*@-nullstate@*/
|
||||
- rc = execvp(argv[0], (char *const *)argv);
|
||||
+ rc = -1;
|
||||
/*@=nullstate@*/
|
||||
|
||||
exit:
|
||||
@ -0,0 +1,10 @@
|
||||
--- a/lib/replace/replace.h
|
||||
+++ b/lib/replace/replace.h
|
||||
@@ -284,7 +284,6 @@
|
||||
|
||||
#if !defined(HAVE_DECL_ENVIRON)
|
||||
# ifdef __APPLE__
|
||||
-# include <crt_externs.h>
|
||||
# define environ (*_NSGetEnviron())
|
||||
# else /* __APPLE__ */
|
||||
extern char **environ;
|
||||
@ -0,0 +1,11 @@
|
||||
--- a/wscript
|
||||
+++ b/wscript
|
||||
@@ -191,7 +191,7 @@
|
||||
|
||||
conf.CHECK_CFG(package='zlib', minversion='1.2.3',
|
||||
args='--cflags --libs',
|
||||
- mandatory=True)
|
||||
+ mandatory=False)
|
||||
conf.CHECK_FUNCS_IN('inflateInit2', 'z')
|
||||
|
||||
if conf.CHECK_FOR_THIRD_PARTY():
|
||||
@ -0,0 +1,30 @@
|
||||
--- a/source3/libsmb/libsmb_stat.c
|
||||
+++ b/source3/libsmb/libsmb_stat.c
|
||||
@@ -29,6 +29,12 @@
|
||||
#include "../libcli/smb/smbXcli_base.h"
|
||||
#include "lib/util/time.h"
|
||||
|
||||
+#if defined(__APPLE__)
|
||||
+#define st_atim st_atimespec
|
||||
+#define st_ctim st_ctimespec
|
||||
+#define st_mtim st_mtimespec
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* Generate an inode number from file name for those things that need it
|
||||
*/
|
||||
--- a/source4/torture/libsmbclient/libsmbclient.c
|
||||
+++ b/source4/torture/libsmbclient/libsmbclient.c
|
||||
@@ -30,6 +30,12 @@
|
||||
#include "dynconfig.h"
|
||||
#include "lib/util/time.h"
|
||||
|
||||
+#if defined(__APPLE__)
|
||||
+#define st_atim st_atimespec
|
||||
+#define st_ctim st_ctimespec
|
||||
+#define st_mtim st_mtimespec
|
||||
+#endif
|
||||
+
|
||||
/* test string to compare with when debug_callback is called */
|
||||
#define TEST_STRING "smbc_setLogCallback test"
|
||||
|
||||
Reference in New Issue
Block a user