samba4: revert to 4.9.11

* revert to 4.9.x series (4.10 needs too many unofficial patches and has weird waf bugs)
* cleanup patches
* enable AD_DC build option again

Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
(cherry-picked from 2f2a4bccd9)
This commit is contained in:
Andy Walsh
2019-07-10 14:40:01 +02:00
committed by Rosen Penev
parent 8cfab80332
commit 8a20820a9b
7 changed files with 30 additions and 116 deletions
@@ -1,56 +0,0 @@
Some modules such as dynamic library maybe cann't be imported while cross compile,
we just check whether does the module exist.
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
--- a/buildtools/wafsamba/samba_bundled.py
+++ b/buildtools/wafsamba/samba_bundled.py
@@ -2,6 +2,7 @@
import sys
import Build, Options, Logs
+import imp, os
from Configure import conf
from samba_utils import TO_LIST
@@ -249,17 +250,32 @@ def CHECK_BUNDLED_SYSTEM_PYTHON(conf, li
# versions
minversion = minimum_library_version(conf, libname, minversion)
- try:
- m = __import__(modulename)
- except ImportError:
- found = False
- else:
+ # Find module in PYTHONPATH
+ stuff = imp.find_module(modulename, [os.environ["PYTHONPATH"]])
+ if stuff:
try:
- version = m.__version__
- except AttributeError:
+ m = imp.load_module(modulename, stuff[0], stuff[1], stuff[2])
+ except ImportError:
found = False
+
+ if conf.env.CROSS_COMPILE:
+ # Some modules such as dynamic library maybe cann't be imported
+ # while cross compile, we just check whether the module exist
+ Logs.warn('Cross module[%s] has been found, but can not be loaded.' % (stuff[1]))
+ found = True
else:
- found = tuplize_version(version) >= tuplize_version(minversion)
+ try:
+ version = m.__version__
+ except AttributeError:
+ found = False
+ else:
+ found = tuplize_version(version) >= tuplize_version(minversion)
+ finally:
+ if stuff[0]:
+ stuff[0].close()
+ else:
+ found = False
+
if not found and not conf.LIB_MAY_BE_BUNDLED(libname):
Logs.error('ERROR: Python module %s of version %s not found, and bundling disabled' % (libname, minversion))
sys.exit(1)
@@ -1,21 +0,0 @@
--- a/libcli/smbreadline/wscript_configure
+++ b/libcli/smbreadline/wscript_configure
@@ -1,11 +1,13 @@
#!/usr/bin/env python
-conf.CHECK_HEADERS('readline.h history.h readline/readline.h readline/history.h')
-for termlib in ['ncurses', 'curses', 'termcap', 'terminfo', 'termlib', 'tinfo']:
- if conf.CHECK_FUNCS_IN('tgetent', termlib):
- conf.env['READLINE_TERMLIB'] = termlib
- break
+#conf.CHECK_HEADERS('readline.h history.h readline/readline.h readline/history.h')
+#for termlib in ['ncurses', 'curses', 'termcap', 'terminfo', 'termlib', 'tinfo']:
+# if conf.CHECK_FUNCS_IN('tgetent', termlib):
+# conf.env['READLINE_TERMLIB'] = termlib
+# break
+
+conf.undefine('HAVE_READLINE_READLINE_H')
#
# Check if we need to work around readline/readline.h
@@ -0,0 +1,21 @@
--- a/source3/modules/vfs_fruit.c 2019-07-09
+++ b/source3/modules/vfs_fruit.c 2019-07-09
@@ -6995,12 +6995,12 @@ static bool fruit_tmsize_do_dirent(vfs_h
return true;
}
- if (bandsize > SIZE_MAX/nbands) {
- DBG_ERR("tmsize overflow: bandsize [%zu] nbands [%zu]\n",
- bandsize, nbands);
- return false;
- }
- tm_size = bandsize * nbands;
+ // if (bandsize > SIZE_MAX/nbands) {
+ // DBG_ERR("tmsize overflow: bandsize [%zu] nbands [%zu]\n",
+ // bandsize, nbands);
+ // return false;
+ // }
+ tm_size = (off_t)bandsize * (off_t)nbands;
if (state->total_size + tm_size < state->total_size) {
DBG_ERR("tmsize overflow: bandsize [%zu] nbands [%zu]\n",
@@ -1,32 +0,0 @@
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 14d7a797451..1982f128cb3 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -119,6 +119,18 @@ static struct global_fruit_config {
#define AFPRESOURCE_EA_NETATALK "user." NETATALK_RSRC_XATTR
#endif
+#ifndef OFF_T_MAX
+#if SIZEOF_OFF_T == SIZEOF_INT8_T
+#define OFF_T_MAX INT8_MAX
+#elif SIZEOF_OFF_T == SIZEOF_INT16_T
+#define OFF_T_MAX INT16_MAX
+#elif SIZEOF_OFF_T == SIZEOF_INT32_T
+#define OFF_T_MAX INT32_MAX
+#elif SIZEOF_OFF_T == SIZEOF_INT64_T
+#define OFF_T_MAX INT64_MAX
+#endif
+#endif
+
enum apple_fork {APPLE_FORK_DATA, APPLE_FORK_RSRC};
enum fruit_rsrc {FRUIT_RSRC_STREAM, FRUIT_RSRC_ADFILE, FRUIT_RSRC_XATTR};
@@ -6867,7 +6879,7 @@ static bool fruit_tmsize_do_dirent(vfs_handle_struct *handle,
return true;
}
- if (bandsize > SIZE_MAX/nbands) {
+ if (bandsize > OFF_T_MAX/nbands) {
DBG_ERR("tmsize overflow: bandsize [%zu] nbands [%zu]\n",
bandsize, nbands);
return false;