gary/samba-autobuild/.git
7 years agoVERSION: Disable git snapshots for the 4.6.0rc3 release. samba-4.6.0rc3
Karolin Seeger [Tue, 14 Feb 2017 12:25:19 +0000 (13:25 +0100)]
VERSION: Disable git snapshots for the 4.6.0rc3 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
7 years agoWHATSNEW: Add release notes for Samba 4.6.0rc3.
Karolin Seeger [Tue, 14 Feb 2017 08:50:43 +0000 (09:50 +0100)]
WHATSNEW: Add release notes for Samba 4.6.0rc3.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
7 years agowaf: Do not install the unit test binary for krb5samba
Andreas Schneider [Wed, 1 Feb 2017 14:53:44 +0000 (15:53 +0100)]
waf: Do not install the unit test binary for krb5samba

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
(cherry picked from commit 85d5b4339237a12d369c3522dbb44e98fd3a6c54)

Autobuild-User(v4-6-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-6-test): Tue Feb 14 12:46:23 CET 2017 on sn-devel-144

7 years agos4:tests/sec_descriptor: use more unique oid values
Stefan Metzmacher [Wed, 11 Jan 2017 12:34:28 +0000 (13:34 +0100)]
s4:tests/sec_descriptor: use more unique oid values

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Jan 12 04:02:21 CET 2017 on sn-devel-144

(cherry picked from commit b4f40e4d6db4d5a8e889ea778ebbce8eaf6b10f5)

Autobuild-User(v4-6-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-6-test): Tue Feb 14 04:13:19 CET 2017 on sn-devel-144

7 years agoctdb-build: Install CTDB tests correctly from toplevel
Amitay Isaacs [Wed, 1 Feb 2017 04:53:47 +0000 (15:53 +1100)]
ctdb-build: Install CTDB tests correctly from toplevel

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Feb  2 08:25:57 CET 2017 on sn-devel-144

(cherry picked from commit ce9b72c17abb156de8185b100f27d1ddd3c89b15)

7 years agos3: VFS: Don't allow symlink, link or rename on already converted paths.
Jeremy Allison [Fri, 27 Jan 2017 01:19:24 +0000 (17:19 -0800)]
s3: VFS: Don't allow symlink, link or rename on already converted paths.

Snapshot paths are a read-only filesystem.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jan 30 22:26:29 CET 2017 on sn-devel-144

(cherry picked from commit 0e1deb77f2b310ad7e5dd784174207adacf1c981)

7 years agos3: VFS: shadow_copy2: Fix usage of saved_errno to only set errno on error.
Jeremy Allison [Mon, 23 Jan 2017 18:20:13 +0000 (10:20 -0800)]
s3: VFS: shadow_copy2: Fix usage of saved_errno to only set errno on error.

Rationale:

VFS calls must act like their POSIX equivalents, and the POSIX versions
*only* set errno on a failure. There is actually code in the upper smbd
layers that depends on errno being correct on a fail return from a VFS call.

For a compound VFS module like this, a common pattern is :

SMB_VFS_CALL_X()
{
      int ret;

      syscall1();
      ret = syscall2();
      syscall3();

      return ret;
}

Where if *any* of the contained syscallX()'s fail, they'll set errno.
However, the actual errno we should return is *only* the one returned
if syscall2() fails (the others are lstat's checking for existence etc.).

So what we should do to correctly return only the errno from syscall2() is:

SMB_VFS_CALL_X()
{
      int ret;
      int saved_errno = 0;

      syscall1()

      ret = syscall2();
      if (ret == -1) {
            saved_errno = errno;
      }
      syscall3()

      if (saved_errno != 0) {
           errno = saved_errno;
      }
      return ret;
}

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit cda6764f1a8db96182bfd1855440bc6a1ba1abee)

7 years agos3: VFS: shadow_copy2: Fix a memory leak in the connectpath function.
Jeremy Allison [Mon, 23 Jan 2017 18:06:44 +0000 (10:06 -0800)]
s3: VFS: shadow_copy2: Fix a memory leak in the connectpath function.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 4d339a88851f601fae195ac8ff0691cbd3504f41)

7 years agos3: VFS: shadow_copy2: Fix module to work with variable current working directory.
Jeremy Allison [Thu, 26 Jan 2017 18:49:51 +0000 (10:49 -0800)]
s3: VFS: shadow_copy2: Fix module to work with variable current working directory.

Completely cleans up the horrible shadow_copy2_strip_snapshot()
and adds an explaination of what it's actually trying to do.

* This function does two things.
*
* 1). Checks if an incoming filename is already a
* snapshot converted pathname.
*     If so, it returns the pathname truncated
*     at the snapshot point which will be used
*     as the connectpath, and then does an early return.
*
* 2). Checks if an incoming filename contains an
* SMB-layer @GMT- style timestamp.
*     If so, it strips the timestamp, and returns
*     both the timestamp and the stripped path
*     (making it cwd-relative).

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 128d5f27cd42b0c7efcbe3d28fe3eee881e0734b)

7 years agos3: VFS: Add utility function check_for_converted_path().
Jeremy Allison [Thu, 26 Jan 2017 18:35:50 +0000 (10:35 -0800)]
s3: VFS: Add utility function check_for_converted_path().

Detects an already converted path. Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit b94dc85d339c9a10496edd07b85bdd7808d2e332)

7 years agos3: VFS: Ensure shadow:format cannot contain a / path separator.
Jeremy Allison [Thu, 26 Jan 2017 18:24:52 +0000 (10:24 -0800)]
s3: VFS: Ensure shadow:format cannot contain a / path separator.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit cd4f940162b17e4f7345d392326a31ae478230fa)

7 years agos3: VFS: Allow shadow_copy2_connectpath() to return the cached path derived from...
Jeremy Allison [Fri, 20 Jan 2017 20:09:08 +0000 (12:09 -0800)]
s3: VFS: Allow shadow_copy2_connectpath() to return the cached path derived from $cwd.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 42bd1acad75a6b5ea81fe4b30c067dd82623c042)

7 years agos3: VFS: shadow_copy2: Fix chdir to store off the needed private variables.
Jeremy Allison [Fri, 20 Jan 2017 20:06:55 +0000 (12:06 -0800)]
s3: VFS: shadow_copy2: Fix chdir to store off the needed private variables.

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

This is not yet used, the users of this will be added later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 27340df4b52e4341f134667c59d71656a7a1fdae)

7 years agos3: VFS: shadow_copy2: Add two currently unused functions to make pathnames absolute...
Jeremy Allison [Fri, 20 Jan 2017 20:00:08 +0000 (12:00 -0800)]
s3: VFS: shadow_copy2: Add two currently unused functions to make pathnames absolute or relative to $cwd.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 9d65107b8f2864dba8d41b3316c483b3f36d0697)

7 years agos3: VFS: shadow_copy2: Change a parameter name.
Jeremy Allison [Fri, 20 Jan 2017 19:56:21 +0000 (11:56 -0800)]
s3: VFS: shadow_copy2: Change a parameter name.

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

Allows easy substitution later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 2887465108aef5e2e7c64417437ecb86c7460e16)

7 years agos3: VFS: shadow_copy2: Add a wrapper function to call the original shadow_copy2_strip...
Jeremy Allison [Fri, 20 Jan 2017 19:54:56 +0000 (11:54 -0800)]
s3: VFS: shadow_copy2: Add a wrapper function to call the original shadow_copy2_strip_snapshot().

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

Allows an extra (currently unused) parameter to be added.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 5aa1ea95157475dfd2d056f0158b14b2b90895a9)

7 years agos3: VFS: shadow_copy2: Add two new variables to the private data. Not yet used.
Jeremy Allison [Fri, 20 Jan 2017 19:50:49 +0000 (11:50 -0800)]
s3: VFS: shadow_copy2: Add two new variables to the private data. Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 72fe2b62e3ee7462e5be855b01943f28b26c36c1)

7 years agos3: VFS: shadow_copy2: Fix length comparison to ensure we don't overstep a length.
Jeremy Allison [Fri, 20 Jan 2017 19:48:40 +0000 (11:48 -0800)]
s3: VFS: shadow_copy2: Fix length comparison to ensure we don't overstep a length.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 37ef8d3f65bd1215717eb51b2e1cdb84a7bed348)

7 years agos3: VFS: shadow_copy2: Ensure pathnames for parameters are correctly relative and...
Jeremy Allison [Fri, 20 Jan 2017 19:45:54 +0000 (11:45 -0800)]
s3: VFS: shadow_copy2: Ensure pathnames for parameters are correctly relative and terminated.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 979e39252bcc88e8aacb543b8bf322dd6f17fe7f)

7 years agos3: VFS: shadow_copy2: Correctly initialize timestamp and stripped variables.
Jeremy Allison [Fri, 20 Jan 2017 19:42:39 +0000 (11:42 -0800)]
s3: VFS: shadow_copy2: Correctly initialize timestamp and stripped variables.

Allow the called functions to be fixed to not touch them on error.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 0a190f4dd950c947d47c42163d11ea4bd6e6e508)

7 years agos3: smbd: Make set_conn_connectpath() call canonicalize_absolute_path().
Jeremy Allison [Tue, 17 Jan 2017 19:35:52 +0000 (11:35 -0800)]
s3: smbd: Make set_conn_connectpath() call canonicalize_absolute_path().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit d650d65488761b30fa34d42cb1ab400618a78c33)

7 years agos3: smbtorture: Add new local test LOCAL-CANONICALIZE-PATH
Jeremy Allison [Fri, 27 Jan 2017 00:08:42 +0000 (16:08 -0800)]
s3: smbtorture: Add new local test LOCAL-CANONICALIZE-PATH

Tests new canonicalize_absolute_path() function.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit a51363309a4330b65e34ae941ec99d180bdbab56)

7 years agos3: lib: Fix two old, old bugs in set_conn_connectpath(), now in canonicalize_absolut...
Jeremy Allison [Thu, 19 Jan 2017 23:18:41 +0000 (15:18 -0800)]
s3: lib: Fix two old, old bugs in set_conn_connectpath(), now in canonicalize_absolute_path().

Canonicalizing a path of /foo/bar/../baz would return /foo/barbaz
as moving forward 3 characters would delete the / character.

Canonicalizing /foo/.. would end up as '\0'.

Test to follow.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 82979afc46cc5e466bdd999a94080e7a5df95518)

7 years agos3: lib: Add canonicalize_absolute_path().
Jeremy Allison [Tue, 17 Jan 2017 19:33:18 +0000 (11:33 -0800)]
s3: lib: Add canonicalize_absolute_path().

Resolves any invalid path components (.) (..)
in an absolute POSIX path.

We will be re-using this in several places.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 02599c39337c3049762a6b0bd6290577817ee5a5)

7 years agos3: smbd: Correctly canonicalize any incoming shadow copy path.
Jeremy Allison [Thu, 12 Jan 2017 00:30:38 +0000 (16:30 -0800)]
s3: smbd: Correctly canonicalize any incoming shadow copy path.

Converts to:

@GMT-token/path/last_component

from all incoming path types. Allows shadow_copy modules
to work when current directory is changed after removing
last component.

Ultimately when the VFS ABI is changed to add a timestamp
to struct smb_filename, this is where the parsing will be
done.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 39678ed6af708fb6f2760bfb51051add11e3c498)

7 years agowaf: backport finding of pkg-config
Uri Simchoni [Thu, 19 Jan 2017 05:46:57 +0000 (07:46 +0200)]
waf: backport finding of pkg-config

Allow the builder to customize the location of pkg-config
utility by setting PKGCONFIG environment variable.

This is backported from upstream waf.

Thanks to Zentaro Kavanagh <zentaro@google.com> for
pointing that out and proposing the fix.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan 25 04:23:00 CET 2017 on sn-devel-144

(cherry picked from commit 2cf141ed45b4f7b7754cb9525d987ff38495d789)

7 years agotorture/drs: expand test for DRSUAPI_DRS_GET_ANC
Bob Campbell [Mon, 12 Dec 2016 03:00:35 +0000 (16:00 +1300)]
torture/drs: expand test for DRSUAPI_DRS_GET_ANC

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb  9 03:16:09 CET 2017 on sn-devel-144

(cherry picked from commit 5c918e29429f4a0c5a4383b33eaa10a66dfdd2f2)

7 years agogetncchanges: implement DRSUAPI_DRS_GET_ANC more correctly
Stefan Metzmacher [Tue, 29 Nov 2016 10:12:22 +0000 (11:12 +0100)]
getncchanges: implement DRSUAPI_DRS_GET_ANC more correctly

The most important case is the combination of
DRSUAPI_DRS_CRITICAL_ONLY and DRSUAPI_DRS_GET_ANC.

With DRSUAPI_DRS_GET_ANC we need to make sure all ancestors
included even if they're not marked with
isCriticalSystemObject=TRUE.

I guess we still don't behave exactly as Windows, but it's much
better than before and fixes the initial replication if
someone moved the administrator account to an OU.

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

Pair-Programmed-With: Bob Campbell <bobcampbell@catalyst.net.nz>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 5109e777f75670958d193a269bbb575cdf0a67ce)

7 years agogetncchanges: calculate getnc_state->min_usn calculation based on the uptodateness...
Stefan Metzmacher [Tue, 7 Feb 2017 11:37:16 +0000 (12:37 +0100)]
getncchanges: calculate getnc_state->min_usn calculation based on the uptodateness vector

This should improve initial replication of a fresh destination dsa with
a zero highwatermark.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit c61d0c8957bf4eade5da93f4f22ae5f3ce2e7403)

7 years agogetncchanges: improve get_nc_changes_add_links() by checking uSNChanged
Stefan Metzmacher [Tue, 7 Feb 2017 11:28:33 +0000 (12:28 +0100)]
getncchanges: improve get_nc_changes_add_links() by checking uSNChanged

This will make a difference once we handle DRSUAPI_DRS_GET_ANC correctly.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 02f11b925c44ecc0b333f1a5593b7d01dc05560a)

7 years agogetncchanges: improve get_nc_changes_build_object() by checking uSNChanged
Stefan Metzmacher [Tue, 7 Feb 2017 11:28:33 +0000 (12:28 +0100)]
getncchanges: improve get_nc_changes_build_object() by checking uSNChanged

This will make a difference once we handle DRSUAPI_DRS_GET_ANC correctly.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit c31777a7010e8fb914ae8450a476d7f9ee2a4c39)

7 years agogetncchanges: fix highest_usn off by one calculation in get_nc_changes_add_links()
Stefan Metzmacher [Tue, 7 Feb 2017 11:34:45 +0000 (12:34 +0100)]
getncchanges: fix highest_usn off by one calculation in get_nc_changes_add_links()

highest_usn is the the highest usn the destination dsa already knows about.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 51386342d5f6df2d9aaf801a4137300569458f3d)

7 years agogetncchanges: remove unused c++ comments/code in getncchanges_collect_objects()
Stefan Metzmacher [Wed, 8 Feb 2017 09:24:56 +0000 (10:24 +0100)]
getncchanges: remove unused c++ comments/code in getncchanges_collect_objects()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 7d8c409792e93490bc4c357436200289df54d3ce)

7 years agogetncchanges: do not replicate links for non critical objects if DRSUAPI_DRS_CRITICAL...
Garming Sam [Wed, 14 Dec 2016 03:04:32 +0000 (16:04 +1300)]
getncchanges: do not replicate links for non critical objects if DRSUAPI_DRS_CRITICAL_ONLY is set

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

Pair-programmed-with: Bob Campbell <bobcampbell@catalyst.net.nz>

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 1a328bf404d9b3e6db4b2db963b186223297463a)

7 years agogetncchanges: don't process DRSUAPI_DRS_CRITICAL_ONLY for EXOPs
Stefan Metzmacher [Wed, 30 Nov 2016 08:11:31 +0000 (09:11 +0100)]
getncchanges: don't process DRSUAPI_DRS_CRITICAL_ONLY for EXOPs

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 1e15cdaa01fdee60f8bd57db41f062ace77c216d)

7 years agogetncchanges: remember the ncRoot_guid on the getncchanges state
Stefan Metzmacher [Tue, 29 Nov 2016 10:09:46 +0000 (11:09 +0100)]
getncchanges: remember the ncRoot_guid on the getncchanges state

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 488eed6977e6bb04be2b1a736115d8887516ebbe)

7 years agogetncchanges: pass struct ldb_message as const
Stefan Metzmacher [Thu, 1 Dec 2016 10:50:34 +0000 (11:50 +0100)]
getncchanges: pass struct ldb_message as const

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 23e45b493803b3b2b548b4a3dbec0525feeb928f)

7 years agogetncchanges: only set nc_{object,linked_attributes}_count with DRSUAPI_DRS_GET_NC_SIZE
Stefan Metzmacher [Tue, 29 Nov 2016 12:23:23 +0000 (13:23 +0100)]
getncchanges: only set nc_{object,linked_attributes}_count with DRSUAPI_DRS_GET_NC_SIZE

The main change is that we return 0 values if DRSUAPI_DRS_GET_NC_SIZE is not
present in order to get the same result as a Windows server in that case.

If DRSUAPI_DRS_GET_NC_SIZE is return the number of links we found so far
during the cycle in addition the number of objects returned in this cycle.
Both values doesn't match what Windows returns, but doing that
correctly and efficient is a task for another day.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit e935a04afb017ff52b6caf9bfa66888ab541c894)

7 years agotorture/drs: remove pointless nc_object_count replication checks in test_link_utdv_hwm()
Stefan Metzmacher [Tue, 7 Feb 2017 16:06:47 +0000 (17:06 +0100)]
torture/drs: remove pointless nc_object_count replication checks in test_link_utdv_hwm()

nc_object_count and nc_linked_attributes_count are only filled if
DRSUAPI_DRS_GET_NC_SIZE is requested. And they should contain
the total number. This is only useful for the initial replication.

Samba ignores DRSUAPI_DRS_GET_NC_SIZE currently but that will change in
the following commits.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 41bc007d49e8bb304cdfb07231d402fa9ad828d7)

7 years agopython/join: use DRSUAPI_DRS_GET_NC_SIZE for the initial replication
Stefan Metzmacher [Tue, 29 Nov 2016 13:29:59 +0000 (14:29 +0100)]
python/join: use DRSUAPI_DRS_GET_NC_SIZE for the initial replication

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit dd6d119c801076547fc0d087a2b959100146ba95)

7 years agopython/join: set common replica_flags in dc_join.__init__()
Stefan Metzmacher [Tue, 29 Nov 2016 13:27:57 +0000 (14:27 +0100)]
python/join: set common replica_flags in dc_join.__init__()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 330ef9e572b9cf408ccb7721e86dc2afff245637)

7 years agodrsuapi.idl: make drsuapi_DsGetNCChangesRequest10 [public]
Stefan Metzmacher [Tue, 7 Feb 2017 15:22:41 +0000 (16:22 +0100)]
drsuapi.idl: make drsuapi_DsGetNCChangesRequest10 [public]

This allows ndr_print to work.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit f5d3b863c75af5373a2044b184a8c9be1f32e60a)

7 years agodrsuapi.idl: add drsuapi_DrsMoreOptions with DRSUAPI_DRS_GET_TGT
Stefan Metzmacher [Tue, 29 Nov 2016 08:22:44 +0000 (09:22 +0100)]
drsuapi.idl: add drsuapi_DrsMoreOptions with DRSUAPI_DRS_GET_TGT

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 0c77567a4e23bc87c249066319724413e9f9916e)

7 years agos4:libnet: s/highestCommitedUSN/highestCommittedUSN
Stefan Metzmacher [Thu, 1 Dec 2016 10:49:25 +0000 (11:49 +0100)]
s4:libnet: s/highestCommitedUSN/highestCommittedUSN

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 2ef7594eca19b4448f04b138e97768965dc34242)

7 years agos4:dsdb/repl: s/highestCommitedUsn/highestCommittedUSN
Stefan Metzmacher [Thu, 1 Dec 2016 10:49:07 +0000 (11:49 +0100)]
s4:dsdb/repl: s/highestCommitedUsn/highestCommittedUSN

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 7888c250da03b0deaafed0932f9d6bcb1dd296a4)

7 years agodbcheck-links: Test that dbcheck against one-way links does not error
Garming Sam [Wed, 8 Feb 2017 02:24:14 +0000 (15:24 +1300)]
dbcheck-links: Test that dbcheck against one-way links does not error

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12577
Pair-programmed-with: Bob Campbell <bobcampbell@catalyst.net.nz>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Feb 13 07:33:08 CET 2017 on sn-devel-144

(cherry picked from commit 44ee31675afd277d429cb246525741110f8fceec)

7 years agodbcheck: Do not regard old one-way-links as errors
Andrew Bartlett [Thu, 2 Feb 2017 03:27:35 +0000 (16:27 +1300)]
dbcheck: Do not regard old one-way-links as errors

Samba does not maintain one way links when the target is deleted or renamed
so do not fail dbcheck because of such links, but allow them to be updated.

This matters because administrators and make test expect that normal Samba
operation do NOT cause the database to become corrupt, and any error from
dbcheck tends to trigger alarms (or test failures).

If an object pointed at by a one way link is renamed or deleted in normal
operations (such as intersiteTopologyGenerator pointing at a demoted DC),
or make test, then this could trigger.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12577
(cherry picked from commit 35bfc62a31c9ad73449594ddd48f76f50e0abade)

7 years agosamba_dsdb: Use and maintain compatibleFeatures and requiredFeatures in @SAMBA_DSDB
Andrew Bartlett [Thu, 12 Jan 2017 03:51:45 +0000 (16:51 +1300)]
samba_dsdb: Use and maintain compatibleFeatures and requiredFeatures in @SAMBA_DSDB

This will allow us to introduce new database features that are
backward compatible from the point of view of older versions of Samba,
but which will be damaged by modifying the database with such a
version.

For example, if linked attributes are stored in sorted order in 4.7,
and this change, without any values in current_supportedFeatures is
itself included in 4.6, then our sortedLinks are backward compatible
to that release.

That is with 4.6 (including this patch) which doesn't care about
ordering -- but a downgraded 4.7 database used by 4.6 will be broken
when later used with 4.7.  If we add a 'sortedLinks' feature flag in
compatibleFeatures, we can detect that.

This will allow us to determine if the database still contains
unsorted links, as that information allows us to make the code
handling links much more efficient.

We won't add the actual flag until all the code is in place.

Andrew wrote the actual code and Douglas wrote the tests, and they
cross-reviewed.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Piar-programmed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest: check for database features flags
(cherry picked from commit 8368e06ff65cc70e1cf13a0eb4349033e068fcc6)

BUG 12573: Samba < 4.7 does not know about compatibleFeatures and
requiredFeatures

7 years agosamba-tool: Correct handling of default value for use_ntvfs and use_xattrs
Andrew Bartlett [Mon, 30 Jan 2017 02:34:09 +0000 (15:34 +1300)]
samba-tool: Correct handling of default value for use_ntvfs and use_xattrs

Because these options are optional based on build-time rules, we need to encode the
default value from the additonal Option() blocks in the run() declaration.

Then we can correctly check only for the expected options, and not inconsistently for
None (causing classicupgrade to fail).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12543
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from commit ca961e6a62987dc75931b7714d94fb998d586888)

7 years agoctdb-tests: Use replace headers instead of system headers
Amitay Isaacs [Tue, 31 Jan 2017 05:49:14 +0000 (16:49 +1100)]
ctdb-tests: Use replace headers instead of system headers

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

This ensures that PTHREAD_MUTEX_ROBUST, pthread_mutexattr_setrobust()
and pthread_mutex_consistent() are always defined.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan 31 11:57:01 CET 2017 on sn-devel-144

(cherry picked from commit 39ac4ae65eb3b8d4d3574987eab47eb7a290f2e4)

Autobuild-User(v4-6-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-6-test): Fri Feb  3 13:04:01 CET 2017 on sn-devel-144

7 years agoctdb-tests: Do not build mutex test if robust mutexes are not supported
Amitay Isaacs [Tue, 31 Jan 2017 03:50:53 +0000 (14:50 +1100)]
ctdb-tests: Do not build mutex test if robust mutexes are not supported

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 08b4a5f9f1575c882ab7174eb3249b574df6976f)

7 years agoctdb-common: ioctl(.. FIONREAD ..) returns an int value
Amitay Isaacs [Wed, 1 Feb 2017 04:52:48 +0000 (15:52 +1100)]
ctdb-common: ioctl(.. FIONREAD ..) returns an int value

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Feb  1 14:29:14 CET 2017 on sn-devel-144

(cherry picked from commit 2bea45e450e5ebd6544c2a8be4493242158b712e)

7 years agos3: VFS: vfs_streams_xattr.c: Make streams_xattr_open() store the same path as stream...
Jeremy Allison [Wed, 1 Feb 2017 19:36:25 +0000 (11:36 -0800)]
s3: VFS: vfs_streams_xattr.c: Make streams_xattr_open() store the same path as streams_xattr_recheck().

If the open is changing directories, fsp->fsp_name->base_name
will be the full path from the share root, whilst
smb_fname will be relative to the $cwd.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Feb  2 01:55:42 CET 2017 on sn-devel-144

(cherry picked from commit a24ba3e4083200ec9885363efc5769f43183fb6b)

7 years agosmbd: Fix "map acl inherit" = yes
Volker Lendecke [Wed, 1 Feb 2017 14:41:43 +0000 (14:41 +0000)]
smbd: Fix "map acl inherit" = yes

Brown-Paper-Bag bug in f85c2a6852a. The assignment contains a self-reference
in get_pai_flags which I missed.

Fix an uninitialized read.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12551
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Feb  1 22:06:50 CET 2017 on sn-devel-144

(cherry picked from commit 129bc58eee4b1868b1aaec6194808752520517b4)

7 years agos3: vfs: dirsort doesn't handle opendir of "." correctly.
Jeremy Allison [Thu, 5 Jan 2017 20:38:07 +0000 (12:38 -0800)]
s3: vfs: dirsort doesn't handle opendir of "." correctly.

Needs to store $cwd path for correct sorting.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit e2f34116ab6328e2b872999dc7c4bcda69c03ab2)

7 years agodocs: Improve description of "unix_primary_group" parameter in idmap_ad manpage
John Mulligan [Fri, 13 Jan 2017 06:33:01 +0000 (07:33 +0100)]
docs: Improve description of "unix_primary_group" parameter in idmap_ad manpage

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

Signed-off-by: John Mulligan <jmulligan@nasuni.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Jan 27 20:58:18 CET 2017 on sn-devel-144

(cherry picked from commit f605332e1b87d87e0c454bcae2a374013d3ebf82)

Autobuild-User(v4-6-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-6-test): Wed Feb  1 16:49:18 CET 2017 on sn-devel-144

7 years agovfs_fruit: checks wrong AAPL config state and so always uses readdirattr
Ralph Boehme [Thu, 26 Jan 2017 10:49:55 +0000 (11:49 +0100)]
vfs_fruit: checks wrong AAPL config state and so always uses readdirattr

readdirattr should only be enabled if the client enables it via AAPL
negotitiation, not for all clients when vfs_fruit is loaded.

Unfortunately the check in fruit_readdir_attr() is

  if (!config->use_aapl) {
    return SMB_VFS_NEXT_READDIR_ATTR(handle, fname, mem_ctx, pattr_data);
  }

This uses the wrong config state "use_aapl" which is always true by
default (config option "fruit:aapl").

We must use "nego_aapl" instead which is only true if the client
really negotiated this feature.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jan 28 01:49:11 CET 2017 on sn-devel-144

(cherry picked from commit 9a3b64a24cc21124485b423c9b70b67ff5a96f10)

7 years agoselftest/Samba3: use "server min protocol = SMB3_00" for "ktest"
Stefan Metzmacher [Wed, 25 Jan 2017 20:15:44 +0000 (21:15 +0100)]
selftest/Samba3: use "server min protocol = SMB3_00" for "ktest"

This verifies that clients can still connect with that setting.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jan 27 12:03:39 CET 2017 on sn-devel-144

(cherry picked from commit 348bcca76855798d60c04ddb30f1e13b2ac2d7cd)

7 years agos3:smbd: allow "server min protocol = SMB3_00" to go via "SMB 2.???" negprot
Stefan Metzmacher [Wed, 18 Jan 2017 07:37:30 +0000 (08:37 +0100)]
s3:smbd: allow "server min protocol = SMB3_00" to go via "SMB 2.???" negprot

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit c207f2a989fc791b5f9bf9043d3c6ac31db5cdfd)

7 years agos3/rpc_server: move rpc_modules.c to its own subsystem
Ralph Boehme [Mon, 16 Jan 2017 11:24:54 +0000 (12:24 +0100)]
s3/rpc_server: move rpc_modules.c to its own subsystem

The source file rpc_modules.c was used in two places which lead to the
following build error when configuring with '--nonshared-binary=smbd/smbd':

  ERROR: source source3/rpc_server/rpc_modules.c is in more than one
  subsystem of target 'smbd/smbd': ['RPC_SERVICE', 'MDSSD']

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <nopower@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jan 20 15:00:45 CET 2017 on sn-devel-144

(cherry picked from commit be8e90f27a70f3ba8d708e984cf7b2a34e8c2628)

7 years agoselftest: add test for global "smb encrypt=off"
Ralph Boehme [Wed, 18 Jan 2017 15:23:40 +0000 (16:23 +0100)]
selftest: add test for global "smb encrypt=off"

Test various combinations of having encryption globally turned off and
enabled (desired/required) on a share, with SMB1 UNIX Extensions and SMB3.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 21d030e5bdf7dc6ef8d5f4e70bed7e70b731cd15)

7 years agoselftest: disable SMB encryption in simpleserver environment
Ralph Boehme [Tue, 17 Jan 2017 16:23:51 +0000 (17:23 +0100)]
selftest: disable SMB encryption in simpleserver environment

Encryption is currently not tested in this env so we can safely turn it
off. The next commit will add a blackbox tests that test combinations of
having encryption globally turned off and enabled (desired/required) on
a share.

This also adds a new share "enc_desired" with "smb encrypt = desired"
which will be used by the test in the next commit.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 573e8e15b3ed27d6b593e635e9c24eea3fdf4fb9)

7 years agodocs: impact of a global "smb encrypt=off" on a share with "smb encrypt=required"
Ralph Boehme [Mon, 16 Jan 2017 14:45:32 +0000 (15:45 +0100)]
docs: impact of a global "smb encrypt=off" on a share with "smb encrypt=required"

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit f8d937b331ac985264c76d76b447683fc494d38a)

7 years agos3/smbd: ensure global "smb encrypt = off" is effective for share with "smb encrypt...
Ralph Boehme [Mon, 16 Jan 2017 11:56:10 +0000 (12:56 +0100)]
s3/smbd: ensure global "smb encrypt = off" is effective for share with "smb encrypt = desired"

If encryption is disabled globally, per definition we shouldn't allow
enabling encryption on individual shares.

The behaviour of specifying

[Global]
  smb encrypt = off

[share]
  smb encrypt = desired

must be an unecrypted tree connect to the share "share".

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit b0b418c22558fa1df547df9bdac2642343ac39e1)

7 years agos3/smbd: ensure global "smb encrypt = off" is effective for SMB 3.1.1 clients
Ralph Boehme [Thu, 5 Jan 2017 11:14:35 +0000 (12:14 +0100)]
s3/smbd: ensure global "smb encrypt = off" is effective for SMB 3.1.1 clients

If encryption is disabled globally, per definition we shouldn't allow
enabling encryption on individual shares.

The behaviour of setting

[Global]
  smb encrypt = off

[share]
  smb encrypt = required

must be to completely deny access to the share "share".

This was working correctly for clients when using SMB 3 dialects <
3.1.1, but not for 3.1.1 with a negprot encryption context.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 6ae63d42f5aacddf5b7b6dbdfbe620344989e4e5)

7 years agos3/smbd: ensure global "smb encrypt = off" is effective for SMB 1 clients
Ralph Boehme [Wed, 18 Jan 2017 15:19:15 +0000 (16:19 +0100)]
s3/smbd: ensure global "smb encrypt = off" is effective for SMB 1 clients

If encryption is disabled globally, per definition we shouldn't allow
enabling encryption on individual shares.

The behaviour of setting

[Global]
  smb encrypt = off

[share_required]
  smb encrypt = required

[share_desired]
  smb encrypt = desired

must be to completely deny access to the share "share_required" and an
unencrypted connection to "share_desired".

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 43a90cee46bb7a70f7973c4fc51eee7634e43145)

7 years agos3/rpc_server: shared rpc modules loading
Ralph Boehme [Mon, 30 Jan 2017 17:49:39 +0000 (18:49 +0100)]
s3/rpc_server: shared rpc modules loading

The previous commit 58889e04bd545d7420d1193e134351bd0ccb8430 for this
bug was broken as it didn't move the goto into the "if (errno !=
ENOENT)" condition.

This updated fix folds the test "mod_init_fns == NULL" and the check for
the errno into one if condition.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 9785fe5af6613a728a7d92c82bbc31cabbe3a0b9)

7 years agoVERSION: Bump version up to 4.6.0rc3...
Karolin Seeger [Thu, 26 Jan 2017 12:20:16 +0000 (13:20 +0100)]
VERSION: Bump version up to 4.6.0rc3...

and re-enable git snapshots.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
7 years agoVERSION: Disable git snapshots for the 4.2.0rc2 release. samba-4.6.0rc2
Karolin Seeger [Thu, 26 Jan 2017 12:16:23 +0000 (13:16 +0100)]
VERSION: Disable git snapshots for the 4.2.0rc2 release.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
7 years agoWHATSNEW: Add release notes for Samba 4.6.0rc2.
Karolin Seeger [Thu, 26 Jan 2017 09:17:16 +0000 (10:17 +0100)]
WHATSNEW: Add release notes for Samba 4.6.0rc2.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
7 years agoscript/release.sh: fix off by 1 error in announce.${tagname}.mail.txt creation
Stefan Metzmacher [Thu, 12 Jan 2017 09:40:37 +0000 (10:40 +0100)]
script/release.sh: fix off by 1 error in announce.${tagname}.mail.txt creation

Pair-Programmed-With: Karolin Seeger <kseeger@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Karolin Seeger <kseeger@samba.org>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Thu Jan 12 15:34:25 CET 2017 on sn-devel-144

(cherry picked from commit 7870c645b79da647bae45b4dc95e7d6e9abcd91a)

Autobuild-User(v4-6-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-6-test): Thu Jan 26 04:06:28 CET 2017 on sn-devel-144

7 years agowinbind: Don't add duplicate IDs in wbinfo -r
Volker Lendecke [Wed, 18 Jan 2017 15:54:03 +0000 (16:54 +0100)]
winbind: Don't add duplicate IDs in wbinfo -r

We look at the netsamlogon_cache entry twice: Once in queryuser and
once in lookupusergroups_cached. This can add the group SID twice.

Use add_sid_to_array_unique to avoid this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jan 24 02:36:19 CET 2017 on sn-devel-144

The last 9 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12538
Backport winbind fixes.

Autobuild-User(v4-6-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-6-test): Thu Jan 26 00:17:35 CET 2017 on sn-devel-144

7 years agowinbind: Fix a typo
Volker Lendecke [Fri, 13 Jan 2017 06:33:24 +0000 (07:33 +0100)]
winbind: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos3/winbindd: fix invalid free
Aurelien Aptel [Tue, 17 Jan 2017 13:39:03 +0000 (14:39 +0100)]
s3/winbindd: fix invalid free

coverity fix.

TALLOC_FREE() might be called on uninitialized 'rids' at the end of the
function in case of an early error. Initialize it to NULL to turn the
TALLOC_FREE() to a noop in this case.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jan 18 17:19:39 CET 2017 on sn-devel-144

7 years agowinbind: Fix CID 1398534 Dereference before null check
Jeremy Allison [Wed, 11 Jan 2017 19:52:44 +0000 (11:52 -0800)]
winbind: Fix CID 1398534 Dereference before null check

Make all query_user_list backends consistent.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jan 13 13:33:37 CET 2017 on sn-devel-144

7 years agowinbind: Fix CID 1398530 Resource leak
Volker Lendecke [Tue, 10 Jan 2017 13:29:38 +0000 (13:29 +0000)]
winbind: Fix CID 1398530 Resource leak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan 11 04:38:25 CET 2017 on sn-devel-144

7 years agowinbind: Fix CID 1398530 Resource leak
Volker Lendecke [Tue, 10 Jan 2017 13:28:41 +0000 (13:28 +0000)]
winbind: Fix CID 1398530 Resource leak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agowinbind: Fix CID 1398531 Resource leak
Volker Lendecke [Tue, 10 Jan 2017 13:24:22 +0000 (13:24 +0000)]
winbind: Fix CID 1398531 Resource leak

Not really a leak due to talloc, but this way it's clear

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agowinbind: Fix CID 1398533 Resource leak
Volker Lendecke [Tue, 10 Jan 2017 13:26:13 +0000 (13:26 +0000)]
winbind: Fix CID 1398533 Resource leak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agowinbind: Fix CID 1398533 Resource leak
Volker Lendecke [Tue, 10 Jan 2017 13:24:22 +0000 (13:24 +0000)]
winbind: Fix CID 1398533 Resource leak

Not really a leak due to talloc, but this way it's clear

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoWHATSNEW: document winbind changes
Volker Lendecke [Wed, 25 Jan 2017 07:32:39 +0000 (08:32 +0100)]
WHATSNEW: document winbind changes

Signed-off-by: Volker Lendecke <vl@samba.org>
7 years agovfs_default: unlock the right file in copy chunk
Björn Jacke [Thu, 19 Jan 2017 20:51:41 +0000 (21:51 +0100)]
vfs_default: unlock the right file in copy chunk

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Sat Jan 21 17:00:54 CET 2017 on sn-devel-144

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

(cherry picked from commit 5059c8e2e3a6159bc2917ddd80d09fab35b39e66)

7 years agoctdb-tests: Add "13.per_ip_routing shutdown" test
Martin Schwenke [Mon, 16 Jan 2017 00:08:51 +0000 (11:08 +1100)]
ctdb-tests: Add "13.per_ip_routing shutdown" test

Ensure that it doesn't mangle the rt_tables file.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Jan 17 06:02:23 CET 2017 on sn-devel-144

(cherry picked from commit eaa508b82650197a7d473a24b3362e9e9c329937)

7 years agoctdb-scripts: Fix regression when cleaning up routing table IDs
Martin Schwenke [Sun, 15 Jan 2017 20:24:15 +0000 (07:24 +1100)]
ctdb-scripts: Fix regression when cleaning up routing table IDs

Commit 0ca00267cd2620a14968961738bcd2a69b597e95 removed explicit
continuations in strings for awk programs.  In one case this causes a
disconnect between condition and action, where an implicit
continuation does not work.  This results in duplicate lines in the
rt_tables file.

Move the opening brace for the action to make the implicit
continuation work as expected.

An alternative would be to revert the removal of the explicit
continuations and add shellcheck tags.  However, that doesn't mean
that an author of future code will necessarily use explicit
continuations, so the same mistake might still be make in the future.

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

Reported-by: Barry Evans <bevans@pixitmedia.com>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit f9368f8e129cb32ee30cb6501a6fe728db37e1d5)

7 years agoctdb-daemon: Remove stale eventd socket
Amitay Isaacs [Fri, 13 Jan 2017 05:00:45 +0000 (16:00 +1100)]
ctdb-daemon: Remove stale eventd socket

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Jan 17 15:00:15 CET 2017 on sn-devel-144

7 years agoctdb-scripts: Fix remaining uses of "ctdb gratiousarp"
Martin Schwenke [Mon, 16 Jan 2017 02:38:50 +0000 (13:38 +1100)]
ctdb-scripts: Fix remaining uses of "ctdb gratiousarp"

This changed to "ctdb gratarp" some time ago but the scripts were
never updated.

Fix the documentation for the ctdb tool too.

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

Reported-by: Ralph Böhme <slow@samba.org>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 5e00a6b346325f52e35b9785eaffd72239aebcf5)

7 years agoctdb-tests: Add takeover helper tests with banned/disconnected nodes
Martin Schwenke [Wed, 11 Jan 2017 08:20:08 +0000 (19:20 +1100)]
ctdb-tests: Add takeover helper tests with banned/disconnected nodes

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Jan 12 23:11:28 CET 2017 on sn-devel-144

(cherry picked from commit 4d8cba6f5db1851a738d74030b6b6a118c535c45)

7 years agoctdb-takeover: Handle case where there are no RELEASE_IPs to send
Martin Schwenke [Wed, 11 Jan 2017 19:52:32 +0000 (06:52 +1100)]
ctdb-takeover: Handle case where there are no RELEASE_IPs to send

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit a5b187202fa13661aec14cb9e4cbb3b93d4c33f6)

7 years agoctdb-takeover: Known and available IP lists should be the same size as nodemap
Amitay Isaacs [Wed, 11 Jan 2017 05:49:33 +0000 (16:49 +1100)]
ctdb-takeover: Known and available IP lists should be the same size as nodemap

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit b7cfac778e8813b22d29859102bab1598cdb5ff0)

7 years agoctdb-common: Add wait_send/wait_recv to sock_daemon_funcs
Amitay Isaacs [Wed, 11 Jan 2017 09:37:00 +0000 (20:37 +1100)]
ctdb-common: Add wait_send/wait_recv to sock_daemon_funcs

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

To be able to terminate the daemon from within the implementation,
create a subreq using wait_send() provided by the implementation.
When the subreq is finished, it signals the sock_daemon code to terminate
the daemon.

This avoids the need to keep track of the top level tevent_req causing
layer violation and keeps the code flow straighforward.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jan 16 21:16:51 CET 2017 on sn-devel-144

(cherry picked from commit ed722c3aa9690873af495cb467dd440c1a714d82)

7 years agoctdb-common: Avoid any processing after finishing tevent_req
Amitay Isaacs [Wed, 11 Jan 2017 08:54:36 +0000 (19:54 +1100)]
ctdb-common: Avoid any processing after finishing tevent_req

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit d09469e575233242eab2a8c1c0767f52e7cad1e5)

7 years agoctdb-common: Pass tevent_req to the computation sub-functions
Amitay Isaacs [Thu, 12 Jan 2017 23:43:44 +0000 (10:43 +1100)]
ctdb-common: Pass tevent_req to the computation sub-functions

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit d5be55725000eb34611dc76a2e8e7188eea2503f)

7 years agoctdb-common: Use consistent naming for sock_daemon_run computation functions
Amitay Isaacs [Thu, 12 Jan 2017 23:40:43 +0000 (10:40 +1100)]
ctdb-common: Use consistent naming for sock_daemon_run computation functions

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 31274cf7aec1bb26e8dac0dbd1b9a3fa799b2b85)

7 years agoctdb-common: Correct name of sock_daemon_run_send/recv state structure
Amitay Isaacs [Wed, 11 Jan 2017 08:50:34 +0000 (19:50 +1100)]
ctdb-common: Correct name of sock_daemon_run_send/recv state structure

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 9e09a253b4ca1b5f9aa432c986c1755a173a9566)

7 years agoctdb-tests: Add robust mutex test
Amitay Isaacs [Fri, 2 Dec 2016 04:11:20 +0000 (15:11 +1100)]
ctdb-tests: Add robust mutex test

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

This demonstrates robust mutex bug on linux/glibc system.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Thu Jan 12 07:59:34 CET 2017 on sn-devel-144

(cherry picked from commit 7794497bc909fa7b02da9d9ce1fc496a8fa2a9ae)

7 years agoctdb-locking: Explicitly unlock record/db in lock helper
Amitay Isaacs [Tue, 29 Nov 2016 06:20:45 +0000 (17:20 +1100)]
ctdb-locking: Explicitly unlock record/db in lock helper

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

Instead of killing lock helper processes with SIGKILL, send SIGTERM so
lock helper processes can explicitly unlock record/db.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 3a56a16b06cf6d1cce613ec29f5ea46630902072)

7 years agoctdb-locking: Remove support for locking multiple databases
Amitay Isaacs [Tue, 29 Nov 2016 06:13:41 +0000 (17:13 +1100)]
ctdb-locking: Remove support for locking multiple databases

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

The code to lock multiple databases has been dropped from ctdb_lock.c.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 5b1076dc61f5e3f006c1b8cef98e7d2d3cc1bfba)

7 years agopython/schema: fix tests flapping due to oid collision
Andrew Bartlett [Mon, 9 Jan 2017 21:00:43 +0000 (10:00 +1300)]
python/schema: fix tests flapping due to oid collision

These tests would sometimes fail because the randomly generated OIDs
would collide. This fixes that by giving a unique OID to each attribute
and class.

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

Pair-Programmed-With: Bob Campbell <bobcampbell@catalyst.net.nz>

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan 10 13:44:02 CET 2017 on sn-devel-144

(cherry picked from commit 207fa2331831f570eb4855e98b676782d2008f34)

7 years agomessaging: Fix dead but not cleaned-up-yet destination sockets
Volker Lendecke [Tue, 10 Jan 2017 12:30:54 +0000 (12:30 +0000)]
messaging: Fix dead but not cleaned-up-yet destination sockets

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan 10 17:40:58 CET 2017 on sn-devel-144

(cherry picked from commit e84e44ce923e5dc7529bb813e10a2890528a4ab0)

Autobuild-User(v4-6-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-6-test): Sat Jan 14 14:14:26 CET 2017 on sn-devel-144

7 years agos3:winbindd: talloc_steal the extra_data in winbindd_list_users_recv()
Stefan Metzmacher [Tue, 10 Jan 2017 08:48:33 +0000 (09:48 +0100)]
s3:winbindd: talloc_steal the extra_data in winbindd_list_users_recv()

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

Pair-Programmed-With: Andreas Schneider <asn@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit dde30ab89c276474d19b584c6def6f25ed5cc678)