1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

104609 Commits

Author SHA1 Message Date
Uri Simchoni
9bbc84ac29 s2-selftest: run shadow_copy2 test both in NT1 and SMB3 modes
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12172

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit c695faa7f94feb8c0a02a9e2f0472af20047bf65)
2016-08-28 18:12:11 +02:00
Jeremy Allison
832886164c s3: libsmb: Add the capability to find a @GMT- path in an SMB2 create and transform to a timewarp token.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12166

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 Aug 22 22:59:22 CEST 2016 on sn-devel-144

(cherry picked from commit 272f5c95cfb3d8035939dada7bd473058c7b6517)
2016-08-28 18:12:11 +02:00
Jeremy Allison
a22c296837 s3: libsmb: Plumb new SMB2 shadow copy call into cli_shadow_copy_data().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12166

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 03bf1f858d1c474f9522cb0f5b264c4f6c2ca5b9)
2016-08-28 18:12:11 +02:00
Jeremy Allison
4dba637ae8 s3: libsmb: Add cli_smb2_shadow_copy_data() function that gets shadow copy info over SMB2.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12166

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 0c6329bc152fcf08fcef385d2f7ee829485eb1a6)
2016-08-28 18:12:11 +02:00
Jeremy Allison
8c0b55439c s3: libsmb: Add return args to clistr_is_previous_version_path().
Not yet used - we will use these to construct the SMB2 TWrp blob.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 14fd6dca4ef33ee85a2f8578f1ad608d6056da1f)
2016-08-28 18:12:11 +02:00
Jeremy Allison
b755e66ee5 s3: libsmb: Correctly align create contexts in a create call.
SMB2 shadow copy requests are the first time we've used
create contexts in anger in this codepath. This took me
longer than I'd like to admit to find :-).

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit f8caadfc78a15fa3aefc9ef6249195767c47aa8f)
2016-08-28 18:12:11 +02:00
Jeremy Allison
38baf4b594 s3: smbclient. Ensure we don't crash by freeing uninitialized *snapshots.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit cb687a6af0a498676268874ab25b19a6b0764915)
2016-08-28 18:12:11 +02:00
Jeremy Allison
b5bb91aa97 s3: smbclient: In order to get shadow copy data over SMB1 we must call cli_shadow_copy_data() twice.
Once with 'get_names = false' to get the size, then again with 'get_names = true'
to get the data or a Windows server fails to return valid info. Samba doesn't have this bug.

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

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

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Fri Aug 19 23:59:35 CEST 2016 on sn-devel-144

(cherry picked from commit 57a54af66f414708d5c02f346f08bc4bfd55349d)
2016-08-28 18:12:11 +02:00
Jeremy Allison
bab467dc48 s3: libsmb: Do some hardening in the receive processing of cli_shadow_copy_data_recv().
Protect against malicious servers.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 336da637541fba13586af6fc2cb9d143d656e87e)
2016-08-28 18:12:11 +02:00
Jeremy Allison
8d7f69db40 s3: libsmb: Correctly set max_setup_size in FSCTL_GET_SHADOW_COPY_DATA nttrans ioctl.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit a9fe27e17ce55461946037bb25a432da340095ab)
2016-08-28 18:12:11 +02:00
Jeremy Allison
1d59274f98 s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_list_trans_send().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 0b252d7c6fdd963308fff8938a8be185892afbbe)
2016-08-28 18:12:11 +02:00
Jeremy Allison
82566562b2 s3: libsmb: Make a comment note that cli_set_ea() needs some internal changes before cli_set_ea_path() can use previous path versions.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit e4a261c6c826a2be75bcd9d6af8232f043acc5f1)
2016-08-28 18:12:11 +02:00
Jeremy Allison
48550cc8ad s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_ctemp_send().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 97cde5dc92185f188868ddd71287d43ddae30516)
2016-08-28 18:12:11 +02:00
Jeremy Allison
4200c31778 s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_chkpath_send().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit e2d70551e1ba13119d53afaa00f05e70897484f0)
2016-08-28 18:12:11 +02:00
Jeremy Allison
bff49802ad s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_setatr_send().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 00551d73063b46d3dd2740951a2a8f1b2e351f79)
2016-08-28 18:12:10 +02:00
Jeremy Allison
4276ffbab4 s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_getatr_send().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 461000c8812a99a81a9f3fc87f93c1b7c67f42bd)
2016-08-28 18:12:10 +02:00
Jeremy Allison
ce5acbf390 s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_openx_create().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 47c1314429cdf516358d5e00ca24c313ddab67b0)
2016-08-28 18:12:10 +02:00
Jeremy Allison
c98a801e8f s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_nttrans_create_send().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit d7ee917b165da2695433b7b115363223f2bd214f)
2016-08-28 18:12:10 +02:00
Jeremy Allison
e702d6af8c s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_ntcreate1_send().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit cd4a60bb1f84891763617f96de148068e0492773)
2016-08-28 18:12:10 +02:00
Jeremy Allison
30c97b3084 s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_rmdir_send()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 17d1f19eda2c735fcb10a389c3681ccd385bb9c7)
2016-08-28 18:12:10 +02:00
Jeremy Allison
028f181035 s3: libsmb: s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_mkdir_send().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 3081604734a9531cefa71d0417a6fbfee9a6a8b6)
2016-08-28 18:12:10 +02:00
Jeremy Allison
a271db6064 s3: libsmb: s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_unlink_send().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 3242a0b9f0ae0d51110dc6542195af1be91aeece)
2016-08-28 18:12:10 +02:00
Jeremy Allison
663c35ddbe s3: libsmb: s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_ntrename_internal_send().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit c2a1905abd5d8756dd4afdd3116d311b1dec1246)
2016-08-28 18:12:10 +02:00
Jeremy Allison
fe2f658e4e s3: libsmb: s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_rename_send().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit ae7047923e756d7ee1d760b7495560c25c71b523)
2016-08-28 18:12:10 +02:00
Jeremy Allison
87a1a1acb6 s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_qpathinfo_send()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 21a7bf428bb8ed5b5634b87896bf0aa6c095d7f6)
2016-08-28 18:12:10 +02:00
Jeremy Allison
f570cda95a s3: libsmb: Plumb in additional_flags2 = FLAGS2_REPARSE_PATH to cli_setpathinfo_send().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 75e4290b6055cf95fc4730c4fa431bcc91eed203)
2016-08-28 18:12:10 +02:00
Jeremy Allison
6f1ae6a3dc s3: libsmb: Add clistr_is_previous_version_path()
Looks for @GMT- token in pathname.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 19696f3494bd944ac9226aeebebb7a00df6f53b4)
2016-08-28 18:12:10 +02:00
Jeremy Allison
c74aa87523 s3: libsmb: Add uint16_t addtional_flags2 to cli_smb_req_create().
Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 79c8b756715d021f12474a12eca1efb596f92a84)
2016-08-28 18:12:10 +02:00
Jeremy Allison
050673dc89 s3: libsmb: Add uint16_t addtional_flags2 to cli_trans_send().
Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 76bbc4c0c338a021e10f3d2de2f6c58b4ee81169)
2016-08-28 18:12:10 +02:00
Jeremy Allison
ac64b26f83 s3: libsmb: Add uint16_t additional_flags2 arg to cli_smb_send().
Not yet used.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit a876f915fd2cddc96e6044c0a73c87153445baf6)
2016-08-28 18:12:10 +02:00
Jeremy Allison
cccf74e608 s3: SMB1: Add missing FLAGS2 definitions from MS-SMB.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
(cherry picked from commit 66650e67698ed2ed2c1e604343d4209e84f58032)
2016-08-28 18:12:10 +02:00
Jeremy Allison
598327abcf 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

(cherry picked from commit b21308252eb409bad6089cc0f09fada0229d33e8)
2016-08-28 18:12:09 +02:00
Jeremy Allison
b4a05b1f88 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>
(cherry picked from commit 3e3b9be948d873696a1ab9c0cb859bd8911165f0)
2016-08-28 18:12:09 +02:00
Jeremy Allison
e5baf884ef 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>
(cherry picked from commit abf18f42dc398f5f17088de87fd0e681fd44ebeb)
2016-08-28 18:12:09 +02:00
Jeremy Allison
4b266772a3 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

(cherry picked from commit 639063da8c5077170bfe2dc4d3a69c3219a4f6a1)
2016-08-28 18:12:09 +02:00
Jeremy Allison
1901c9e7da 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>
(cherry picked from commit 6245f2c042da55c71086e1d40186b11964ddeba8)
2016-08-28 18:12:09 +02:00
Christof Schmitt
ad835cff55 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

(cherry picked from commit f1b42ec778e08875e076df7fdf67dd69bf9b2757)
2016-08-28 18:12:09 +02:00
Douglas Bagnall
74fa37acf0 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

(cherry picked from commit e7ad8727be6d947f31ca2ca9bfee81b2a34f25a5)
2016-08-28 18:12:09 +02:00
Martin Schwenke
eb55718e1b ctdb-tests: Reimplement daemons_stop() using ctdbd_wrapper
The current daemons_stop() implementation uses very loose matching to
decide which processes to kill if "ctdb shutdown" hasn't worked within
1 second.  This can cause ctdbd processes from other test runs to be
killed.

Instead, use ctdbd_wrapper, which uses the PID file as a last resort.
This has the advantage of never killing ctdbd processes from other
test runs.  However, this also has the obvious consequence that an
interrupted test run in one directory can not have its daemons cleaned
up from a new test run in a different directory.

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

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 Aug 23 21:17:46 CEST 2016 on sn-devel-144

(cherry picked from commit 17dfd8b96bc1750a2f435caa1d208766257346f3)

Autobuild-User(v4-5-test): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(v4-5-test): Wed Aug 24 15:35:51 CEST 2016 on sn-devel-144
2016-08-24 15:35:51 +02:00
Martin Schwenke
c0dba4948c ctdb-tests: Remove function daemons_start_1()
This function doesn't do anything significant, so just unroll the body
into the loop in daemons_start().

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit bcb33c46dfe3d6c06eb6b3b5e7f8625538772d5e)
2016-08-24 11:42:31 +02:00
Martin Schwenke
207085031f ctdb-tests: Move local daemon configuration creation into setup_ctdb()
These files don't need to be re-generated on every restart.  They can
be generated once when CTDB is first started.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 3c87868d208de8928e25db1dd34266830f017a07)
2016-08-24 11:42:31 +02:00
Martin Schwenke
e281108840 ctdb-tests: Drop attempts to pass arguments to ctdbd on (re)start
This is not used.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit eb38d02eb77dd654c8ed79fe985f738431918c9f)
2016-08-24 11:42:31 +02:00
Martin Schwenke
f4618fca56 ctdb-tests: Drop function _ctdb_hack_options()
It does something special if the --start-as-stopped option is given
and is not used in any tests.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit fd443b8cce4dedfe9a72f25e955274f66da41290)
2016-08-24 11:42:31 +02:00
Martin Schwenke
18334fd214 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

(cherry picked from commit 626dcc9e493e2ac4fd502f75c7cb4d29f686f017)
2016-08-24 11:42:31 +02:00
Martin Schwenke
46890c52e6 ctdb-daemon: When releasing an IP, update PNN in callback
When an error occurs so an IP address is not released then the PNN in
the VNN is currently incorrectly updated.

Instead, update the PNN in the callback when the release is
successful.  Also, explicitly update the PNN on redundant releases.

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>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Sun Aug 21 22:45:33 CEST 2016 on sn-devel-144

(cherry picked from commit 6dc75c7d24325d2070eb7feab5399dbfda50da96)
2016-08-24 11:42:31 +02:00
Martin Schwenke
2a9566f27f ctdb-daemon: Rename takeover_callback_state -> release_ip_callback_state
Many years ago takeover_callback_state was used for both IP takeover
and release.  Now it is only used when releasing an IP so rename it to
improve clarity.

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>
(cherry picked from commit 976a50af6f045765c7bf1961e26efc3cba17f3ba)
2016-08-24 11:42:31 +02:00
Martin Schwenke
65445d5503 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>
(cherry picked from commit d2a91394f55a2e0152bf470dac2608618db13b1f)
2016-08-24 11:42:30 +02:00
Martin Schwenke
5fa6a1dfb0 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>
(cherry picked from commit 46c5136e4e4bd291cbb96395374c9b133f5d8ad8)
2016-08-24 11:42:30 +02:00
Martin Schwenke
c80c2cf16e 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>
(cherry picked from commit e653c8bb4a7bd712351a4ead3997c61b22c46f8d)
2016-08-24 11:42:30 +02:00
Martin Schwenke
5e4db43c54 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>
(cherry picked from commit ca22373231918dab4e94cf1bab03253aadd61993)
2016-08-24 11:42:30 +02:00