[SCM] Samba Shared Repository - branch master updated
Andreas Schneider
asn at samba.org
Fri Sep 27 09:07:01 UTC 2024
The branch, master has been updated
via 20a3a94e06a lib:ldb: Document environment variables in ldb manpage
via d6ff05cb570 lib:ldb: Remove trailing spaces from ldb.3.xml
via dc6927fdca2 lib:ldb: Don't use RTLD_DEEPBIND by default
via 8d6b5183770 lib:ldb: Remove trailing spaces from ldb_modules.c
via bad3fb0c2e3 s3:tests: Write stderr to file to be able to print it on failure
via 59e4ea91f2c s3:tests: Track the status of smbcquotas and not tr
from 91f0d7e1c91 s3:client: Improve error message on cli_setatr() failure
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 20a3a94e06a2294206ec233ccc7f873d6ef2aca0
Author: Andreas Schneider <asn at samba.org>
Date: Wed Sep 25 09:22:08 2024 +0200
lib:ldb: Document environment variables in ldb manpage
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15643
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Fri Sep 27 09:06:43 UTC 2024 on atb-devel-224
commit d6ff05cb5708fb6746176821bee5f713195efa54
Author: Andreas Schneider <asn at samba.org>
Date: Wed Sep 25 09:40:23 2024 +0200
lib:ldb: Remove trailing spaces from ldb.3.xml
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15643
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
commit dc6927fdca2ad77dbcf212ef4d3ba0d118ec7bdf
Author: Andreas Schneider <asn at samba.org>
Date: Wed Sep 25 09:19:44 2024 +0200
lib:ldb: Don't use RTLD_DEEPBIND by default
It should be off by default, as this is not needed by default. It
crashes named on startup, if bind is built with jemalloc support.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15643
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
commit 8d6b5183770895fef002b6cce84902d1874fa502
Author: Andreas Schneider <asn at samba.org>
Date: Wed Sep 25 09:19:17 2024 +0200
lib:ldb: Remove trailing spaces from ldb_modules.c
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15643
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
commit bad3fb0c2e307c4d54264c6fee49079854a90bf5
Author: Andreas Schneider <asn at samba.org>
Date: Wed Sep 25 07:59:04 2024 +0200
s3:tests: Write stderr to file to be able to print it on failure
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Signed-off-by: Martin Schwenke <mschwenke at ddn.com>
commit 59e4ea91f2c5b5360d20880bae4e87f122d388ee
Author: Andreas Schneider <asn at samba.org>
Date: Wed Sep 25 07:50:15 2024 +0200
s3:tests: Track the status of smbcquotas and not tr
Signed-off-by: Andreas Schneider <asn at samba.org>
Reviewed-by: Signed-off-by: Martin Schwenke <mschwenke at ddn.com>
-----------------------------------------------------------------------
Summary of changes:
lib/ldb/common/ldb_modules.c | 55 +++++++++++++-------------------
lib/ldb/man/ldb.3.xml | 23 ++++++++++++-
selftest/selftest.pl | 6 ----
selftest/wscript | 5 ++-
source3/script/tests/test_dfree_quota.sh | 11 +++++--
5 files changed, 56 insertions(+), 44 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/ldb/common/ldb_modules.c b/lib/ldb/common/ldb_modules.c
index b5627b0d04f..08d251f9bdd 100644
--- a/lib/ldb/common/ldb_modules.c
+++ b/lib/ldb/common/ldb_modules.c
@@ -631,9 +631,9 @@ int ldb_next_start_trans(struct ldb_module *module)
/* Set a default error string, to place the blame somewhere */
ldb_asprintf_errstring(module->ldb, "start_trans error in module %s: %s (%d)", module->ops->name, ldb_strerror(ret), ret);
}
- if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_next_start_trans error: %s",
- ldb_errstring(module->ldb));
+ if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_next_start_trans error: %s",
+ ldb_errstring(module->ldb));
}
return ret;
}
@@ -650,9 +650,9 @@ int ldb_next_end_trans(struct ldb_module *module)
/* Set a default error string, to place the blame somewhere */
ldb_asprintf_errstring(module->ldb, "end_trans error in module %s: %s (%d)", module->ops->name, ldb_strerror(ret), ret);
}
- if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_next_end_trans error: %s",
- ldb_errstring(module->ldb));
+ if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_next_end_trans error: %s",
+ ldb_errstring(module->ldb));
}
return ret;
}
@@ -720,9 +720,9 @@ int ldb_next_prepare_commit(struct ldb_module *module)
/* Set a default error string, to place the blame somewhere */
ldb_asprintf_errstring(module->ldb, "prepare_commit error in module %s: %s (%d)", module->ops->name, ldb_strerror(ret), ret);
}
- if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_next_prepare_commit error: %s",
- ldb_errstring(module->ldb));
+ if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_next_prepare_commit error: %s",
+ ldb_errstring(module->ldb));
}
return ret;
}
@@ -739,9 +739,9 @@ int ldb_next_del_trans(struct ldb_module *module)
/* Set a default error string, to place the blame somewhere */
ldb_asprintf_errstring(module->ldb, "del_trans error in module %s: %s (%d)", module->ops->name, ldb_strerror(ret), ret);
}
- if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_next_del_trans error: %s",
- ldb_errstring(module->ldb));
+ if ((module && module->ldb->flags & LDB_FLG_ENABLE_TRACING)) {
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "ldb_next_del_trans error: %s",
+ ldb_errstring(module->ldb));
}
return ret;
}
@@ -777,17 +777,17 @@ int ldb_module_send_entry(struct ldb_request *req,
req->handle->nesting == 0) {
char *s;
struct ldb_ldif ldif;
-
+
ldif.changetype = LDB_CHANGETYPE_NONE;
ldif.msg = discard_const_p(struct ldb_message, msg);
ldb_debug_add(req->handle->ldb, "ldb_trace_response: ENTRY\n");
- /*
+ /*
* The choice to call
* ldb_ldif_write_redacted_trace_string() is CRITICAL
* for security. It ensures that we do not output
- * passwords into debug logs
+ * passwords into debug logs
*/
s = ldb_ldif_write_redacted_trace_string(req->handle->ldb, msg, &ldif);
@@ -945,7 +945,7 @@ static int ldb_modules_load_path(const char *path, const char *version)
int dlopen_flags;
#ifdef RTLD_DEEPBIND
- bool deepbind_enabled = (getenv("LDB_MODULES_DISABLE_DEEPBIND") == NULL);
+ bool deepbind_enabled = (getenv("LDB_MODULES_ENABLE_DEEPBIND") != NULL);
#endif
ret = stat(path, &st);
@@ -981,21 +981,12 @@ static int ldb_modules_load_path(const char *path, const char *version)
dlopen_flags = RTLD_NOW;
#ifdef RTLD_DEEPBIND
/*
- * use deepbind if possible, to avoid issues with different
- * system library variants, for example ldb modules may be linked
- * against Heimdal while the application may use MIT kerberos.
- *
- * See the dlopen manpage for details.
- *
- * One typical user is the bind_dlz module of Samba,
- * but symbol versioning might be enough...
+ * On systems where e.g. different kerberos libraries are used, like a
+ * mix of Heimdal and MIT Kerberos, LDB_MODULES_ENABLE_DEEPBIND should
+ * be set to avoid issues.
*
- * We need a way to disable this in order to allow the
- * ldb_*ldap modules to work with a preloaded socket wrapper.
- *
- * So in future we may remove this completely
- * or at least invert the default behavior.
- */
+ * By default Linux distributions only have one Kerberos library.
+ */
if (deepbind_enabled) {
dlopen_flags |= RTLD_DEEPBIND;
}
@@ -1104,8 +1095,8 @@ static int ldb_modules_load_dir(const char *modules_dir, const char *version)
return LDB_SUCCESS;
}
-/*
- load any additional modules from the given directory
+/*
+ load any additional modules from the given directory
*/
void ldb_set_modules_dir(struct ldb_context *ldb, const char *path)
{
diff --git a/lib/ldb/man/ldb.3.xml b/lib/ldb/man/ldb.3.xml
index 1c0a2ece552..f8d3cb50446 100644
--- a/lib/ldb/man/ldb.3.xml
+++ b/lib/ldb/man/ldb.3.xml
@@ -243,11 +243,32 @@ ldb_search(3) manual pages.
</itemizedlist>
</refsect1>
+<refsect1>
+ <title>ENVIRONMENT VARIABLES</title>
+
+ <itemizedlist>
+ <listitem><para>
+ <envar>LDB_URL</envar>
+ - connect to the provided URL (cmdline tools only)
+ </para></listitem>
+
+ <listitem><para>
+ <envar>LDB_MODULES_PATH</envar>
+ - path where to load ldb modules from
+ </para></listitem>
+
+ <listitem><para>
+ <envar>LDB_MODULES_ENABLE_DEEPBIND</envar>
+ - enable RTLD_DEEPBIND when loading ldb modules
+ </para></listitem>
+ </itemizedlist>
+</refsect1>
+
<refsect1>
<title>Author</title>
<para>
- ldb was written by
+ ldb was written by
<ulink url="https://www.samba.org/~tridge/">Andrew Tridgell</ulink>.
</para>
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index 26b1663b5b6..a0c4ec80f59 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -433,12 +433,6 @@ $ENV{UID_WRAPPER} = 1;
# We are already hitting the limit, so double it.
$ENV{NSS_WRAPPER_MAX_HOSTENTS} = 200;
-# Disable RTLD_DEEPBIND hack for Samba bind dlz module
-#
-# This is needed in order to allow the ldb_*ldap module
-# to work with a preloaded socket wrapper.
-$ENV{LDB_MODULES_DISABLE_DEEPBIND} = 1;
-
my $socket_wrapper_dir;
if ($opt_socket_wrapper) {
$socket_wrapper_dir = SocketWrapper::setup_dir("$prefix_abs/w", $opt_socket_wrapper_pcap);
diff --git a/selftest/wscript b/selftest/wscript
index 52c34dcb88d..95e70706e63 100644
--- a/selftest/wscript
+++ b/selftest/wscript
@@ -333,9 +333,8 @@ def cmd_testonly(opt):
asan_options += ":suppressions=${srcdir}/selftest/sanitizer/asan.supp"
asan_options += " "
- # And we need to disable RTLD_DEEPBIND in ldb and socket wrapper
- no_leak_check = "LDB_MODULES_DISABLE_DEEPBIND=1 "
- no_leak_check += "SOCKET_WRAPPER_DISABLE_DEEP_BIND=1"
+ # We need to disable RTLD_DEEPBIND in socket wrapper
+ no_leak_check = "SOCKET_WRAPPER_DISABLE_DEEP_BIND=1"
no_leak_check += " "
env.CORE_COMMAND = asan_options + no_leak_check + env.CORE_COMMAND
diff --git a/source3/script/tests/test_dfree_quota.sh b/source3/script/tests/test_dfree_quota.sh
index 91510165029..8248edfd7a7 100755
--- a/source3/script/tests/test_dfree_quota.sh
+++ b/source3/script/tests/test_dfree_quota.sh
@@ -191,10 +191,14 @@ test_smbcquotas()
mproto="-m SMB1"
fi
- output=$($VALGRIND $smbcquotas $mproto //$SERVER/dfq "$@" 2>/dev/null | tr '\\' '/')
+ smbcquotas_stderr="$(mktemp "${PREFIX_ABS}/smbcquotas.XXXXXXXXXX")"
+
+ output=$($VALGRIND $smbcquotas $mproto //$SERVER/dfq "$@" 2>"${smbcquotas_stderr}")
status=$?
if [ "$status" = "0" ]; then
- received=$(echo "$output" | awk "/$SERVER\\/$user/ {printf \"%s%s%s\", \$3, \$4, \$5}")
+ rm "${smbcquotas_stderr}"
+
+ received=$(echo "$output" | tr '\\' '/' | awk "/$SERVER\\/$user/ {print \$3\$4\$5}")
if [ "$expected" = "$received" ]; then
subunit_pass_test "$name"
return 0
@@ -203,6 +207,9 @@ test_smbcquotas()
return 1
fi
else
+ cat "${smbcquotas_stderr}"
+ rm "${smbcquotas_stderr}"
+
echo "$output" | subunit_fail_test "$name"
return $status
fi
--
Samba Shared Repository
More information about the samba-cvs
mailing list