The branch, master has been updated
via 5a560ba4896 include <grp.h> for setgroups in a few places
via bf1e1387ea4 remove usage of bzero
via 712117155e0 replace direct calls to memset_s() with commonly used
macros
via 2b65de9b32c testparm: do not fail if /run/samba does not exist
via f2ddd2f306c Minimal EDNS0 support for built-in DNS client
via 4ecbdd689a9 passchange: error message fix
via 3831a7e2fd4 silence "Can not convert group sid" warnings in the log
via 05bf702f4a9 silence DNS lookup mismatch messages
via 6ba12c5dedf libsamba-errors: eliminate dependency on samba-debug
via bf239def4fa specify some deps on private libs actually used directly
from 2b2f06ee6eb Happy New Year 2025!
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 5a560ba4896c34eca1b4c473bb140e24da650307
Author: Michael Tokarev <[email protected]>
Date: Fri Nov 29 09:34:42 2024 +0300
include <grp.h> for setgroups in a few places
setgroups(), unlike getgroups(), is not in <unistd.h> but in <grp.h>.
Recent compilers require function declaration before using a function
(or more and more distributions treat lack of declaration as error),
so all configure-time tests fails with source3/lib/util_sec.c:
source3/../lib/util/setid.c: In function 'samba_setgroups':
source3/../lib/util/setid.c:244:16: error: implicit declaration of function
\
'setgroups'; did you mean 'getgroups'? [-Wimplicit-function-declaration]
244 | return setgroups(setlen, gidset);
Add the missing include so configuration finds the existing system
functions instead of failing.
Signed-off-by: Michael Tokarev <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
Reviewed-by: Pavel Filipenský <[email protected]>
Autobuild-User(master): Pavel Filipensky <[email protected]>
Autobuild-Date(master): Thu Jan 2 17:58:50 UTC 2025 on atb-devel-224
commit bf1e1387ea4a136d06029863eb63b3b1db1c7db0
Author: Michael Tokarev <[email protected]>
Date: Mon Nov 18 15:00:05 2024 +0300
remove usage of bzero
bzero() function has been deprecated for a long time.
In samba it is replaced with memset(). But samba also
provides common memory-zeroing macros, like ZERO_STRUCT().
In all places where bzero() is used, it actually meant to
zero a structure or an array.
So replace these bzero() calls with ZERO_STRUCT() or
ZERO_ARRAY() as appropriate, and remove bzero() replacement
and testing entirely.
While at it, also stop checking for presence of memset() -
this function is standard for a very long time, and the
only conditional where HAVE_MEMSET were used, was to
provide replacement for bzero() - in all other places
memset() is used unconditionally.
Signed-off-by: Michael Tokarev <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
Reviewed-by: Pavel Filipenský <[email protected]>
commit 712117155e0efae593d2867037c92741f2151252
Author: Michael Tokarev <[email protected]>
Date: Mon Nov 18 14:19:54 2024 +0300
replace direct calls to memset_s() with commonly used macros
samba provides macros for zeroing various structures in memory,
and all code uses them instead of relying on memset_s().
However, a few places use memset_s() directly. Replace these
usages with macros for consistency and to be able to replace
memset_s() easier.
A few notes.
Commit 03a50d8f7d872b6ef701d12 "lib:util: Check memset_s() error
code in talloc_keep_secret_destructor()" (Aug-2022) added a check
for error return from memset_s(). This is the only place in whole
codebase which bothers about doing this. But I've difficult time
figuring out the intention. Was there a real case when this code
path is actually executed?
Commit 7658c9bf0a9c99e3f200571 "lib:crypto: Remove redundant array
zeroing" (Nov-2023) removed the OTHER line from the two lines used
to zero memory in here. Initially the code used both memset_s()
*and* ZERO_ARRAY_LEN(), the former has been removed. This change
removes the other - memset_s(), reintroducing ZERO_ARRAY_LEN().
Here however, it's probably better to use BURN_PTR instead of
ZERO_ARRAY - in this place and a few lines above.
Commit 8dddea2ceda40f2365bd6b1 "lib:talloc: Use memset_s() to avoid
the call gets optimized out" (Feb-2024) is a recent commit which
introduces memset_s(). However, it does not seem like it makes
any difference whatsoever for a testsuite, or that it actually
needs to clean up the memory to begin with.
We've quite an assortment of all this memory zeroing stuff. Also
it is repeated in replace.h and memory.h (two sets in these files
are different but has big intersection). I'd say, to fix this mess,
things from replace.h should be removed in favour of memory.h, and
necessary includes added, but this is for the next time. We also
have lots of direct usages of memset_s() in heimdal code.
Cc: Joseph Sutton <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
Reviewed-by: Pavel Filipenský <[email protected]>
commit 2b65de9b32c888e4a6d09d806ff1be59cc33ff3b
Author: Michael Tokarev <[email protected]>
Date: Tue Apr 26 16:14:38 2022 +0300
testparm: do not fail if /run/samba does not exist
testparm explicitly fails if $piddir or $lockdir does not exist.
However, the daemons which actually use these directories, will
create it on demand, there is no need to fail even simple testparm
operations if the dirs are not there.
This change lets to (pre)configure samba without bothering to
pre-create the directories which are overwise needed only to fulfil
testparm criteria.
Signed-off-by: Michael Tokarev <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
Reviewed-by: Pavel Filipenský <[email protected]>
commit f2ddd2f306c17b52d948b47b64f12a928c6c98e6
Author: Michael Tokarev <[email protected]>
Date: Mon Feb 26 14:15:00 2024 +0300
Minimal EDNS0 support for built-in DNS client
Currently, samba built-in DNS client is UDP-only (it does
support TCP mode, but not all components use it). In
particular, when winbind queries list of AD DCs (SRV
record) which can be quite large, it uses UDP-only query.
And at the same time, samba DNS client does not support
EDNS0 at all, so the reply is limited to standard DNS
packet size which is 512 bytes.
Add minimal EDNS0 OPT record to ADDITIONAL section when
sending a DNS request out, indicating we can accept
DNS packets up to 4Kb in size.
Since DNSSEC is in wide use today and DNSSEC requires
EDNS0, it is okay to assume ENDS0 is widely supported
these days, so there should be no regressions when
enabling EDNS0.
Signed-off-by: Michael Tokarev <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
Reviewed-by: Pavel Filipenský <[email protected]>
commit 4ecbdd689a978491d5d0297d98de7ce4127f81ee
Author: Michael Tokarev <[email protected]>
Date: Mon Feb 26 15:35:35 2024 +0300
passchange: error message fix
Missing space and newline.
Signed-off-by: Michael Tokarev <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
Reviewed-by: Pavel Filipenský <[email protected]>
commit 3831a7e2fd41c3cba6d9c13f91582e8d8a3115c2
Author: Michael Tokarev <[email protected]>
Date: Wed Feb 14 15:26:29 2024 +0300
silence "Can not convert group sid" warnings in the log
/var/log/samba/log.winbind is full of messages like:
[2024/02/09 06:25:04.788182, 1, pid=74620]
source3/winbindd/winbindd_getgroups.c:259(winbindd_getgroups_recv)
Could not convert sid S-0-0: NT_STATUS_NONE_MAPPED
On a busy server these are logged several 1000s times per minute,
making any other messages basically invisible.
This is a work-around, a proper solution is to handle some
special SIDs (like this one) separately. Once this is done,
this change can be reverted.
Signed-off-by: Michael Tokarev <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
Reviewed-by: Pavel Filipenský <[email protected]>
commit 05bf702f4a9ce3c62c1fbbbb762bafa93d7dc6ea
Author: Michael Tokarev <[email protected]>
Date: Mon Dec 23 23:26:52 2024 +0300
silence DNS lookup mismatch messages
There's just too much useless noise in the logs,
especially when the PTR record just doesn't exist.
Signed-off-by: Michael Tokarev <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
Reviewed-by: Pavel Filipenský <[email protected]>
commit 6ba12c5dedfd34ad1e4390c7d0007b06ef418101
Author: Michael Tokarev <[email protected]>
Date: Mon Nov 18 12:45:08 2024 +0300
libsamba-errors: eliminate dependency on samba-debug
libsamba-errors is a collection of error codes/descriptions
like strerror(), - it is a set of simple functions converting
error code to string or the like. However, in one single
place there's a DBG_DEBUG() "call" in errmap_unix.c, in
map_errno_from_nt_status(), which is here for a very long time
(since before samba3, initially with debug level 10).
Drop this debugging info, and eliminate extra dependency.
This makes libsamba-errors independent and self-contained,
with a well-known and stable ABI.
Signed-off-by: Michael Tokarev <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
Reviewed-by: Pavel Filipenský <[email protected]>
commit bf239def4fa3e5782b4b14744a97561d49e3a25e
Author: Michael Tokarev <[email protected]>
Date: Thu May 19 20:37:21 2022 +0300
specify some deps on private libs actually used directly
Lots of samba libraries has incomplete dependencies listed
in wscript files. This usually is not a problem since the
link line includes dependencies of their dependencies of
their dependencies, and somewhere down that line all immediate
dependencies which are missing are actually present. But
sometimes this becomes a problem when a library does not
declare direct dependency on at least one private library
which it actually uses: in case no private library is
listed as direct dependency, private library directory is
not put into RUNPATH of the resulting binary, so the binary
can not find its own dependencies.
Fix a few such places, including some libraries which are
a part of public abi (libsmbldap, libndr).
Signed-off-by: Michael Tokarev <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
Reviewed-by: Pavel Filipenský <[email protected]>
-----------------------------------------------------------------------
Summary of changes:
ctdb/server/ctdb_statistics.c | 8 ++++----
ctdb/server/ipalloc_common.c | 2 +-
ctdb/tools/ctdb.c | 2 +-
lib/cmdline/cmdline.c | 2 +-
lib/crypto/gnutls_sp800_108.c | 2 +-
lib/param/wscript_build | 2 +-
lib/replace/README | 2 --
lib/replace/replace.h | 4 ----
lib/replace/tests/testsuite.c | 7 -------
lib/replace/wscript | 2 +-
lib/talloc/testsuite.c | 2 +-
lib/util/data_blob.c | 2 +-
lib/util/setid.c | 3 +++
lib/util/talloc_keep_secret.c | 15 +--------------
lib/util/wscript_build | 4 ++--
libcli/dns/dns.c | 11 ++++++++++-
libcli/util/errmap_unix.c | 3 ---
libcli/util/wscript_build | 2 +-
librpc/ndr/util.c | 2 +-
librpc/wscript_build | 1 +
python/samba/netcmd/testparm.py | 6 ++----
source3/lib/util_sec.c | 3 +++
source3/lib/util_sock.c | 10 +++++-----
source3/libsmb/passchange.c | 4 ++--
source3/utils/testparm.c | 6 ++----
source3/winbindd/winbindd_getgroups.c | 2 +-
source3/wscript_build | 4 ++--
source4/dsdb/samdb/ldb_modules/wscript_build_server | 4 ++--
source4/param/wscript_build | 2 +-
29 files changed, 51 insertions(+), 68 deletions(-)
Changeset truncated at 500 lines:
diff --git a/ctdb/server/ctdb_statistics.c b/ctdb/server/ctdb_statistics.c
index 4cf8f9e2726..d804c8511cd 100644
--- a/ctdb/server/ctdb_statistics.c
+++ b/ctdb/server/ctdb_statistics.c
@@ -42,7 +42,7 @@ static void ctdb_statistics_update(struct tevent_context *ev,
ctdb->statistics_history[0].statistics_current_time = timeval_current();
- bzero(&ctdb->statistics_current, sizeof(struct ctdb_statistics));
+ ZERO_STRUCT(ctdb->statistics_current);
ctdb->statistics_current.statistics_start_time = timeval_current();
tevent_add_timer(ctdb->ev, ctdb,
@@ -52,13 +52,13 @@ static void ctdb_statistics_update(struct tevent_context
*ev,
int ctdb_statistics_init(struct ctdb_context *ctdb)
{
- bzero(&ctdb->statistics, sizeof(struct ctdb_statistics));
+ ZERO_STRUCT(ctdb->statistics);
ctdb->statistics.statistics_start_time = timeval_current();
- bzero(&ctdb->statistics_current, sizeof(struct ctdb_statistics));
+ ZERO_STRUCT(ctdb->statistics_current);
ctdb->statistics_current.statistics_start_time = timeval_current();
- bzero(ctdb->statistics_history, sizeof(ctdb->statistics_history));
+ ZERO_ARRAY(ctdb->statistics_history);
tevent_add_timer(ctdb->ev, ctdb,
timeval_current_ofs(ctdb->tunable.stat_history_interval, 0),
diff --git a/ctdb/server/ipalloc_common.c b/ctdb/server/ipalloc_common.c
index a5177d41dc6..e9a9f8b8584 100644
--- a/ctdb/server/ipalloc_common.c
+++ b/ctdb/server/ipalloc_common.c
@@ -123,7 +123,7 @@ uint32_t *ip_key(ctdb_sock_addr *ip)
{
static uint32_t key[IP_KEYLEN];
- bzero(key, sizeof(key));
+ ZERO_ARRAY(key);
switch (ip->sa.sa_family) {
case AF_INET:
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index bf99e7bc526..44ab248391b 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -5597,7 +5597,7 @@ static int control_checktcpport(TALLOC_CTX *mem_ctx,
struct ctdb_context *ctdb,
return errno;
}
- bzero(&sin, sizeof(sin));
+ ZERO_STRUCT(sin);
sin.sin_family = AF_INET;
sin.sin_port = htons(port);
ret = bind(s, (struct sockaddr *)&sin, sizeof(sin));
diff --git a/lib/cmdline/cmdline.c b/lib/cmdline/cmdline.c
index a42707238f6..161ba8874bf 100644
--- a/lib/cmdline/cmdline.c
+++ b/lib/cmdline/cmdline.c
@@ -358,7 +358,7 @@ bool samba_cmdline_burn(int argc, char *argv[])
p += ulen;
}
- memset_s(p, strlen(p), '\0', strlen(p));
+ BURN_PTR_SIZE(p, strlen(p));
burnt = true;
}
}
diff --git a/lib/crypto/gnutls_sp800_108.c b/lib/crypto/gnutls_sp800_108.c
index fb0aa039213..a1af0cf7c60 100644
--- a/lib/crypto/gnutls_sp800_108.c
+++ b/lib/crypto/gnutls_sp800_108.c
@@ -223,7 +223,7 @@ out:
}
if (!NT_STATUS_IS_OK(status)) {
/* Hide the evidence. */
- memset_s(KO, KO_len, 0, KO_idx);
+ ZERO_ARRAY_LEN(KO, KO_idx);
}
return status;
diff --git a/lib/param/wscript_build b/lib/param/wscript_build
index 864975a5884..0ea874b9f6e 100644
--- a/lib/param/wscript_build
+++ b/lib/param/wscript_build
@@ -32,7 +32,7 @@ bld.SAMBA_GENERATOR('param_table_gen.c',
bld.SAMBA_LIBRARY('server-role',
source='loadparm_server_role.c',
- deps='samba-util samba-debug',
+ deps='samba-util time-basic samba-debug',
private_library=True)
bld.SAMBA_LIBRARY('samba-hostconfig',
diff --git a/lib/replace/README b/lib/replace/README
index 6612eabd22a..d9155aa7b99 100644
--- a/lib/replace/README
+++ b/lib/replace/README
@@ -40,7 +40,6 @@ dlclose
dlsym
dlerror
chroot
-bzero
strerror
errno
mkdtemp
@@ -123,6 +122,5 @@ Optional C keywords:
volatile
Prerequisites:
-memset (for bzero)
syslog (for vsyslog)
mktemp (for mkstemp and mkdtemp)
diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index b4bc1327824..4923e1f301d 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -414,10 +414,6 @@ int rep_ftruncate(int,off_t);
int rep_initgroups(char *name, gid_t id);
#endif
-#if !defined(HAVE_BZERO) && defined(HAVE_MEMSET)
-#define bzero(a,b) memset((a),'\0',(b))
-#endif
-
#ifndef HAVE_DLERROR
#define dlerror rep_dlerror
char *rep_dlerror(void);
diff --git a/lib/replace/tests/testsuite.c b/lib/replace/tests/testsuite.c
index 58624f11eb6..7c9195b4753 100644
--- a/lib/replace/tests/testsuite.c
+++ b/lib/replace/tests/testsuite.c
@@ -451,12 +451,6 @@ static int test_chroot(void)
return true;
}
-static int test_bzero(void)
-{
- /* FIXME: bzero */
- return true;
-}
-
static int test_strerror(void)
{
/* FIXME */
@@ -1200,7 +1194,6 @@ bool torture_local_replace(struct torture_context *ctx)
ret &= test_seekdir();
ret &= test_dlopen();
ret &= test_chroot();
- ret &= test_bzero();
ret &= test_strerror();
ret &= test_errno();
ret &= test_mkdtemp();
diff --git a/lib/replace/wscript b/lib/replace/wscript
index f5114b69ffc..9c0cb7047f1 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -397,7 +397,7 @@ def configure(conf):
msg='Checking for fallthrough attribute')
# these may be builtins, so we need the link=False strategy
- conf.CHECK_FUNCS('strdup memmem printf memset memcpy memmove strcpy
strncpy bzero', link=False)
+ conf.CHECK_FUNCS('strdup memmem printf memcpy memmove strcpy strncpy',
link=False)
# See https://bugzilla.samba.org/show_bug.cgi?id=1097
#
diff --git a/lib/talloc/testsuite.c b/lib/talloc/testsuite.c
index dc0039940ff..f9b98cf9cff 100644
--- a/lib/talloc/testsuite.c
+++ b/lib/talloc/testsuite.c
@@ -2149,7 +2149,7 @@ static bool test_magic_protection(void)
*
* Real attacks would attempt to set a real destructor.
*/
- memset_s(p1, 32, '\0', 32);
+ BURN_PTR_SIZE(p1, 32);
/* Then the attack takes effect when the memory's freed. */
talloc_free(pool);
diff --git a/lib/util/data_blob.c b/lib/util/data_blob.c
index 84e814f2ae8..9372612d8a3 100644
--- a/lib/util/data_blob.c
+++ b/lib/util/data_blob.c
@@ -95,7 +95,7 @@ clear a DATA_BLOB's contents
_PUBLIC_ void data_blob_clear(DATA_BLOB *d)
{
if (d->data) {
- memset_s(d->data, d->length, 0, d->length);
+ ZERO_ARRAY_LEN(d->data, d->length);
}
}
diff --git a/lib/util/setid.c b/lib/util/setid.c
index 6447909a5f3..a714e699f00 100644
--- a/lib/util/setid.c
+++ b/lib/util/setid.c
@@ -29,6 +29,9 @@
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
+#if defined(HAVE_GRP_H)
+#include <grp.h> /* setgroups() */
+#endif
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
diff --git a/lib/util/talloc_keep_secret.c b/lib/util/talloc_keep_secret.c
index 21048659e5d..eb5bb80ff37 100644
--- a/lib/util/talloc_keep_secret.c
+++ b/lib/util/talloc_keep_secret.c
@@ -22,26 +22,13 @@
static int talloc_keep_secret_destructor(void *ptr)
{
- int ret;
size_t size = talloc_get_size(ptr);
if (unlikely(size == 0)) {
return 0;
}
- ret = memset_s(ptr, size, 0, size);
- if (unlikely(ret != 0)) {
- char *msg = NULL;
- int ret2;
- ret2 = asprintf(&msg,
- "talloc_keep_secret_destructor: memset_s()
failed: %s",
- strerror(ret));
- if (ret2 != -1) {
- smb_panic(msg);
- } else {
- smb_panic("talloc_keep_secret_destructor: memset_s()
failed");
- }
- }
+ BURN_PTR_SIZE(ptr, size);
return 0;
}
diff --git a/lib/util/wscript_build b/lib/util/wscript_build
index 7de9c0b7b17..1eab2bb5805 100644
--- a/lib/util/wscript_build
+++ b/lib/util/wscript_build
@@ -243,7 +243,7 @@ else:
bld.SAMBA_LIBRARY('samba-modules',
source='modules.c',
- deps='samba-errors samba-util',
+ deps='samba-errors samba-util samba-debug',
local_include=False,
private_library=True)
@@ -283,7 +283,7 @@ else:
tevent_req_profile.c
''',
local_include=False,
- public_deps='tevent samba-errors',
+ public_deps='tevent time-basic samba-errors',
public_headers='tevent_ntstatus.h tevent_unix.h
tevent_werror.h',
header_path=[ ('*', 'util') ],
pc_files=[],
diff --git a/libcli/dns/dns.c b/libcli/dns/dns.c
index 943b4d5b33e..81144601bb8 100644
--- a/libcli/dns/dns.c
+++ b/libcli/dns/dns.c
@@ -422,6 +422,7 @@ struct tevent_req *dns_cli_request_send(TALLOC_CTX *mem_ctx,
struct dns_cli_request_state *state;
struct dns_name_question question;
struct dns_name_packet out_packet;
+ struct dns_res_rec edns0_opt;
enum ndr_err_code ndr_err;
req = tevent_req_create(mem_ctx, &state,
@@ -443,11 +444,19 @@ struct tevent_req *dns_cli_request_send(TALLOC_CTX
*mem_ctx,
.question_type = qtype, .question_class = qclass
};
+ edns0_opt = (struct dns_res_rec) {
+ .name = "",
+ .rr_type = DNS_QTYPE_OPT,
+ .rr_class = 4096 /* 4096 bytes UDP buffer size */
+ };
+
out_packet = (struct dns_name_packet) {
.id = state->req_id,
.operation = DNS_OPCODE_QUERY | DNS_FLAG_RECURSION_DESIRED,
.qdcount = 1,
- .questions = &question
+ .questions = &question,
+ .arcount = 1,
+ .additional = &edns0_opt
};
ndr_err = ndr_push_struct_blob(
diff --git a/libcli/util/errmap_unix.c b/libcli/util/errmap_unix.c
index 16c7b4916e7..60e570cca90 100644
--- a/libcli/util/errmap_unix.c
+++ b/libcli/util/errmap_unix.c
@@ -277,10 +277,7 @@ int map_errno_from_nt_status(NTSTATUS status)
{
size_t i;
- DBG_DEBUG("32 bit codes: code=%08x\n", NT_STATUS_V(status));
-
/* Status codes without this bit set are not errors */
-
if (!(NT_STATUS_V(status) & 0xc0000000)) {
return 0;
}
diff --git a/libcli/util/wscript_build b/libcli/util/wscript_build
index 64bd21e19ca..19c5d3bd24e 100644
--- a/libcli/util/wscript_build
+++ b/libcli/util/wscript_build
@@ -6,7 +6,7 @@ bld.SAMBA_LIBRARY('samba-errors',
private_headers='nterr_private.h',
header_path='core',
source='doserr.c errormap.c nterr.c errmap_unix.c hresult.c',
- public_deps='talloc samba-debug',
+ public_deps='talloc',
deps='gnutls',
# private_library=True,
pc_files=[],
diff --git a/librpc/ndr/util.c b/librpc/ndr/util.c
index 0eb7eba9e5e..472f44ace56 100644
--- a/librpc/ndr/util.c
+++ b/librpc/ndr/util.c
@@ -32,5 +32,5 @@ _PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print
*ndr, const char *name
_PUBLIC_ void ndr_zero_memory(void *ptr, size_t len)
{
- memset_s(ptr, len, 0, len);
+ ZERO_ARRAY_LEN(ptr, len);
}
diff --git a/librpc/wscript_build b/librpc/wscript_build
index a4cdfd9f508..dedba157d9f 100644
--- a/librpc/wscript_build
+++ b/librpc/wscript_build
@@ -672,6 +672,7 @@ bld.SAMBA_LIBRARY('ndr',
source='ndr/ndr_string.c ndr/ndr_basic.c ndr/uuid.c ndr/ndr.c
ndr/ndr_misc.c gen_ndr/ndr_misc.c ndr/util.c',
pc_files='ndr.pc',
public_deps='samba-errors talloc samba-util util_str_hex',
+ deps='genrand',
public_headers='gen_ndr/misc.h gen_ndr/ndr_misc.h ndr/libndr.h:ndr.h',
header_path= [('*gen_ndr*', 'gen_ndr')],
vnum='6.0.0',
diff --git a/python/samba/netcmd/testparm.py b/python/samba/netcmd/testparm.py
index a419ddf1260..6fbde635a7d 100644
--- a/python/samba/netcmd/testparm.py
+++ b/python/samba/netcmd/testparm.py
@@ -145,14 +145,12 @@ class cmd_testparm(Command):
lockdir = lp.get("lockdir")
if not os.path.isdir(lockdir):
- logger.error("lock directory %s does not exist", lockdir)
- valid = False
+ logger.warning("lock directory %s does not exist", lockdir)
piddir = lp.get("pid directory")
if not os.path.isdir(piddir):
- logger.error("pid directory %s does not exist", piddir)
- valid = False
+ logger.warning("pid directory %s does not exist", piddir)
winbind_separator = lp.get("winbind separator")
diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c
index ba6f109dcb7..2dab2855858 100644
--- a/source3/lib/util_sec.c
+++ b/source3/lib/util_sec.c
@@ -28,6 +28,9 @@
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
+#if defined(HAVE_GRP_H)
+#include <grp.h> /* setgroups() */
+#endif
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 5ff875c230d..5b4d7f12cef 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -709,10 +709,10 @@ static bool matchname(const char *remotehost,
if (ailist->ai_canonname == NULL ||
(!strequal(remotehost, ailist->ai_canonname) &&
!strequal(remotehost, "localhost"))) {
- DEBUG(0,("matchname: host name/name mismatch: %s != %s\n",
+ DBG_INFO("host name/name mismatch: %s != %s\n",
remotehost,
ailist->ai_canonname ?
- ailist->ai_canonname : "(NULL)"));
+ ailist->ai_canonname : "(NULL)");
freeaddrinfo(ailist);
return false;
}
@@ -735,12 +735,12 @@ static bool matchname(const char *remotehost,
* it, but that could be dangerous, too.
*/
- DEBUG(0,("matchname: host name/address mismatch: %s != %s\n",
+ DBG_INFO("host name/address mismatch: %s != %s\n",
print_sockaddr_len(addr_buf,
sizeof(addr_buf),
pss,
len),
- ailist->ai_canonname ? ailist->ai_canonname : "(NULL)"));
+ ailist->ai_canonname ? ailist->ai_canonname : "(NULL)");
if (ailist) {
freeaddrinfo(ailist);
@@ -891,7 +891,7 @@ int get_remote_hostname(const struct tsocket_address
*remote_address,
TALLOC_FREE(p);
} else {
if (!matchname(name_buf, (struct sockaddr *)&ss, len)) {
- DEBUG(0,("matchname failed on %s\n", name_buf));
+ DBG_INFO("failed on %s\n", name_buf);
strlcpy(name_buf, "UNKNOWN", sizeof(name_buf));
}
}
diff --git a/source3/libsmb/passchange.c b/source3/libsmb/passchange.c
index 16253eabff6..c4a82bfcd23 100644
--- a/source3/libsmb/passchange.c
+++ b/source3/libsmb/passchange.c
@@ -236,8 +236,8 @@ NTSTATUS remote_password_change(const char *remote_machine,
if (!NT_STATUS_IS_OK(result)) {
int rc = asprintf(
err_str,
- "machine %s rejected to change the password"
- "with error: %s",
+ "machine %s rejected to change the password "
+ "with error: %s\n",
remote_machine,
get_friendly_nt_error_msg(result));
if (rc <= 0) {
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index a31a7a8a30a..55c9bf1e076 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -420,9 +420,8 @@ static int do_global_checks(void)
}
if (!directory_exist_stat(lp_lock_directory(), &st)) {
- fprintf(stderr, "ERROR: lock directory %s does not exist\n\n",
+ fprintf(stderr, "WARNING: lock directory %s does not exist\n\n",
lp_lock_directory());
- ret = 1;
} else if ((st.st_ex_mode & 0777) != 0755) {
fprintf(stderr, "WARNING: lock directory %s should have "
"permissions 0755 for browsing to work\n\n",
@@ -450,9 +449,8 @@ static int do_global_checks(void)
}
if (!directory_exist_stat(lp_pid_directory(), &st)) {
- fprintf(stderr, "ERROR: pid directory %s does not exist\n\n",
+ fprintf(stderr, "WARNING: pid directory %s does not exist\n\n",
lp_pid_directory());
- ret = 1;
}
if (lp_passdb_expand_explicit()) {
diff --git a/source3/winbindd/winbindd_getgroups.c
b/source3/winbindd/winbindd_getgroups.c
index 5f901d62d53..6c71390ad9a 100644
--- a/source3/winbindd/winbindd_getgroups.c
+++ b/source3/winbindd/winbindd_getgroups.c
@@ -259,7 +259,7 @@ NTSTATUS winbindd_getgroups_recv(struct tevent_req *req,
if (tevent_req_is_nterror(req, &status)) {
struct dom_sid_buf buf;
- D_WARNING("Could not convert sid %s: %s\n",
+ D_DEBUG("Could not convert sid %s: %s\n",
dom_sid_str_buf(&state->sid, &buf),
nt_errstr(status));
return status;
diff --git a/source3/wscript_build b/source3/wscript_build
index 0c9f6ad3143..3ed3b550960 100644
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -192,7 +192,7 @@ bld.SAMBA3_LIBRARY('smbldaphelper',
passdb/pdb_ldap_schema.c
passdb/pdb_ldap_util.c
''',
- deps='smbldap secrets3',
+ deps='smbldap secrets3 samba-security samba3-util',
allow_undefined_symbols=True,
enabled=bld.CONFIG_SET('HAVE_LDAP'),
private_library=True)
@@ -500,7 +500,7 @@ bld.SAMBA3_LIBRARY('secrets3',
bld.SAMBA3_LIBRARY('smbldap',
source='lib/smbldap.c',
- deps='ldap lber samba-util smbconf',
+ deps='ldap lber samba-util smbconf samba-security genrand
smbd_shim',
enabled=bld.CONFIG_SET("HAVE_LDAP"),
private_library=False,
abi_directory='lib/ABI',
diff --git a/source4/dsdb/samdb/ldb_modules/wscript_build_server
b/source4/dsdb/samdb/ldb_modules/wscript_build_server
index 16d9b31a982..800ed2954c4 100644
--- a/source4/dsdb/samdb/ldb_modules/wscript_build_server
--
Samba Shared Repository