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

2018-11-07 Thread Karolin Seeger
The branch, v4-9-test has been updated
   via  424d4d2 VERSION: Bump version up to 4.9.3...
   via  865cc28 VERSION: Disable GIT_SNAPSHOT for the 4.9.2 release.
   via  f8c0389 WHATSNEW: Add release notes for Samba 4.9.2.
  from  1a3b20d selftest: Run smb2.delete-on-close-perms also with "delete 
readonly = yes"

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


- Log -
commit 424d4d2b4084e8778d82684d29514b5b45cdfd36
Author: Karolin Seeger 
Date:   Thu Nov 8 08:56:10 2018 +0100

VERSION: Bump version up to 4.9.3...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Karolin Seeger 

commit 865cc283d1b2c7ae3cf504b541e5a36248291095
Author: Karolin Seeger 
Date:   Thu Nov 8 08:55:24 2018 +0100

VERSION: Disable GIT_SNAPSHOT for the 4.9.2 release.

Signed-off-by: Karolin Seeger 

commit f8c0389369efecff23d6ffa9fec9b10e62e7da0b
Author: Karolin Seeger 
Date:   Thu Nov 8 08:54:49 2018 +0100

WHATSNEW: Add release notes for Samba 4.9.2.

Signed-off-by: Karolin Seeger 

---

Summary of changes:
 VERSION  |  2 +-
 WHATSNEW.txt | 98 ++--
 2 files changed, 97 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index 260d63f..210dbed 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
 
 SAMBA_VERSION_MAJOR=4
 SAMBA_VERSION_MINOR=9
-SAMBA_VERSION_RELEASE=2
+SAMBA_VERSION_RELEASE=3
 
 
 # If a official release has a serious bug  #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 0742d7d..978502e 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,4 +1,98 @@
=
+   Release Notes for Samba 4.9.2
+ November 08, 2018
+   =
+
+
+This is the latest stable release of the Samba 4.9 release series.
+
+
+Changes since 4.9.1:
+
+
+o  Andrew Bartlett 
+   * BUG 13418: dsdb: Add comments explaining the limitations of our current
+ backlink behaviour.
+   * BUG 13621: Fix problems running domain backups (handling SMBv2, sites).
+
+o  Tim Beale 
+   * BUG 13621: Fix problems running domain backups (handling SMBv2, sites).
+
+o  Ralph Boehme 
+   * BUG 13465: testparm: Fix crashes with PANIC: Messaging not initialized on
+ SLES 12 SP3.
+   * BUG 13642: Make vfs_fruit able to cleanup AppleDouble files.
+   * BUG 13646: File saving issues with vfs_fruit on samba >= 4.8.5.
+   * BUG 13649: Enabling vfs_fruit looses FinderInfo.
+   * BUG 13667: Cancelling of SMB2 aio reads and writes returns wrong error
+ NT_STATUS_INTERNAL_ERROR.
+
+o  Amitay Isaacs 
+   * BUG 13641: Fix CTDB recovery record resurrection from inactive nodes and
+ simplify vacuuming.
+
+o  Volker Lendecke 
+   * BUG 13465: examples: Fix the smb2mount build.
+   * BUG 13629: libtevent: Fix build due to missing open_memstream on Illiumos.
+   * BUG 13662: winbindd_cache: Fix timeout calculation for sid<->name cache.
+
+o  Gary Lockyer 
+   * BUG 13653: dsdb encrypted_secrets: Allow "ldb:// and "mdb://" in file 
path.
+
+o  Stefan Metzmacher 
+   * BUG 13418: Extended DN SID component missing for member after switching
+ group membership.
+   * BUG 13624: Return STATUS_SESSION_EXPIRED error encrypted, if the request
+ was encrypted.
+
+o  David Mulder 
+   * BUG 13621: python: Allow forced signing via smb.SMB().
+   * BUG 13665: lib:socket: If returning early, set ifaces.
+
+o  Noel Power 
+   * BUG 13616: ldb: Bump ldb version to 1.4.3, Python: Ensure ldb.Dn can 
accept
+ utf8 encoded unicode.
+
+o  Christof Schmitt 
+   * BUG 13465: testparm: Fix crashes with PANIC: Messaging not initialized on
+ SLES 12 SP3.
+   * BUG 13673: smbd: Fix DELETE_ON_CLOSE behaviour on files with READ_ONLY
+ attribute.
+
+o  Andreas Schneider 
+   * BUG 13601: waf: Add -fstack-clash-protection.
+   * BUG 13668: winbind: Fix segfault if an invalid passdb backend is
+ configured.
+
+o  Martin Schwenke 
+   * BUG 13659: Fix bugs in CTDB event handling.
+   * BUG 13670: Misbehaving nodes are sometimes not banned.
+
+
+###
+Reporting bugs & Development Discussion
+###
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical IRC channel on irc.freenode.net.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored.  All bug reports should
+be filed under the "Samba 4.1 and newer" product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+

[SCM] Samba Shared Repository - branch master updated

2018-11-07 Thread Andrew Bartlett
The branch, master has been updated
   via  e650c40 WHATSNEW: NETLOGON prefork support
   via  58c4490 source4 smdb rpc_server: Support prefork process model.
   via  b003134e source4 smbd: pass instance number to post_fork
   via  b543563 WHATSNEW: 'prefork children' default
   via  700b4ce source4 smbd prefork: Increase default worklers to 4
   via  de1f497 autobuild: make ad_dc use prefork process model
   via  a0b5f4b traffic_replay: Rework machine accounts to remove redundant 
code
   via  1d7fb66 traffic_replay: Make packet generation work on a 
pre-populated DB again
   via  c7fe481 traffic_replay: Make sure naming assumptions are in a 
single place
   via  51917fc traffic_replay: Move 'traffic account' flag up a level
   via  85b6d88 traffic_replay: Move machine account creation
   via  fd089c3 samba-tool gpo: convert pseudo-method into method
   via  94610330 samba-tool gpo: add helper method for tmpdir construction
   via  e3320b6 samba-tool gpo: do not use predictable temp directory
   via  a9682f9 python/upgradehelpers: use mkstemp, not mktemp
  from  3ca1399 selftest: Add some more testenv descriptions

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


- Log -
commit e650c40e11401f5ff8477292a46f14dfd06a2a29
Author: Gary Lockyer 
Date:   Wed Sep 19 15:04:35 2018 +1200

WHATSNEW: NETLOGON prefork support

Signed-off-by: Gary Lockyer 
Reviewed-by: Andrew Bartlett 

Autobuild-User(master): Andrew Bartlett 
Autobuild-Date(master): Wed Nov  7 21:17:59 CET 2018 on sn-devel-144

commit 58c4490e24c2a0429052e131ba8022c58ea02ecf
Author: Gary Lockyer 
Date:   Wed Aug 29 15:07:32 2018 +1200

source4 smdb rpc_server: Support prefork process model.

Allow the rpc_server to run in the prefork process model. Due to the use
of shared handles and resources all of the rpc end points are serviced
in the first worker process. Those end points that can be run in
multiple processes (currently only Netlogon and management) are serviced in
the first and any subsequent workers.

Signed-off-by: Gary Lockyer 
Reviewed-by: Andrew Bartlett 

commit b003134e0d1cdc235e00a602edd2e745233f98b8
Author: Gary Lockyer 
Date:   Wed Aug 29 13:16:08 2018 +1200

source4 smbd: pass instance number to post_fork

Pass the instance number to the post_fork hook. This is required to
allow the rpc_server to support the prefork process model.

Signed-off-by: Gary Lockyer 
Reviewed-by: Andrew Bartlett 

commit b543563ddf46e776fa4996fa4e4635684076cf80
Author: Gary Lockyer 
Date:   Wed Sep 19 15:13:49 2018 +1200

WHATSNEW: 'prefork children' default

Signed-off-by: Gary Lockyer 
Reviewed-by: Andrew Bartlett 

commit 700b4ce98163b4840bbcc7ec7c9bbc070ab8b143
Author: Gary Lockyer 
Date:   Wed Sep 5 13:59:34 2018 +1200

source4 smbd prefork: Increase default worklers to 4

Increase the default number of worker processes started by the pre-fork
process model from 1 to 4.

Signed-off-by: Gary Lockyer 
Reviewed-by: Andrew Bartlett 

commit de1f49752cd2a7c8d7f015785af1d3529753dacf
Author: Gary Lockyer 
Date:   Tue Aug 28 15:26:03 2018 +1200

autobuild: make ad_dc use prefork process model

Convert the ad_dc environment from single process model to the prefork
process model.

Signed-off-by: Gary Lockyer 
Reviewed-by: Andrew Bartlett 

commit a0b5f4b7b05b8ea2bf061b8af5b702aa14a7a5a5
Author: Tim Beale 
Date:   Tue Nov 6 11:27:42 2018 +1300

traffic_replay: Rework machine accounts to remove redundant code

generate_users_and_groups() now generates the machine acounts as well as
the user accounts, so it seems there's no need to also have
generate_traffic_accounts(), which does the same job.

Instead, we can just pass through the number of machine acounts to
generate_users_and_groups() and delete the other function.

Also updated generate_users_and_groups() so that machine_accounts is
no longer optional (we want to create machine accounts in all cases).

Signed-off-by: Tim Beale 
Reviewed-by: Andrew Bartlett 

commit 1d7fb66f7630a994dbb261ce417c26d17b409593
Author: Tim Beale 
Date:   Tue Nov 6 11:14:41 2018 +1300

traffic_replay: Make packet generation work on a pre-populated DB again

Generate separate machine accounts for populating a large DB vs
replaying network traffic.

We want to use different userAccountControl flags in each of the above
cases (i.e. commit 3338a3e257fa9f28). However, this means that once you
use the --generate-users-only option, you can't replay network packets
against the machine accounts.

We can avoid this problem by creating separate machine accounts for each
of 2 different cases, e.g. STGM-0-x machines for traffic-replay, and

[SCM] Socket Wrapper Repository - branch master updated

2018-11-07 Thread Andreas Schneider
The branch, master has been updated
   via  299af4a gitlab-ci: Add csbuild
   via  8609a8e tests: Protect IPv6 in st_echo_tcp_get_peer_sock_name
   via  28aeac8 cmake: SWRAP_REQUIRED_LIBRARIES should be a list
   via  dfeb05d cmake: Set LINK_FLAGS for echo_srv
   via  cdf557d cmake: Set LINK_FLAGS for socket_wrapper
   via  51fcd0a cmake: Only set default flags if they have been detected
   via  d9a6ecb cmake: Disable stack protector on Solaris
  from  efbb27d gitlab-ci: Enable freebsd runner

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


- Log -
commit 299af4a68ac51dd86143d3c4750b2571e98bcc58
Author: Andreas Schneider 
Date:   Wed Nov 7 08:31:50 2018 +0100

gitlab-ci: Add csbuild

Signed-off-by: Andreas Schneider 
Reviewed-by: Ralph Boehme 

commit 8609a8eb39a097b47081f34fc9197b9a33d0c2c8
Author: Andreas Schneider 
Date:   Wed Nov 7 09:05:30 2018 +0100

tests: Protect IPv6 in st_echo_tcp_get_peer_sock_name

Signed-off-by: Andreas Schneider 
Reviewed-by: Ralph Boehme 

commit 28aeac863cd829783aca1281ecde274266e40f09
Author: Andreas Schneider 
Date:   Wed Nov 7 09:02:35 2018 +0100

cmake: SWRAP_REQUIRED_LIBRARIES should be a list

Signed-off-by: Andreas Schneider 
Reviewed-by: Ralph Boehme 

commit dfeb05d87bac0d81f2676fbc22430bd0018eaa49
Author: Andreas Schneider 
Date:   Wed Nov 7 09:14:40 2018 +0100

cmake: Set LINK_FLAGS for echo_srv

Signed-off-by: Andreas Schneider 
Reviewed-by: Ralph Boehme 

commit cdf557dbca4df47301922c6304269f874236c759
Author: Andreas Schneider 
Date:   Wed Nov 7 09:13:26 2018 +0100

cmake: Set LINK_FLAGS for socket_wrapper

Signed-off-by: Andreas Schneider 
Reviewed-by: Ralph Boehme 

commit 51fcd0af8a7017aea779b8516d7520df20bec454
Author: Andreas Schneider 
Date:   Wed Nov 7 09:25:54 2018 +0100

cmake: Only set default flags if they have been detected

Signed-off-by: Andreas Schneider 
Reviewed-by: Ralph Boehme 

commit d9a6ecb148ae6fe485e8b7416cd5b8265e22804f
Author: Andreas Schneider 
Date:   Wed Nov 7 09:27:38 2018 +0100

cmake: Disable stack protector on Solaris

They don't work.

Signed-off-by: Andreas Schneider 
Reviewed-by: Ralph Boehme 

---

Summary of changes:
 .gitlab-ci.yml   | 31 ++
 CompilerChecks.cmake | 44 ++--
 ConfigureChecks.cmake|  1 -
 src/CMakeLists.txt   | 19 +++---
 tests/CMakeLists.txt |  5 
 tests/test_echo_tcp_get_peer_sock_name.c | 15 +++
 6 files changed, 86 insertions(+), 29 deletions(-)


Changeset truncated at 500 lines:

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 00b4576..a2bb099 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -77,6 +77,37 @@ fedora/undefined-sanitizer:
 paths:
   - obj/
 
+fedora/csbuild:
+  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
+  script:
+  - |
+if [[ -z "$CI_COMMIT_BEFORE_SHA" ]]; then
+export CI_COMMIT_BEFORE_SHA=$(git rev-parse HEAD^)
+fi
+
+# Check if the commit exists in this branch
+# This is not the case for a force push
+git branch --contains $CI_COMMIT_BEFORE_SHA 2>/dev/null || export 
CI_COMMIT_BEFORE_SHA=$(git rev-parse HEAD^)
+
+export CI_COMMIT_RANGE="$CI_COMMIT_BEFORE_SHA..$CI_COMMIT_SHA"
+
+  - csbuild
+--build-dir=obj-csbuild
+--prep-cmd="cmake -DCMAKE_BUILD_TYPE=Debug -DPICKY_DEVELOPER=ON 
-DUNIT_TESTING=ON @SRCDIR@"
+--build-cmd "make clean && make -j$(nproc)"
+--git-commit-range $CI_COMMIT_RANGE
+--color
+--print-current --print-fixed
+  tags:
+  - shared
+  except:
+  - tags
+  artifacts:
+expire_in: 1 week
+when: on_failure
+paths:
+  - obj-csbuild/
+
 freebsd/x86_64:
   image:
   script:
diff --git a/CompilerChecks.cmake b/CompilerChecks.cmake
index f5a3c7f..4fa1a83 100644
--- a/CompilerChecks.cmake
+++ b/CompilerChecks.cmake
@@ -65,27 +65,29 @@ if (UNIX)
 endif()
 endif()
 
-check_c_compiler_flag_ssp("-fstack-protector-strong" 
WITH_STACK_PROTECTOR_STRONG)
-if (WITH_STACK_PROTECTOR_STRONG)
-list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector-strong")
-# This is needed as Solaris has a seperate libssp
-if (SOLARIS)
-list(APPEND SUPPORTED_LINKER_FLAGS "-fstack-protector-strong")
-endif()
-else (WITH_STACK_PROTECTOR_STRONG)
-check_c_compiler_flag_ssp("-fstack-protector" WITH_STACK_PROTECTOR)
-if (WITH_STACK_PROTECTOR)
-list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector")
+if (NOT SOLARIS)
+check_c_compiler_flag_ssp("-fstack-protector-strong" 
WITH_STACK_PROTECTOR_STRONG)
+if (WITH_STACK_PROTECTOR_STRONG)
+   

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

2018-11-07 Thread Karolin Seeger
The branch, v4-8-test has been updated
   via  0929829 selftest: Run smb2.delete-on-close-perms also with "delete 
readonly = yes"
   via  ab041bf selftest: Add share to test "delete readonly" option
   via  d60ad01 smbd: Fix DELETE_ON_CLOSE behaviour on files with READ_ONLY 
attribute
   via  e674f23 smbtorture: Add test for DELETE_ON_CLOSE on files with 
READ_ONLY attribute
  from  b51ef80 torture: Fix the clang build

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


- Log -
commit 092982982004d44b97ae5c1b29209ef0a972c8fe
Author: Christof Schmitt 
Date:   Fri Nov 2 12:07:58 2018 -0700

selftest: Run smb2.delete-on-close-perms also with "delete readonly = yes"

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

Signed-off-by: Christof Schmitt 
Reviewed-by: Jeremy Allison 

Autobuild-User(master): Christof Schmitt 
Autobuild-Date(master): Sat Nov  3 05:55:45 CET 2018 on sn-devel-144

(cherry picked from commit 7dd3585f9c3ae04df45d98bfdc62663c7a69d3e0)

Autobuild-User(v4-8-test): Karolin Seeger 
Autobuild-Date(v4-8-test): Wed Nov  7 13:19:41 CET 2018 on sn-devel-144

commit ab041bf534629708cfa86322e5ca8ab12d4847ad
Author: Christof Schmitt 
Date:   Fri Nov 2 12:03:51 2018 -0700

selftest: Add share to test "delete readonly" option

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

Signed-off-by: Christof Schmitt 
Reviewed-by: Jeremy Allison 
(cherry picked from commit a8e79decbcfbae1b1a53ec81b942ee06db26bf8f)

commit d60ad0171a09b57667ac0888ce95f22dd16d7630
Author: Christof Schmitt 
Date:   Fri Nov 2 12:08:23 2018 -0700

smbd: Fix DELETE_ON_CLOSE behaviour on files with READ_ONLY attribute

MS-FSA states that a CREATE with FILE_DELETE_ON_CLOSE on an existing
file with READ_ONLY attribute has to return STATUS_CANNOT_DELETE. This
was missing in smbd as the check used the DOS attributes from the CREATE
instead of the DOS attributes on the existing file.

We need to handle the new file and existing file cases separately.

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

Signed-off-by: Christof Schmitt 
Reviewed-by: Jeremy Allison 
(cherry picked from commit 162a5257c48f20d3752f644e86c9e626b46436c0)

commit e674f23a10662e0dc04630d1f548585258008c32
Author: Christof Schmitt 
Date:   Fri Nov 2 10:49:53 2018 -0700

smbtorture: Add test for DELETE_ON_CLOSE on files with READ_ONLY attribute

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

Signed-off-by: Christof Schmitt 
Reviewed-by: Jeremy Allison 
(cherry picked from commit dc9bbbe4141d8425e66fe9290ff611845f4bd1ce)

---

Summary of changes:
 selftest/target/Samba3.pm  |   4 ++
 source3/selftest/tests.py  |   4 ++
 source3/smbd/open.c|  30 ++---
 source4/torture/smb2/delete-on-close.c | 119 +
 4 files changed, 149 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 968c6aa..3747a1e 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -2231,6 +2231,10 @@ sub provision($)
vfs objects = delay_inject
delay_inject:pread_send = 2000
delay_inject:pwrite_send = 2000
+
+[delete_readonly]
+   path = $prefix_abs/share
+   delete readonly = yes
";
close(CONF);
 
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 0407e36..a6de080 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -579,6 +579,10 @@ for t in tests:
 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/streams_xattr 
-U$USERNAME%$PASSWORD', 'streams_xattr')
 elif t == "smb2.aio_delay":
 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/aio_delay_inject 
-U$USERNAME%$PASSWORD')
+elif t == "smb2.delete-on-close-perms":
+plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp 
-U$USERNAME%$PASSWORD')
+plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/delete_readonly 
-U$USERNAME%$PASSWORD --option=torture:delete_readonly=true')
+plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp 
-U$USERNAME%$PASSWORD')
 else:
 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp 
-U$USERNAME%$PASSWORD')
 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp 
-U$USERNAME%$PASSWORD')
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 8a9288d..97cf458 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -3237,6 +3237,18 @@ static NTSTATUS open_file_ntcreate(connection_struct 
*conn,
request_time = fsp->open_time;
}
 
+   if ((create_options & FILE_DELETE_ON_CLOSE) &&
+  

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

2018-11-07 Thread Karolin Seeger
The branch, v4-9-test has been updated
   via  1a3b20d selftest: Run smb2.delete-on-close-perms also with "delete 
readonly = yes"
   via  380badf selftest: Add share to test "delete readonly" option
   via  03518d2 smbd: Fix DELETE_ON_CLOSE behaviour on files with READ_ONLY 
attribute
   via  9603a09 smbtorture: Add test for DELETE_ON_CLOSE on files with 
READ_ONLY attribute
  from  2dd3c33 torture: Fix the clang build

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


- Log -
commit 1a3b20d0b33e020ea43f9a433767d998cb4a0ef8
Author: Christof Schmitt 
Date:   Fri Nov 2 12:07:58 2018 -0700

selftest: Run smb2.delete-on-close-perms also with "delete readonly = yes"

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

Signed-off-by: Christof Schmitt 
Reviewed-by: Jeremy Allison 

Autobuild-User(master): Christof Schmitt 
Autobuild-Date(master): Sat Nov  3 05:55:45 CET 2018 on sn-devel-144

(cherry picked from commit 7dd3585f9c3ae04df45d98bfdc62663c7a69d3e0)

Autobuild-User(v4-9-test): Karolin Seeger 
Autobuild-Date(v4-9-test): Wed Nov  7 11:44:24 CET 2018 on sn-devel-144

commit 380badf80fb5df41e8e0293a63f3508f92671d53
Author: Christof Schmitt 
Date:   Fri Nov 2 12:03:51 2018 -0700

selftest: Add share to test "delete readonly" option

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

Signed-off-by: Christof Schmitt 
Reviewed-by: Jeremy Allison 
(cherry picked from commit a8e79decbcfbae1b1a53ec81b942ee06db26bf8f)

commit 03518d2ff2cb8cf45052a3ddb710df2bf321881d
Author: Christof Schmitt 
Date:   Fri Nov 2 12:08:23 2018 -0700

smbd: Fix DELETE_ON_CLOSE behaviour on files with READ_ONLY attribute

MS-FSA states that a CREATE with FILE_DELETE_ON_CLOSE on an existing
file with READ_ONLY attribute has to return STATUS_CANNOT_DELETE. This
was missing in smbd as the check used the DOS attributes from the CREATE
instead of the DOS attributes on the existing file.

We need to handle the new file and existing file cases separately.

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

Signed-off-by: Christof Schmitt 
Reviewed-by: Jeremy Allison 
(cherry picked from commit 162a5257c48f20d3752f644e86c9e626b46436c0)

commit 9603a098a16aabd01ce053a6b3119f757994e285
Author: Christof Schmitt 
Date:   Fri Nov 2 10:49:53 2018 -0700

smbtorture: Add test for DELETE_ON_CLOSE on files with READ_ONLY attribute

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

Signed-off-by: Christof Schmitt 
Reviewed-by: Jeremy Allison 
(cherry picked from commit dc9bbbe4141d8425e66fe9290ff611845f4bd1ce)

---

Summary of changes:
 selftest/target/Samba3.pm  |   4 ++
 source3/selftest/tests.py  |   4 ++
 source3/smbd/open.c|  30 ++---
 source4/torture/smb2/delete-on-close.c | 119 +
 4 files changed, 149 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 50f579a..438cb34 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -2207,6 +2207,10 @@ sub provision($)
vfs objects = delay_inject
delay_inject:pread_send = 2000
delay_inject:pwrite_send = 2000
+
+[delete_readonly]
+   path = $prefix_abs/share
+   delete readonly = yes
";
close(CONF);
 
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 9b66590..2763b1b 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -585,6 +585,10 @@ for t in tests:
 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/streams_xattr 
-U$USERNAME%$PASSWORD', 'streams_xattr')
 elif t == "smb2.aio_delay":
 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/aio_delay_inject 
-U$USERNAME%$PASSWORD')
+elif t == "smb2.delete-on-close-perms":
+plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp 
-U$USERNAME%$PASSWORD')
+plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/delete_readonly 
-U$USERNAME%$PASSWORD --option=torture:delete_readonly=true')
+plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp 
-U$USERNAME%$PASSWORD')
 else:
 plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp 
-U$USERNAME%$PASSWORD')
 plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp 
-U$USERNAME%$PASSWORD')
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index db5eb4e..3ae8adb 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -3280,6 +3280,18 @@ static NTSTATUS open_file_ntcreate(connection_struct 
*conn,
request_time = fsp->open_time;
}
 
+   if ((create_options & FILE_DELETE_ON_CLOSE) &&
+