[SCM] Samba Shared Repository - branch master updated

2018-01-22 Thread Martin Schwenke
The branch, master has been updated
   via  9daf40c talloc: Fix documentation typo
   via  33c0f55 ctdb-tests: Avoid race condition in sock_daemon test 5
  from  ac9d528 docs: Remove prog_guide4.txt

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit 9daf40c55af61081abca663c7250f103d5b2a0df
Author: Martin Schwenke 
Date:   Thu Jan 18 16:08:15 2018 +1100

talloc: Fix documentation typo

Signed-off-by: Martin Schwenke 
Reviewed-by: Amitay Isaacs 

Autobuild-User(master): Martin Schwenke 
Autobuild-Date(master): Mon Jan 22 11:11:38 CET 2018 on sn-devel-144

commit 33c0f5599d93a34619c8f37945f79a6e399a1b5e
Author: Amitay Isaacs 
Date:   Mon Jan 22 12:54:49 2018 +1100

ctdb-tests: Avoid race condition in sock_daemon test 5

This test fails when it takes more than 10s to run.  This can occur
when the system is loaded and socket-wrapper is used.

Signed-off-by: Amitay Isaacs 
Reviewed-by: Martin Schwenke 

---

Summary of changes:
 ctdb/tests/src/sock_daemon_test.c | 26 +-
 lib/talloc/talloc.h   |  2 +-
 2 files changed, 18 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/tests/src/sock_daemon_test.c 
b/ctdb/tests/src/sock_daemon_test.c
index 5641d37..ebc0b85 100644
--- a/ctdb/tests/src/sock_daemon_test.c
+++ b/ctdb/tests/src/sock_daemon_test.c
@@ -668,7 +668,8 @@ static void test4(TALLOC_CTX *mem_ctx, const char *pidfile,
  * Start daemon, multiple client connects, requests, disconnects
  */
 
-#define TEST5_MAX_CLIENTS  10
+#define TEST5_VALID_CLIENTS10
+#define TEST5_MAX_CLIENTS  100
 
 struct test5_pkt {
uint32_t len;
@@ -710,7 +711,8 @@ static void test5_client_callback(uint8_t *buf, size_t 
buflen,
state->done = true;
 }
 
-static int test5_client(const char *sockpath, int id)
+static int test5_client(const char *sockpath, int id, pid_t pid_server,
+   pid_t *client_pid)
 {
pid_t pid;
int fd[2];
@@ -760,7 +762,9 @@ static int test5_client(const char *sockpath, int id)
close(fd[0]);
state.fd = -1;
 
-   sleep(10);
+   while (kill(pid_server, 0) == 0 || errno != ESRCH) {
+   sleep(1);
+   }
exit(0);
}
 
@@ -775,6 +779,7 @@ static int test5_client(const char *sockpath, int id)
 
close(fd[0]);
 
+   *client_pid = pid;
return ret;
 }
 
@@ -788,12 +793,12 @@ static bool test5_connect(struct sock_client_context 
*client,
struct test5_server_state *state =
(struct test5_server_state *)private_data;
 
-   if (state->num_clients == TEST5_MAX_CLIENTS) {
+   if (state->num_clients == TEST5_VALID_CLIENTS) {
return false;
}
 
state->num_clients += 1;
-   assert(state->num_clients <= TEST5_MAX_CLIENTS);
+   assert(state->num_clients <= TEST5_VALID_CLIENTS);
return true;
 }
 
@@ -925,6 +930,7 @@ static void test5(TALLOC_CTX *mem_ctx, const char *pidfile,
pid_t pid_server, pid;
int fd[2], ret, i;
ssize_t n;
+   pid_t client_pid[TEST5_MAX_CLIENTS];
 
pid = getpid();
 
@@ -968,16 +974,18 @@ static void test5(TALLOC_CTX *mem_ctx, const char 
*pidfile,
 
close(fd[0]);
 
-   for (i=0; i<100; i++) {
-   ret = test5_client(sockpath, i);
-   if (i < TEST5_MAX_CLIENTS) {
+   for (i=0; i=0; i--) {
+   kill(client_pid[i], SIGKILL);
+
pid = wait();
assert(pid != -1);
}
diff --git a/lib/talloc/talloc.h b/lib/talloc/talloc.h
index 618430a..dda308d 100644
--- a/lib/talloc/talloc.h
+++ b/lib/talloc/talloc.h
@@ -1226,7 +1226,7 @@ size_t talloc_array_length(const void *ctx);
  *
  * @code
  * ptr = talloc_array(ctx, type, count);
- * if (ptr) memset(ptr, sizeof(type) * count);
+ * if (ptr) memset(ptr, 0, sizeof(type) * count);
  * @endcode
  */
 void *talloc_zero_array(const void *ctx, #type, unsigned count);


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch v4-7-test updated

2018-01-22 Thread Karolin Seeger
The branch, v4-7-test has been updated
   via  bde3d64 vfs_default: use VFS statvfs macro in fs_capabilities
   via  da6ee0c vfs_ceph: add fs_capabilities hook to avoid local statvfs
  from  d251dcc selftest: allow more time for tests

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-7-test


- Log -
commit bde3d6402e6424015089fe3a2887c72eee45144f
Author: David Disseldorp 
Date:   Wed Jan 10 14:03:09 2018 +0100

vfs_default: use VFS statvfs macro in fs_capabilities

Currently the vfs_default fs_capabilities handler calls statvfs
directly, rather than calling the vfs macro. This behaviour may cause
issues for VFS modules that delegate fs_capabilities handling to
vfs_default but offer their own statvfs hook.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13208

Signed-off-by: David Disseldorp 
Reviewed-by: Jeremy Allison 
(cherry picked from commit 4b25c9f4a4d336a16894452862ea059701b025de)

Autobuild-User(v4-7-test): Karolin Seeger 
Autobuild-Date(v4-7-test): Mon Jan 22 13:48:30 CET 2018 on sn-devel-144

commit da6ee0cf34af010d0796abddd06c83887e61c88e
Author: David Disseldorp 
Date:   Wed Jan 10 01:37:14 2018 +0100

vfs_ceph: add fs_capabilities hook to avoid local statvfs

Adding the fs_capabilities() hook to the CephFS VFS module avoids
fallback to the vfs_default code-path, which calls statvfs() against the
share path on the *local* filesystem.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13208

Signed-off-by: David Disseldorp 
Reviewed-by: Jeremy Allison 
(cherry picked from commit 2724e0cac29cd1632ea28075a740fcc888affb36)

---

Summary of changes:
 source3/modules/vfs_ceph.c| 15 +++
 source3/modules/vfs_default.c | 14 +++---
 2 files changed, 22 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index 9abd321..f482a8b 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -270,6 +270,20 @@ static int cephwrap_statvfs(struct vfs_handle_struct 
*handle,
return ret;
 }
 
+static uint32_t cephwrap_fs_capabilities(struct vfs_handle_struct *handle,
+enum timestamp_set_resolution 
*p_ts_res)
+{
+   uint32_t caps = FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
+
+#ifdef HAVE_CEPH_STATX
+   *p_ts_res = TIMESTAMP_SET_NT_OR_BETTER;
+#else
+   *p_ts_res = TIMESTAMP_SET_MSEC;
+#endif
+
+   return caps;
+}
+
 /* Directory operations */
 
 static DIR *cephwrap_opendir(struct vfs_handle_struct *handle,
@@ -1399,6 +1413,7 @@ static struct vfs_fn_pointers ceph_fns = {
.get_quota_fn = cephwrap_get_quota,
.set_quota_fn = cephwrap_set_quota,
.statvfs_fn = cephwrap_statvfs,
+   .fs_capabilities_fn = cephwrap_fs_capabilities,
 
/* Directory operations */
 
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 53d9785..6686303 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -129,8 +129,14 @@ static uint32_t vfswrap_fs_capabilities(struct 
vfs_handle_struct *handle,
struct vfs_statvfs_struct statbuf;
int ret;
 
+   smb_fname_cpath = synthetic_smb_fname(talloc_tos(), conn->connectpath,
+ NULL, NULL, 0);
+   if (smb_fname_cpath == NULL) {
+   return caps;
+   }
+
ZERO_STRUCT(statbuf);
-   ret = sys_statvfs(conn->connectpath, );
+   ret = SMB_VFS_STATVFS(conn, smb_fname_cpath, );
if (ret == 0) {
caps = statbuf.FsCapabilities;
}
@@ -140,12 +146,6 @@ static uint32_t vfswrap_fs_capabilities(struct 
vfs_handle_struct *handle,
/* Work out what timestamp resolution we can
 * use when setting a timestamp. */
 
-   smb_fname_cpath = synthetic_smb_fname(talloc_tos(), conn->connectpath,
- NULL, NULL, 0);
-   if (smb_fname_cpath == NULL) {
-   return caps;
-   }
-
ret = SMB_VFS_STAT(conn, smb_fname_cpath);
if (ret == -1) {
TALLOC_FREE(smb_fname_cpath);


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch v4-6-test updated

2018-01-22 Thread Karolin Seeger
The branch, v4-6-test has been updated
   via  21d0446 vfs_default: use VFS statvfs macro in fs_capabilities
   via  a6b780c vfs_ceph: add fs_capabilities hook to avoid local statvfs
  from  579b6a4 s3: smbd: Use identical logic to test for kernel oplocks on 
a share.

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-6-test


- Log -
commit 21d0446c4811f2f066b549232ddd27b353a8c633
Author: David Disseldorp 
Date:   Wed Jan 10 14:03:09 2018 +0100

vfs_default: use VFS statvfs macro in fs_capabilities

Currently the vfs_default fs_capabilities handler calls statvfs
directly, rather than calling the vfs macro. This behaviour may cause
issues for VFS modules that delegate fs_capabilities handling to
vfs_default but offer their own statvfs hook.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13208

Signed-off-by: David Disseldorp 
Reviewed-by: Jeremy Allison 
(cherry picked from commit 4b25c9f4a4d336a16894452862ea059701b025de)

Autobuild-User(v4-6-test): Karolin Seeger 
Autobuild-Date(v4-6-test): Mon Jan 22 13:14:03 CET 2018 on sn-devel-144

commit a6b780c52b251505e50607d6f77f57330b830b00
Author: David Disseldorp 
Date:   Wed Jan 10 01:37:14 2018 +0100

vfs_ceph: add fs_capabilities hook to avoid local statvfs

Adding the fs_capabilities() hook to the CephFS VFS module avoids
fallback to the vfs_default code-path, which calls statvfs() against the
share path on the *local* filesystem.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13208

Signed-off-by: David Disseldorp 
Reviewed-by: Jeremy Allison 
(cherry picked from commit 2724e0cac29cd1632ea28075a740fcc888affb36)

---

Summary of changes:
 source3/modules/vfs_ceph.c| 15 +++
 source3/modules/vfs_default.c | 14 +++---
 2 files changed, 22 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index e3d22bf..2842647 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -251,6 +251,20 @@ static int cephwrap_statvfs(struct vfs_handle_struct 
*handle,  const char *path,
return ret;
 }
 
+static uint32_t cephwrap_fs_capabilities(struct vfs_handle_struct *handle,
+enum timestamp_set_resolution 
*p_ts_res)
+{
+   uint32_t caps = FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
+
+#ifdef HAVE_CEPH_STATX
+   *p_ts_res = TIMESTAMP_SET_NT_OR_BETTER;
+#else
+   *p_ts_res = TIMESTAMP_SET_MSEC;
+#endif
+
+   return caps;
+}
+
 /* Directory operations */
 
 static DIR *cephwrap_opendir(struct vfs_handle_struct *handle,
@@ -1339,6 +1353,7 @@ static struct vfs_fn_pointers ceph_fns = {
.get_quota_fn = cephwrap_get_quota,
.set_quota_fn = cephwrap_set_quota,
.statvfs_fn = cephwrap_statvfs,
+   .fs_capabilities_fn = cephwrap_fs_capabilities,
 
/* Directory operations */
 
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index ce1b6e2..4889591 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -121,8 +121,14 @@ static uint32_t vfswrap_fs_capabilities(struct 
vfs_handle_struct *handle,
struct vfs_statvfs_struct statbuf;
int ret;
 
+   smb_fname_cpath = synthetic_smb_fname(talloc_tos(), conn->connectpath,
+ NULL, NULL, 0);
+   if (smb_fname_cpath == NULL) {
+   return caps;
+   }
+
ZERO_STRUCT(statbuf);
-   ret = sys_statvfs(conn->connectpath, );
+   ret = SMB_VFS_STATVFS(conn, conn->connectpath, );
if (ret == 0) {
caps = statbuf.FsCapabilities;
}
@@ -132,12 +138,6 @@ static uint32_t vfswrap_fs_capabilities(struct 
vfs_handle_struct *handle,
/* Work out what timestamp resolution we can
 * use when setting a timestamp. */
 
-   smb_fname_cpath = synthetic_smb_fname(talloc_tos(), conn->connectpath,
- NULL, NULL, 0);
-   if (smb_fname_cpath == NULL) {
-   return caps;
-   }
-
ret = SMB_VFS_STAT(conn, smb_fname_cpath);
if (ret == -1) {
TALLOC_FREE(smb_fname_cpath);


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2018-01-22 Thread Jeremy Allison
The branch, master has been updated
   via  c57cce1 libcli/resolve: Make functions static
   via  30ff05c libcli/resolve: Make functions static
   via  ca3745d libcli/resolve: Fix typos
   via  8993342 dsgetdcname: Fix a signed/unsigned hickup
   via  0050d1b libnmb: Fix two signed/unsigned hickups
   via  e4dc85b libnmb: tsocket_address_unix_from_path deals fine with NULL
   via  e8e09d7 libnmb: Remove a pointless struct member
   via  c404d58 libsmb: Give unexpected.c its own header
  from  39a6ea7 waf: Fix NFS quota support with libtirpc

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit c57cce1b973ec3a6ffd1a230fccaaa02c28c9e04
Author: Volker Lendecke 
Date:   Sat Jan 13 17:41:01 2018 +0100

libcli/resolve: Make functions static

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

Autobuild-User(master): Jeremy Allison 
Autobuild-Date(master): Tue Jan 23 06:36:36 CET 2018 on sn-devel-144

commit 30ff05c660d07eee0ec4d190734438d068c6337c
Author: Volker Lendecke 
Date:   Sat Jan 13 17:39:24 2018 +0100

libcli/resolve: Make functions static

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

commit ca3745db305a14713ab2a709968379fbf332d015
Author: Volker Lendecke 
Date:   Sat Jan 13 17:38:16 2018 +0100

libcli/resolve: Fix typos

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

commit 8993342965987c58bc16baf9680c6fb9f2d11286
Author: Volker Lendecke 
Date:   Fri Jan 5 17:11:43 2018 +0100

dsgetdcname: Fix a signed/unsigned hickup

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

commit 0050d1b9a73cdff455d8a93f6aed6dbb964be096
Author: Volker Lendecke 
Date:   Thu Jan 18 13:28:30 2018 +0100

libnmb: Fix two signed/unsigned hickups

Two warnings less

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

commit e4dc85b69c2a57e99156d7cd60e84ff6c550fb52
Author: Volker Lendecke 
Date:   Tue Jan 16 15:04:06 2018 +0100

libnmb: tsocket_address_unix_from_path deals fine with NULL

Other callers use NULL instead of "". Streamline it a bit

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

commit e8e09d72ce780a9462d164d7e97a379bfc951980
Author: Volker Lendecke 
Date:   Tue Jan 16 15:07:47 2018 +0100

libnmb: Remove a pointless struct member

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

commit c404d58830758bde11499bc1771070e76c6eecfe
Author: Volker Lendecke 
Date:   Mon Jan 15 16:12:15 2018 +0100

libsmb: Give unexpected.c its own header

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

---

Summary of changes:
 source3/libsmb/clidgram.c|  1 +
 source3/libsmb/dsgetdcname.c |  3 ++-
 source3/libsmb/namequery.c   |  1 +
 source3/libsmb/nmblib.h  | 22 --
 source3/libsmb/unexpected.c  | 19 
 source3/libsmb/unexpected.h  | 49 
 source3/nmbd/nmbd_packets.c  |  1 +
 source4/libcli/resolve/bcast.c   | 19 
 source4/libcli/resolve/lmhosts.c | 23 ++-
 9 files changed, 86 insertions(+), 52 deletions(-)
 create mode 100644 source3/libsmb/unexpected.h


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/clidgram.c b/source3/libsmb/clidgram.c
index d8fa1c6..8f0dba3 100644
--- a/source3/libsmb/clidgram.c
+++ b/source3/libsmb/clidgram.c
@@ -24,6 +24,7 @@
 #include "../lib/util/tevent_ntstatus.h"
 #include "libsmb/clidgram.h"
 #include "libsmb/nmblib.h"
+#include "libsmb/unexpected.h"
 #include "messages.h"
 #include "librpc/gen_ndr/samr.h"
 #include "../lib/util/pidfile.h"
diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c
index ce0cc89..f15456a 100644
--- a/source3/libsmb/dsgetdcname.c
+++ b/source3/libsmb/dsgetdcname.c
@@ -500,7 +500,8 @@ static NTSTATUS discover_dc_dns(TALLOC_CTX *mem_ctx,
struct ip_service_name **returned_dclist,
int *return_count)
 {
-   int i, j;
+   int i;
+   size_t j;
NTSTATUS status;
struct dns_rr_srv *dcs = NULL;
int numdcs = 0;
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c
index 4b41546..6107e8f 100644
--- a/source3/libsmb/namequery.c
+++ b/source3/libsmb/namequery.c
@@ -26,6 +26,7 @@
 

[SCM] Samba Shared Repository - branch master updated

2018-01-22 Thread Andreas Schneider
The branch, master has been updated
   via  39a6ea7 waf: Fix NFS quota support with libtirpc
   via  87f105d wafsamba: Allow passing 'lib' to CHECK_STRUCTURE_MEMBER
   via  ee0be7e build: deal with recent glibc sunrpc header removal
   via  c29d087 include: Create system/nis.h in libreplace
   via  ca5eaf0 s3:waf: Move HAVE_NETGROUP to wscript
   via  850a802 dbcheck: disable fixing duplicate linked attributes until 
we can recover lost forward links
   via  a25c99c repl_meta_data: fix linked attribute corruption on 
databases with unsorted links on expunge
   via  c34c2dd testprogs:blackbox: add regression test for unsorted links 
in tombstones-expunge.sh
  from  9daf40c talloc: Fix documentation typo

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit 39a6ea766dfe55d84ab2284b8d5ed01d66da11dd
Author: Andreas Schneider 
Date:   Fri Jan 19 14:30:20 2018 +0100

waf: Fix NFS quota support with libtirpc

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238

Signed-off-by: Andreas Schneider 
Reviewed-by: Alexander Bokovoy 

Autobuild-User(master): Andreas Schneider 
Autobuild-Date(master): Mon Jan 22 17:26:52 CET 2018 on sn-devel-144

commit 87f105d76ce074bff08fd507d72568be88d48d00
Author: Andreas Schneider 
Date:   Fri Jan 19 15:34:32 2018 +0100

wafsamba: Allow passing 'lib' to CHECK_STRUCTURE_MEMBER

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238

We need to be able to point it to the right header location, so we need
to be able to pass the 'lib' that it gets set.

Signed-off-by: Andreas Schneider 
Reviewed-by: Alexander Bokovoy 

commit ee0be7eb723be1420fd601ea1abe0af748562953
Author: Günther Deschner 
Date:   Tue Jan 16 17:48:10 2018 +0100

build: deal with recent glibc sunrpc header removal

We need to rely on libtirpc or libntirpc to be around in that case.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10976

Guenther

Pair-Programmed-With: Andreas Schneider 

Signed-off-by: Guenther Deschner 
Signed-off-by: Andreas Schneider 
Reviewed-by: Alexander Bokovoy 

commit c29d087e1ea4c92717ef86e372fe80f410580fdc
Author: Andreas Schneider 
Date:   Fri Jan 19 09:33:21 2018 +0100

include: Create system/nis.h in libreplace

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238

Pair-Programmed-With: Guenther Deschner 

Signed-off-by: Andreas Schneider 
Signed-off-by: Guenther Deschner 
Reviewed-by: Alexander Bokovoy 

commit ca5eaf0cdcf8257ac52786aa7439c8f081a2fe0d
Author: Andreas Schneider 
Date:   Fri Jan 19 09:32:49 2018 +0100

s3:waf: Move HAVE_NETGROUP to wscript

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238

Pair-Programmed-With: Guenther Deschner 

Signed-off-by: Andreas Schneider 
Signed-off-by: Guenther Deschner 
Reviewed-by: Alexander Bokovoy 

commit 850a8027f32185e523614231cca76505134bb5e4
Author: Stefan Metzmacher 
Date:   Fri Jan 19 11:50:55 2018 +0100

dbcheck: disable fixing duplicate linked attributes until we can recover 
lost forward links

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228

Signed-off-by: Stefan Metzmacher 
Reviewed-by: Ralph Boehme 

commit a25c99c9f1fd1814c56c21848c748cd0e038eed7
Author: Stefan Metzmacher 
Date:   Wed Jan 17 08:07:03 2018 +0100

repl_meta_data: fix linked attribute corruption on databases with unsorted 
links on expunge

This is really critical bug, it removes valid linked attributes.

When a DC was provisioned/joined with a Samba version older than 4.7
is upgraded to 4.7 (or later), it can happen that the garbage collection
(dsdb_garbage_collect_tombstones()), triggered periodically by the 'kcc' 
task
of 'samba' or my 'samba-tool domain tombstones expunge' corrupt the linked 
attributes.

This is similar to Bug #13095 - Broken linked attribute handling,
but it's not triggered by an originating change.

The bug happens in replmd_modify_la_delete()
were get_parsed_dns_trusted() generates a sorted array of
struct parsed_dn based on the values in old_el->values.

If the database doesn't support the sortedLinks compatibleFeatures
in the @SAMBA_DSDB record, it's very likely that
the array of old_dns is sorted differently than the values
in