Commit cbe2391f authored by Mathieu Parent's avatar Mathieu Parent

New upstream version 1.4.3

parent 4cd41985
This diff is collapsed.
pyldb_Dn_FromDn: PyObject *(struct ldb_dn *)
pyldb_Object_AsDn: bool (TALLOC_CTX *, PyObject *, struct ldb_context *, struct ldb_dn **)
pyldb_Dn_FromDn: PyObject *(struct ldb_dn *)
pyldb_Object_AsDn: bool (TALLOC_CTX *, PyObject *, struct ldb_context *, struct ldb_dn **)
......@@ -192,10 +192,12 @@ def abi_write_vscript(f, libname, current_version, versions, symmap, abi_match):
f.write("\t\t%s;\n" % x)
else:
f.write("\t\t*;\n")
if abi_match != ["*"]:
f.write("\tlocal:\n")
for x in local_abi:
f.write("\t\t%s;\n" % x[1:])
# Always hide symbols that must be local if exist
local_abi.extend(["!_end", "!__bss_start", "!_edata"])
f.write("\tlocal:\n")
for x in local_abi:
f.write("\t\t%s;\n" % x[1:])
if global_abi != ["*"]:
if len(global_abi) > 0:
f.write("\t\t*;\n")
f.write("};\n")
......
......@@ -674,23 +674,42 @@ def SAMBA_CONFIG_H(conf, path=None):
return
# we need to build real code that can't be optimized away to test
if conf.check(fragment='''
#include <stdio.h>
int main(void)
{
char t[100000];
while (fgets(t, sizeof(t), stdin));
return 0;
}
''',
execute=0,
ccflags='-fstack-protector',
ldflags='-fstack-protector',
mandatory=False,
msg='Checking if toolchain accepts -fstack-protector'):
conf.ADD_CFLAGS('-fstack-protector')
conf.ADD_LDFLAGS('-fstack-protector')
stack_protect_list = ['-fstack-protector-strong', '-fstack-protector']
for stack_protect_flag in stack_protect_list:
flag_supported = conf.check(fragment='''
#include <stdio.h>
int main(void)
{
char t[100000];
while (fgets(t, sizeof(t), stdin));
return 0;
}
''',
execute=0,
ccflags=[ '-Werror', '-Wp,-D_FORTIFY_SOURCE=2', stack_protect_flag],
mandatory=False,
msg='Checking if compiler accepts %s' % (stack_protect_flag))
if flag_supported:
conf.ADD_CFLAGS('-Wp,-D_FORTIFY_SOURCE=2 %s' % (stack_protect_flag))
break
flag_supported = conf.check(fragment='''
#include <stdio.h>
int main(void)
{
char t[100000];
while (fgets(t, sizeof(t), stdin));
return 0;
}
''',
execute=0,
ccflags=[ '-Werror', '-fstack-clash-protection'],
mandatory=False,
msg='Checking if compiler accepts -fstack-clash-protection')
if flag_supported:
conf.ADD_CFLAGS('-fstack-clash-protection')
if Options.options.debug:
conf.ADD_CFLAGS('-g', testflags=True)
......
......@@ -467,6 +467,7 @@ def CHECK_MAKEFLAGS(bld):
if makeflags is None:
return
jobs_set = False
jobs = None
# we need to use shlex.split to cope with the escaping of spaces
# in makeflags
for opt in shlex.split(makeflags):
......@@ -489,17 +490,21 @@ def CHECK_MAKEFLAGS(bld):
setattr(Options.options, opt[0:loc], opt[loc+1:])
elif opt[0] != '-':
for v in opt:
if v == 'j':
if re.search(r'j[0-9]*$', v):
jobs_set = True
jobs = opt.strip('j')
elif v == 'k':
Options.options.keep = True
elif opt == '-j':
elif re.search(r'-j[0-9]*$', opt):
jobs_set = True
jobs = opt.strip('-j')
elif opt == '-k':
Options.options.keep = True
if not jobs_set:
# default to one job
Options.options.jobs = 1
elif jobs_set and jobs:
Options.options.jobs = int(jobs)
Build.BuildContext.CHECK_MAKEFLAGS = CHECK_MAKEFLAGS
......
......@@ -66,6 +66,10 @@ class WriteVscriptTests(TestCase):
1.0 {
\tglobal:
\t\t*;
\tlocal:
\t\t_end;
\t\t__bss_start;
\t\t_edata;
};
""")
......@@ -84,6 +88,10 @@ MYLIB_0.1 {
1.0 {
\tglobal:
\t\t*;
\tlocal:
\t\t_end;
\t\t__bss_start;
\t\t_edata;
};
""")
......@@ -99,6 +107,9 @@ MYLIB_0.1 {
\t\t*;
\tlocal:
\t\texc_*;
\t\t_end;
\t\t__bss_start;
\t\t_edata;
};
""")
......@@ -115,6 +126,9 @@ MYLIB_0.1 {
\t\tpub_*;
\tlocal:
\t\texc_*;
\t\t_end;
\t\t__bss_start;
\t\t_edata;
\t\t*;
};
""")
......@@ -170,6 +170,7 @@ static bool test_tevent_req_profile2(struct torture_context *tctx,
pid_t pid1, pid2;
enum tevent_req_state state1, state2;
uint64_t err1, err2;
char *printstring;
ssize_t pack_len;
int err;
bool ok;
......@@ -189,7 +190,12 @@ static bool test_tevent_req_profile2(struct torture_context *tctx,
TALLOC_FREE(req);
TALLOC_FREE(ev);
tevent_req_profile_print(p1, stdout, 0, UINT_MAX);
printstring = tevent_req_profile_string(tctx, p1, 0, UINT_MAX);
torture_assert_not_null(
tctx,
printstring,
"tevent_req_profile_string failed\n");
printf("%s\n", printstring);
pack_len = tevent_req_profile_pack(p1, NULL, 0);
torture_assert(tctx, pack_len>0, "profile_pack failed\n");
......@@ -212,7 +218,12 @@ static bool test_tevent_req_profile2(struct torture_context *tctx,
"profile_unpack failed\n");
}
tevent_req_profile_print(p2, stdout, 0, UINT_MAX);
printstring = tevent_req_profile_string(tctx, p2, 0, UINT_MAX);
torture_assert_not_null(
tctx,
printstring,
"tevent_req_profile_string failed\n");
printf("%s\n", printstring);
tevent_req_profile_get_name(p1, &str1);
tevent_req_profile_get_name(p2, &str2);
......
......@@ -857,22 +857,22 @@ static PySequenceMethods py_ldb_dn_seq = {
static PyObject *py_ldb_dn_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
struct ldb_dn *ret;
char *str;
PyObject *py_ldb;
struct ldb_context *ldb_ctx;
TALLOC_CTX *mem_ctx;
PyLdbDnObject *py_ret;
struct ldb_dn *ret = NULL;
char *str = NULL;
PyObject *py_ldb = NULL;
struct ldb_context *ldb_ctx = NULL;
TALLOC_CTX *mem_ctx = NULL;
PyLdbDnObject *py_ret = NULL;
const char * const kwnames[] = { "ldb", "dn", NULL };
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Os",
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Oes",
discard_const_p(char *, kwnames),
&py_ldb, &str))
return NULL;
&py_ldb, "utf8", &str))
goto out;
if (!PyLdb_Check(py_ldb)) {
PyErr_SetString(PyExc_TypeError, "Expected Ldb");
return NULL;
goto out;
}
ldb_ctx = pyldb_Ldb_AsLdbContext(py_ldb);
......@@ -880,24 +880,28 @@ static PyObject *py_ldb_dn_new(PyTypeObject *type, PyObject *args, PyObject *kwa
mem_ctx = talloc_new(NULL);
if (mem_ctx == NULL) {
PyErr_NoMemory();
return NULL;
goto out;
}
ret = ldb_dn_new(mem_ctx, ldb_ctx, str);
if (!ldb_dn_validate(ret)) {
talloc_free(mem_ctx);
PyErr_SetString(PyExc_ValueError, "unable to parse dn string");
return NULL;
goto out;
}
py_ret = (PyLdbDnObject *)type->tp_alloc(type, 0);
if (ret == NULL) {
if (py_ret == NULL) {
talloc_free(mem_ctx);
PyErr_NoMemory();
return NULL;
goto out;
}
py_ret->mem_ctx = mem_ctx;
py_ret->dn = ret;
out:
if (str != NULL) {
PyMem_Free(discard_const_p(char, str));
}
return (PyObject *)py_ret;
}
......
......@@ -137,6 +137,10 @@ class SimpleLdb(LdbBaseTest):
l = ldb.Ldb(self.url(), flags=self.flags())
self.assertEqual(len(l.search(controls=["paged_results:0:5"])), 0)
def test_utf8_ldb_Dn(self):
l = ldb.Ldb(self.url(), flags=self.flags())
dn = ldb.Dn(l, (b'a=' + b'\xc4\x85\xc4\x87\xc4\x99\xc5\x82\xc5\x84\xc3\xb3\xc5\x9b\xc5\xba\xc5\xbc').decode('utf8'))
def test_search_attrs(self):
l = ldb.Ldb(self.url(), flags=self.flags())
self.assertEqual(len(l.search(ldb.Dn(l, ""), ldb.SCOPE_SUBTREE, "(dc=*)", ["dc"])), 0)
......
#!/usr/bin/env python
APPNAME = 'ldb'
VERSION = '1.4.2'
VERSION = '1.4.3'
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