samba.git
7 years agodocs: Clarify description for cache, lock and state directory settings
Christof Schmitt [Thu, 18 Aug 2016 20:46:52 +0000 (13:46 -0700)]
docs: Clarify description for cache, lock and state directory settings

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agopvfs_open win10 fix, need return SMB2_CREATE_TAG_QFID
ouyang.xu [Mon, 11 Jul 2016 10:12:52 +0000 (18:12 +0800)]
pvfs_open win10 fix, need return SMB2_CREATE_TAG_QFID

Signed-off-by: kkhaike <kkhaike@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Fri Aug 19 09:35:15 CEST 2016 on sn-devel-144

7 years agos3-libnet: Add missing format element
Amitay Isaacs [Thu, 18 Aug 2016 15:26:38 +0000 (01:26 +1000)]
s3-libnet: Add missing format element

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

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): Thu Aug 18 23:49:42 CEST 2016 on sn-devel-144

7 years agos3-lib: Pass missing argument for format string
Amitay Isaacs [Sun, 7 Aug 2016 08:17:19 +0000 (18:17 +1000)]
s3-lib: Pass missing argument for format string

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 years agosmbd: allow reading files based on FILE_EXECUTE access right
Uri Simchoni [Thu, 4 Aug 2016 11:59:23 +0000 (14:59 +0300)]
smbd: allow reading files based on FILE_EXECUTE access right

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Aug 18 18:58:22 CEST 2016 on sn-devel-144

7 years agoctdb-ipalloc: Fix cumulative takeover timeout
Martin Schwenke [Thu, 18 Aug 2016 02:57:33 +0000 (12:57 +1000)]
ctdb-ipalloc: Fix cumulative takeover timeout

Commit c40fc62642ff5ac49b75e9af49c299e33dbc9073 runs the IP allocation
algorithm after calculating the timeout offset.  If the algorithm
takes a long time then there may be no attempt to release or take over
IPs.

Instead, reset the timeout just before the RELEASE_IP stage if an
early jump to IPREALLOCATED was not taken.

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

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): Thu Aug 18 12:36:37 CEST 2016 on sn-devel-144

7 years agos3: vfs: snapper: Fix snapper_gmt_strip_snapshot() function to strip @GMT token ident...
Jeremy Allison [Wed, 17 Aug 2016 17:57:10 +0000 (10:57 -0700)]
s3: vfs: snapper: Fix snapper_gmt_strip_snapshot() function to strip @GMT token identically to shadow_copy2.c:shadow_copy2_strip_snapshot()

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Aug 18 06:43:02 CEST 2016 on sn-devel-144

7 years agos3: vfs: snapper: Add and use len_before_gmt, calculated as (p-name).
Jeremy Allison [Wed, 17 Aug 2016 17:53:08 +0000 (10:53 -0700)]
s3: vfs: snapper: Add and use len_before_gmt, calculated as (p-name).

Make the code closer to the same functionality in shadow_copy2.c:shadow_copy2_strip_snapshot().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
7 years agos3: vfs: shadow_copy2: Replace all uses of (p-name) with len_before_gmt.
Jeremy Allison [Wed, 17 Aug 2016 17:49:50 +0000 (10:49 -0700)]
s3: vfs: shadow_copy2: Replace all uses of (p-name) with len_before_gmt.

p and name don't change, and we've already calculated this length.
Part of the effort to make the code inside vfs_snapper.c that does
the same thing more similar (we can't make these functions identical
due to the 'snapdir' use case).

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
7 years agoctdb-tests: Validate that TAKE_IP works with IP already on an interface
Martin Schwenke [Mon, 1 Aug 2016 06:00:55 +0000 (16:00 +1000)]
ctdb-tests: Validate that TAKE_IP works with IP already on an interface

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 Aug 18 02:50:16 CEST 2016 on sn-devel-144

7 years agoctdb-tests: Validate that unexpected IP on interface is properly released
Martin Schwenke [Tue, 2 Aug 2016 11:02:08 +0000 (21:02 +1000)]
ctdb-tests: Validate that unexpected IP on interface is properly released

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-recoverd: Don't directly release rogue IP addresses
Martin Schwenke [Tue, 2 Aug 2016 02:18:15 +0000 (12:18 +1000)]
ctdb-recoverd: Don't directly release rogue IP addresses

This is inconsistent with the rest of the local IP verification.  It
should notice problems but not try to fix them directly.  Like other
cases, it should use an IP takeover run to try to fix the problem.  In
this case the address might have just been added and an out-of-band
RELEASE_IP might cause conflicts (i.e. "another change is in flight")
with a scheduled IP takeover run.

This effectively reverts commit
694c1b269edc95df446b2e171919be0c266383c4.  Not sure why this was
needed after c7e648c2d11f9785f2493a3dd67567a635633489.  More recently
commit 6471541d6d2bc9f2af0ff92b280abbd1d933cf88 moves responsibility
for determining interface/netmask to 10.interface so this should
continue to work just fine.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Fix takeover of incorrectly assigned public IP address
Martin Schwenke [Wed, 3 Aug 2016 01:05:06 +0000 (11:05 +1000)]
ctdb-daemon: Fix takeover of incorrectly assigned public IP address

Cause an "updateip" instead of just logging a message.

This may reset existing connections.  However, CTDB doesn't think the
address should already be hosted on the node so there should be no
connections.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Avoid referencing NULL pointer due to unknown old interface
Martin Schwenke [Fri, 29 Jul 2016 09:48:37 +0000 (19:48 +1000)]
ctdb-daemon: Avoid referencing NULL pointer due to unknown old interface

This doesn't currently happen but it will in a subsequent commit.
That commit and this one could be squashed but then the functional
change gets lost in amongst this one.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoRevert "When adding an ip at runtime, it might not yet have an iface assigned to...
Martin Schwenke [Fri, 29 Jul 2016 09:41:01 +0000 (19:41 +1000)]
Revert "When adding an ip at runtime, it might not yet have an iface assigned to it, so ensure that the next takover_ip call will fall through to accept the ip and add it."

This reverts commit 4136f2714578a9bc0e5632a21d287a50f9ec137a.

If the IP address is on an interface then it won't help to pretend
that it isn't.  This will simply cause a takeip event, which will fail
because the address can't be added.  Note that the IP address isn't
necessarily new - something unexpected may have happened.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-scripts: Add early exit for redundant updateip
Martin Schwenke [Fri, 29 Jul 2016 09:29:23 +0000 (19:29 +1000)]
ctdb-scripts: Add early exit for redundant updateip

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Drop special case handling for new IP already on interface
Martin Schwenke [Wed, 17 Aug 2016 04:43:05 +0000 (14:43 +1000)]
ctdb-daemon: Drop special case handling for new IP already on interface

The address may already be assigned to another node, so this is wrong.
It also leaves the interface unknown.

This is better left to code that handles rogue IP addresses.  A
takeover run should correctly takeover the address if it is assigned
to this node or release it if it is assigned to another node.  Coming
soon...

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Use release_ip_post() when releasing all IP addresses
Martin Schwenke [Thu, 11 Aug 2016 04:07:44 +0000 (14:07 +1000)]
ctdb-daemon: Use release_ip_post() when releasing all IP addresses

This has the advantage of using common code.  Also, if there was
previously a failed attempt to release the IP address as part of a
delete, then this will finish processing the delete.

Extra care needs to be taken when a VNN is actually deleted.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Factor out new function release_ip_post()
Martin Schwenke [Thu, 11 Aug 2016 03:57:43 +0000 (13:57 +1000)]
ctdb-daemon: Factor out new function release_ip_post()

This contains the cleanup that needs to be done after an IP address is
released from an interface.

state->vnn is set to the return value from release_ip_post(), which is
either the original VNN, or NULL if it was deleted.  This allows
correct handling of the in-flight flag in the destructor for state.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Do not copy address for RELEASE_IP message
Martin Schwenke [Thu, 11 Aug 2016 03:41:12 +0000 (13:41 +1000)]
ctdb-daemon: Do not copy address for RELEASE_IP message

If there's an allocation failure then the implicit early return in
CTDB_NO_MEMORY_VOID() means that no reply is sent to the control.
ctdb_daemon_send_message() makes a copy of the data, so don't copy it
here and remove an unnecessary chance of failure.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Do not update the VNN state on RELEASE_IP failure
Martin Schwenke [Sat, 30 Jul 2016 01:12:19 +0000 (11:12 +1000)]
ctdb-daemon: Do not update the VNN state on RELEASE_IP failure

If RELEASE_IP fails then updating the VNN makes it inconsistent with
reality.  Instead, log the failure and move on to the next IP
address.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Try to release IP address even if interface is unknown
Martin Schwenke [Sun, 7 Aug 2016 21:09:38 +0000 (07:09 +1000)]
ctdb-daemon: Try to release IP address even if interface is unknown

The "releaseip" event in 10.interface will determine the interface and
do the right thing.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-common: Save errno before closing file to keep debug accurate
Martin Schwenke [Mon, 15 Aug 2016 05:22:54 +0000 (15:22 +1000)]
ctdb-common: Save errno before closing file to keep debug accurate

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

In the AIX case, also add the close of the file.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tools: Consistently use db_name
Martin Schwenke [Sat, 13 Aug 2016 00:29:24 +0000 (10:29 +1000)]
ctdb-tools: Consistently use db_name

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

CID 1364703: Resource leak (RESOURCE_LEAK)

However, this would already be fixed by the fix for CID 1125618, so
this is probably just a minor bug fix.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tools: Fix CID 1125618 String not null terminated (STRING_NULL)
Martin Schwenke [Sat, 13 Aug 2016 00:29:15 +0000 (10:29 +1000)]
ctdb-tools: Fix CID 1125618 String not null terminated (STRING_NULL)

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-logging: Fix CID 1272823 Unchecked return value from library
Martin Schwenke [Wed, 10 Aug 2016 07:45:35 +0000 (17:45 +1000)]
ctdb-logging: Fix CID 1272823 Unchecked return value from library

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Fix CID 1362723 Unchecked return value from library
Martin Schwenke [Wed, 10 Aug 2016 07:35:22 +0000 (17:35 +1000)]
ctdb-daemon: Fix CID 1362723 Unchecked return value from library

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tcp: Fix CID 1362724 Unchecked return value from library
Martin Schwenke [Wed, 10 Aug 2016 07:31:52 +0000 (17:31 +1000)]
ctdb-tcp: Fix CID 1362724 Unchecked return value from library

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-client: Print error message before next syscall to avoid losing errno
Martin Schwenke [Mon, 15 Aug 2016 04:50:09 +0000 (14:50 +1000)]
ctdb-client: Print error message before next syscall to avoid losing errno

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-client: Fix CID 1362725 Unchecked return value from library
Martin Schwenke [Wed, 10 Aug 2016 07:18:55 +0000 (17:18 +1000)]
ctdb-client: Fix CID 1362725 Unchecked return value from library

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Fix CID 1362726 Unchecked return value from library
Martin Schwenke [Wed, 10 Aug 2016 07:16:34 +0000 (17:16 +1000)]
ctdb-daemon: Fix CID 1362726 Unchecked return value from library

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tcp: Set file descriptor to -1 after close.
Martin Schwenke [Sun, 14 Aug 2016 23:43:46 +0000 (09:43 +1000)]
ctdb-tcp: Set file descriptor to -1 after close.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tcp: Fix CID 1362727 Unchecked return value from library
Martin Schwenke [Wed, 10 Aug 2016 07:12:21 +0000 (17:12 +1000)]
ctdb-tcp: Fix CID 1362727 Unchecked return value from library

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-common: Fix CID 1362728 Unchecked return value from library
Martin Schwenke [Wed, 10 Aug 2016 07:04:45 +0000 (17:04 +1000)]
ctdb-common: Fix CID 1362728 Unchecked return value from library

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-common: Fix CID 1362729 Unchecked return value from library
Martin Schwenke [Thu, 11 Aug 2016 01:15:58 +0000 (11:15 +1000)]
ctdb-common: Fix CID 1362729 Unchecked return value from library

Drop setting socket non-blocking and close-on-exec.  The socket is
closed soon after.  Only a single packet is sent, making it almost
impossible for it to block.  Also, note that sockets aren't setup this
way for IPv6.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tests: Update porting test to be more flexible about line numbers
Martin Schwenke [Wed, 10 Aug 2016 07:02:22 +0000 (17:02 +1000)]
ctdb-tests: Update porting test to be more flexible about line numbers

This way the test doesn't need to be changed every time the code is
moved around.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Fix CID 1125574 Operands don't affect result
Martin Schwenke [Wed, 10 Aug 2016 06:53:54 +0000 (16:53 +1000)]
ctdb-daemon: Fix CID 1125574 Operands don't affect result

Interfaces going up or down are always interesting, so log these at
error level.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Fix CID 1125575 Operands don't affect result
Martin Schwenke [Wed, 10 Aug 2016 06:46:51 +0000 (16:46 +1000)]
ctdb-daemon: Fix CID 1125575 Operands don't affect result

This is related to an error, so repeatedly log at error level instead
of trying to avoid repetition.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-daemon: Fix CID 1272855 Operands don't affect result
Martin Schwenke [Wed, 10 Aug 2016 06:42:13 +0000 (16:42 +1000)]
ctdb-daemon: Fix CID 1272855 Operands don't affect result

Failures are already logged at alert/error level above, so just log
the summary at notice level.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
7 years agoctdb-tools: Drop "ctdb rebalancenode"
Amitay Isaacs [Mon, 15 Aug 2016 05:58:58 +0000 (15:58 +1000)]
ctdb-tools: Drop "ctdb rebalancenode"

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

This was already dropped in commit d67868469521341aa92c589a0bb6df90b150d555.

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): Wed Aug 17 09:22:13 CEST 2016 on sn-devel-144

7 years agoctdb-tools: Drop "ctdb rebalanceip"
Amitay Isaacs [Mon, 15 Aug 2016 05:58:19 +0000 (15:58 +1000)]
ctdb-tools: Drop "ctdb rebalanceip"

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

This was already dropped in commit aaa57fbcb392061f8fbb5a12fd0e6a7be934ab66.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agoctdb-tools: Addition of IPs is deferred until the next takeover run
Amitay Isaacs [Mon, 15 Aug 2016 05:54:51 +0000 (15:54 +1000)]
ctdb-tools: Addition of IPs is deferred until the next takeover run

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

This makes the behaviour of "ctdb addip" similar to "ctdb delip".

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
7 years agos3: vfs: shadow_copy2. Remove any trailing slash when stripping @GMT-YYYY... from...
Jeremy Allison [Tue, 16 Aug 2016 16:43:37 +0000 (09:43 -0700)]
s3: vfs: shadow_copy2. Remove any trailing slash when stripping @GMT-YYYY... from the end of a path.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Aug 17 05:25:30 CEST 2016 on sn-devel-144

7 years agos3: vfs: shadow_copy2: Re-use an existing variable already set to the right value...
Jeremy Allison [Tue, 16 Aug 2016 16:41:43 +0000 (09:41 -0700)]
s3: vfs: shadow_copy2: Re-use an existing variable already set to the right value (p - name).

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
7 years agoidmap: centrally check that unix IDs returned by the idmap backends are in range
Michael Adam [Tue, 9 Aug 2016 16:25:12 +0000 (18:25 +0200)]
idmap: centrally check that unix IDs returned by the idmap backends are in range

Note: in the long run, it might be good to move this kind of
exit check (before handing the result back to the client)
to the parent winbindd code.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Aug 17 01:21:39 CEST 2016 on sn-devel-144

7 years agoidmap: don't generally forbid id==0 from idmap_unix_id_is_in_range()
Michael Adam [Mon, 15 Aug 2016 21:07:33 +0000 (23:07 +0200)]
idmap: don't generally forbid id==0 from idmap_unix_id_is_in_range()

If the range allows it, then id==0 should not be forbidden.
This seems to have been taken in from idmap_ldap when the
function was originally created.

See 634cd2e0451d4388c3e3f78239495cf595368b15 .
The other backends don't seem to have had that
extra check for id == 0.

The reasoning for this change is that the range check should
apply to all cases. If the range includes the 0, then it
should be possible to get it as result. In particular,
this way, the function becomes applicable also to the
passdb backend case, e.g. in a samba4-ad-dc setup where
the Admin gets uid == 0.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
7 years agos3:lib/pthreadpool: fix the build on older systems
Stefan Metzmacher [Fri, 12 Aug 2016 10:15:46 +0000 (12:15 +0200)]
s3:lib/pthreadpool: fix the build on older systems

Some systems required an explicit <signal.h>, which comes
via "system/wait.h"

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Aug 16 19:09:55 CEST 2016 on sn-devel-144

7 years agosmbd: look only at handle readability for COPYCHUNK dest
Uri Simchoni [Fri, 12 Aug 2016 21:19:33 +0000 (00:19 +0300)]
smbd: look only at handle readability for COPYCHUNK dest

This commits sets the stage for a change of behavior
in a later commit.

When checking FILE_READ_DATA on the COPYCHUNK dest handle,
only check the handle readability and not the extra right
that may have been added due to the FILE_EXECUTE right.

The check for FILE_READ_DATA always seemed strange for the
dest handle, which is not read. It turns out that in Windows,
this check is not done at the SMB layer, but at a lower layer
that processes the IOCTL request - the IOCTL code has bits
that specify what type of access check needs to be done.

Therefore, this lower layer is unaware of the SMB layer's
practice of granting READ access based on the FILE_EXECUTE
right, and it only checks the handle's readability.

This subtle difference has observable behavior - the
COPYCHUNK source handle can have FILE_EXECUTE right instead
of FILE_READ_DATA, but the dest handle cannot.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Aug 16 15:21:03 CEST 2016 on sn-devel-144

7 years agos4-smbtorture: pin copychunk exec right behavior
Uri Simchoni [Thu, 4 Aug 2016 10:12:58 +0000 (13:12 +0300)]
s4-smbtorture: pin copychunk exec right behavior

Add tests that show copychunk behavior when the
source and dest handles have execute right instead
of read-data right.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
7 years agoseltest: allow opening files with arbitrary rights in smb2.ioctl tests
Uri Simchoni [Mon, 15 Aug 2016 20:39:50 +0000 (23:39 +0300)]
seltest: allow opening files with arbitrary rights in smb2.ioctl tests

Separate file creation (which requires write access) from the
opening of the file for the test (which might be without write
access).

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
7 years agoseltest: implicit FILE_READ_DATA non-reporting
Uri Simchoni [Sat, 13 Aug 2016 18:23:34 +0000 (21:23 +0300)]
seltest: implicit FILE_READ_DATA non-reporting

This test (passes against Windows Server 2012R2) shows
that the implicit FILE_READ_DATA that is added whenever
FILE_EXECUTE is granted, is not reported back when querying
the handle.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
7 years agos4-selftest: add test for read access check
Uri Simchoni [Sun, 31 Jul 2016 11:29:37 +0000 (14:29 +0300)]
s4-selftest: add test for read access check

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
7 years agos4-selftest: add functions which create with desired access
Uri Simchoni [Sun, 31 Jul 2016 11:26:24 +0000 (14:26 +0300)]
s4-selftest: add functions which create with desired access

Add functions which create a file or a directory with
specific desired access.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
7 years agos4-smbtorture: use standard macros in smb2.read test
Uri Simchoni [Thu, 4 Aug 2016 09:59:38 +0000 (12:59 +0300)]
s4-smbtorture: use standard macros in smb2.read test

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
7 years agosmbd: Fix snapshot query on shares with DFS enabled
Christof Schmitt [Fri, 12 Aug 2016 21:59:07 +0000 (14:59 -0700)]
smbd: Fix snapshot query on shares with DFS enabled

When DFS is enabled (host msdfs = yes and msdfs root = yes), then SMB
clients send create requests in the format \hostname\service\path.
Putting the GMT tag as first element breaks the DFS parsing and results
in OBJECT_NOT_FOUND for snapshotted files.  Fix this by appending the
GMT tag to the end of the path.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Aug 13 05:44:39 CEST 2016 on sn-devel-144

7 years agoselftest: add tests for dfree with inherit owner enabled
Uri Simchoni [Thu, 11 Aug 2016 20:54:22 +0000 (23:54 +0300)]
selftest: add tests for dfree with inherit owner enabled

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoselftest: refactor test_dfree_quota.sh - add share parameter
Uri Simchoni [Wed, 20 Jan 2016 19:54:24 +0000 (21:54 +0200)]
selftest: refactor test_dfree_quota.sh - add share parameter

Add a share parameter to individual disk-free tests. This will
allow running tests on shares other than dfq share.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agosmbd: use owner uid for free disk calculation if owner is inherited
Uri Simchoni [Thu, 11 Aug 2016 20:37:42 +0000 (23:37 +0300)]
smbd: use owner uid for free disk calculation if owner is inherited

If "inherit owner" is enabled, then new files created under a
directory shall consume the quota of the directory's owner, so
the free disk calculation should take that quota into account,
not the quota of the user creating the file.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agosmbd: get a valid file stat to disk_quotas
Uri Simchoni [Wed, 13 Jan 2016 22:09:36 +0000 (00:09 +0200)]
smbd: get a valid file stat to disk_quotas

Most calls to disk_quotas originate at a state with an
open file descriptor. Pass the file's stat info down to
disk_quota, so that we can avoid extra stat's and the related
error handling.

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

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoquotas: small cleanup
Uri Simchoni [Wed, 27 Jan 2016 06:12:20 +0000 (08:12 +0200)]
quotas: small cleanup

Remove an internal function from proto.h

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoctdb: Fix the O3 developer build on RHEL7
Volker Lendecke [Fri, 12 Aug 2016 11:18:19 +0000 (13:18 +0200)]
ctdb: Fix the O3 developer build on RHEL7

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): Sat Aug 13 00:55:02 CEST 2016 on sn-devel-144

7 years agovfs_gpfs: Load nfs4 acl params at tcon time
Volker Lendecke [Tue, 9 Aug 2016 09:38:43 +0000 (11:38 +0200)]
vfs_gpfs: Load nfs4 acl params at tcon time

This reduces user-space CPU for metadata intensive workloads, lp_parm_* is
expensive doing lots of strwicmp.

Signed-off-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 Aug 12 21:03:36 CEST 2016 on sn-devel-144

7 years agonfs4acls: Allow nfs4 acl params to be set by callers
Volker Lendecke [Tue, 9 Aug 2016 09:31:12 +0000 (11:31 +0200)]
nfs4acls: Allow nfs4 acl params to be set by callers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agonfs4acls: Make smbacl4_vfs_params public
Volker Lendecke [Tue, 9 Aug 2016 09:28:30 +0000 (11:28 +0200)]
nfs4acls: Make smbacl4_vfs_params public

vfs_gpfs & others will be able to embed this structure in their special config.

We could have gone with an anonymous struct and a talloc'ed object, but for my
taste this is specialized and hidden enough that it's not worth the
indirection.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agonfs4acls: Add "smbacl4_vfs_params" parameter to smb_set_nt_acl_nfs4
Volker Lendecke [Tue, 9 Aug 2016 09:07:38 +0000 (11:07 +0200)]
nfs4acls: Add "smbacl4_vfs_params" parameter to smb_set_nt_acl_nfs4

Pure placeholder right now, this will allow vfs modules to load the params in
advance

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agonfs4acls: Add "smbacl4_vfs_params" parameter to smb_get_nt_acl_nfs4
Volker Lendecke [Tue, 9 Aug 2016 09:07:38 +0000 (11:07 +0200)]
nfs4acls: Add "smbacl4_vfs_params" parameter to smb_get_nt_acl_nfs4

Pure placeholder right now, this will allow vfs modules to load the params in
advance

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agonfs4acls: Add "smbacl4_vfs_params" parameter to smb_fget_nt_acl_nfs4
Volker Lendecke [Tue, 9 Aug 2016 09:07:38 +0000 (11:07 +0200)]
nfs4acls: Add "smbacl4_vfs_params" parameter to smb_fget_nt_acl_nfs4

Pure placeholder right now, this will allow vfs modules to load the params
in advance. nfs4 acl parameters should not change while a tcon is live,
and lp_parm_get_* show up in profiles. Loading the parameters once at
tcon time will remove this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agonfs4acls: Add some const
Volker Lendecke [Tue, 9 Aug 2016 07:10:19 +0000 (09:10 +0200)]
nfs4acls: Add some const

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agonfs4acls: Remove a typedef
Volker Lendecke [Tue, 9 Aug 2016 07:07:13 +0000 (09:07 +0200)]
nfs4acls: Remove a typedef

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
7 years agoKCC: Fix misnamed variable in DSA object
Douglas Bagnall [Thu, 11 Aug 2016 23:50:07 +0000 (11:50 +1200)]
KCC: Fix misnamed variable in DSA object

Found by Garming. Unlikely to affect anyone.

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

Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Fri Aug 12 08:20:31 CEST 2016 on sn-devel-144

7 years agolib: Use replace.h properly in pthreadpool
Volker Lendecke [Sun, 31 Jul 2016 05:42:21 +0000 (07:42 +0200)]
lib: Use replace.h properly in pthreadpool

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): Fri Aug 12 04:26:09 CEST 2016 on sn-devel-144

7 years agoctdb-pmda: Use 1s timeout for fetching statistics
Amitay Isaacs [Tue, 2 Aug 2016 09:06:10 +0000 (19:06 +1000)]
ctdb-pmda: Use 1s timeout for fetching statistics

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoldb: Fix some signed/unsigned hickups
Volker Lendecke [Thu, 11 Aug 2016 13:46:49 +0000 (15:46 +0200)]
ldb: Fix some signed/unsigned hickups

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Aug 11 23:49:38 CEST 2016 on sn-devel-144

7 years agos3: oplock: Fix race condition when closing an oplocked file.
Jeremy Allison [Wed, 10 Aug 2016 21:42:07 +0000 (14:42 -0700)]
s3: oplock: Fix race condition when closing an oplocked file.

We must send the 'oplock released' message whilst the lock
is held in the close path. Otherwise the messaged smbd can
race with the share mode delete.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 years agosmbd: oplock: Factor out internals of remove_oplock() into new remove_oplock_under_lo...
Jeremy Allison [Wed, 10 Aug 2016 21:39:52 +0000 (14:39 -0700)]
smbd: oplock: Factor out internals of remove_oplock() into new remove_oplock_under_lock().

Allows this to be called elsewhere.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 years agosmbd: oplock: Fixup debug messages inside remove_oplock().
Jeremy Allison [Wed, 10 Aug 2016 21:35:42 +0000 (14:35 -0700)]
smbd: oplock: Fixup debug messages inside remove_oplock().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
7 years agoscript/autobuild.py: include the branch name in the output
Stefan Metzmacher [Wed, 10 Aug 2016 10:44:26 +0000 (12:44 +0200)]
script/autobuild.py: include the branch name in the output

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Aug 11 08:38:47 CEST 2016 on sn-devel-144

7 years agoselftest/flapping: add some samba3.blackbox.smbclient_s3 tests
Stefan Metzmacher [Sat, 6 Aug 2016 08:33:49 +0000 (10:33 +0200)]
selftest/flapping: add some samba3.blackbox.smbclient_s3 tests

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Aug 11 04:42:30 CEST 2016 on sn-devel-144

7 years agoRevert "s4: tests: Skip drs tests."
Stefan Metzmacher [Fri, 5 Aug 2016 20:06:41 +0000 (22:06 +0200)]
Revert "s4: tests: Skip drs tests."

This reverts commit 08d03f79de49826dc5dff3bc09193f1404e5f549.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoselftest: Move repl_schema test to a distinct OID prefix
Andrew Bartlett [Tue, 2 Aug 2016 03:45:18 +0000 (15:45 +1200)]
selftest: Move repl_schema test to a distinct OID prefix

We also take the chance to make it clearer that the number
being passed in should be unique.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
7 years agos4:dsdb/repl_meta_data: Add more info on which DN we failed to find an attid on
Andrew Bartlett [Tue, 2 Aug 2016 02:28:12 +0000 (14:28 +1200)]
s4:dsdb/repl_meta_data: Add more info on which DN we failed to find an attid on

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4:dsdb/repl: let dsdb_replicated_objects_convert() change remote to local attid...
Stefan Metzmacher [Mon, 8 Aug 2016 07:10:48 +0000 (09:10 +0200)]
s4:dsdb/repl: let dsdb_replicated_objects_convert() change remote to local attid for linked attributes

We already do that for objects in dsdb_convert_object_ex().

We need to be consistent and do the same for linked attributes.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4:dsdb/repl: set working_schema->resolving_in_progress during schema creation
Stefan Metzmacher [Mon, 8 Aug 2016 10:11:53 +0000 (12:11 +0200)]
s4:dsdb/repl: set working_schema->resolving_in_progress during schema creation

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4:dsdb/schema: move messages for unknown attids to higher debug levels during resolving
Stefan Metzmacher [Mon, 8 Aug 2016 07:10:13 +0000 (09:10 +0200)]
s4:dsdb/schema: move messages for unknown attids to higher debug levels during resolving

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4:dsdb/schema: split out a dsdb_attribute_drsuapi_remote_to_local() function
Stefan Metzmacher [Mon, 8 Aug 2016 07:10:13 +0000 (09:10 +0200)]
s4:dsdb/schema: split out a dsdb_attribute_drsuapi_remote_to_local() function

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4:dsdb/schema: don't update the in memory schema->prefixmap without reloading the...
Stefan Metzmacher [Mon, 8 Aug 2016 09:22:13 +0000 (11:22 +0200)]
s4:dsdb/schema: don't update the in memory schema->prefixmap without reloading the schema!

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4:dsdb/schema: avoid an implicit prefix map creation in lookup functions
Stefan Metzmacher [Mon, 8 Aug 2016 09:11:20 +0000 (11:11 +0200)]
s4:dsdb/schema: avoid an implicit prefix map creation in lookup functions

dsdb_create_prefix_mapping() should be the only place that calls
dsdb_schema_pfm_make_attid().

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4:dsdb/objectclass_attrs: call dsdb_attribute_from_ldb() without a prefixmap
Stefan Metzmacher [Mon, 8 Aug 2016 11:02:21 +0000 (13:02 +0200)]
s4:dsdb/objectclass_attrs: call dsdb_attribute_from_ldb() without a prefixmap

We may not have a prefix mapping for the new attribute definition,
it will be added later.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4:dsdb/repl: make sure the working_schema prefix map is populated with the remote...
Stefan Metzmacher [Mon, 8 Aug 2016 09:07:18 +0000 (11:07 +0200)]
s4:dsdb/repl: make sure the working_schema prefix map is populated with the remote prefix map

We should create the working_schema prefix map before we try to
resolve the schema. This allows getting the same mapping (if there's not already
a conflict) and allows us to remove the implicit prefix mapping creation
in the prefix mapping lookup functions.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4:dsdb/schema: make dsdb_schema_pfm_add_entry() public and more useful
Stefan Metzmacher [Mon, 8 Aug 2016 09:00:02 +0000 (11:00 +0200)]
s4:dsdb/schema: make dsdb_schema_pfm_add_entry() public and more useful

We allow a hint for the id from the remote prefix map.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4:dsdb/schema: Remove unused old schema from memory
Andrew Bartlett [Thu, 4 Aug 2016 03:25:52 +0000 (15:25 +1200)]
s4:dsdb/schema: Remove unused old schema from memory

This avoids confusion when reading the talloc dump from a ldb context that has
been the target of replication, as the dsdb_schema_copy_shallow() memory was
still around, if unused.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
7 years agos4:dsdb/repl: Improve memory handling in replicated schema code
Andrew Bartlett [Thu, 4 Aug 2016 03:20:27 +0000 (15:20 +1200)]
s4:dsdb/repl: Improve memory handling in replicated schema code

This attempts to make it clear what memory is short term and what memory is long term

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
7 years agos4:dsdb/schema: don't treat an older remote schema as SCHEMA_MISMATCH
Stefan Metzmacher [Thu, 4 Aug 2016 09:00:34 +0000 (11:00 +0200)]
s4:dsdb/schema: don't treat an older remote schema as SCHEMA_MISMATCH

It's perfectly valid to replicate from a partner with an older schema
version, otherwise schema changes would block any other replication
until every dc in the forest has the schema changes.

The avoids an endless loop trying to get schema in sync with the partner.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4:dsdb/schema: store struct dsdb_schema_info instead of a hexstring
Stefan Metzmacher [Thu, 4 Aug 2016 08:03:14 +0000 (10:03 +0200)]
s4:dsdb/schema: store struct dsdb_schema_info instead of a hexstring

This will simplify the schema checking in future.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4:dsdb/repl: avoid recursion after fetching schema changes.
Stefan Metzmacher [Fri, 5 Aug 2016 09:05:37 +0000 (11:05 +0200)]
s4:dsdb/repl: avoid recursion after fetching schema changes.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agos4:dsdb/schema: don't change schema->schema_info on originating schema changes.
Stefan Metzmacher [Thu, 4 Aug 2016 21:04:32 +0000 (23:04 +0200)]
s4:dsdb/schema: don't change schema->schema_info on originating schema changes.

The next reload will take care of it.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoFix a typo in smb.conf man page
Anoop C S [Wed, 10 Aug 2016 14:23:09 +0000 (19:53 +0530)]
Fix a typo in smb.conf man page

Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Aug 10 20:11:54 CEST 2016 on sn-devel-144

7 years agoselftest: add a test for new "inherit owner" option
Uri Simchoni [Wed, 10 Aug 2016 02:00:23 +0000 (05:00 +0300)]
selftest: add a test for new "inherit owner" option

Add a test for the "unix only" option of "inherit owner"
smb.conf parameter.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Wed Aug 10 11:25:52 CEST 2016 on sn-devel-144

7 years agosmbd: add an option to inherit only the UNIX owner
Uri Simchoni [Tue, 2 Aug 2016 06:37:00 +0000 (09:37 +0300)]
smbd: add an option to inherit only the UNIX owner

This can be used to emulate folder quotas, as explained in the
modified manpage.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
7 years agoselftest: add a test for "inherit owner" parameter
Uri Simchoni [Wed, 10 Aug 2016 01:58:45 +0000 (04:58 +0300)]
selftest: add a test for "inherit owner" parameter

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>