[SCM] Samba Shared Repository - branch master updated

2021-05-24 Thread Andrew Bartlett
The branch, master has been updated
   via  a4c0666f6bc docs-xml: Update pdbedit manpage for new cmdline 
opition parser
   via  aff65c0754c s3:utils: Migrate pdbedit to the new cmdline option 
parser
   via  95e82b5b5f8 docs-xml: Update sharesec manpage for new cmdline 
opition parser
   via  b41a0cd199d s3:utils: Migrate sharesec to new cmdline option parser
   via  4f81d8459a4 s3:utils: Remove '-V' for '--viewsddl' from sharesec
   via  d8b6e843fb4 s3:utils: Migrate spilt_tokens to new cmdline option 
parser
   via  0a6d6a28594 docs-xml: Update smbcontrol manpage for new cmdline 
opition parser
   via  824c355ed78 s3:utils: Migrate smbcontrol to new cmdline option 
parser
   via  774663094d5 s3:utils: Migrate dbwrap_torture to new cmdline option 
parser
   via  6bb6e0c54f8 docs-xml: Update smbstatus manpage for new cmdline 
opition parser
   via  ee5e420dc5c s3:utils: Migrate smbstatus to new cmdline option parser
   via  54f14587353 docs-xml: Update ntlm_auth manpage for new cmdline 
opition parser
   via  c96e94fbef8 s3:utils: Migrate ntlm_auth to new cmdline option parser
   via  f0cd9afa8cb lib:cmdline: Add a --configfile only parser for 
ntlm_auth
   via  c88a8a3cbea docs-xml: Update mdfind manpage for new cmdline opition 
parser
   via  6b4710b5f3c s3:utils: Migrate mdfind to new cmdline option parser
   via  667da24bd34 docs-xml: Update testparm manpage for new cmdline 
opition parser
   via  e63bf24d89a s3:utils: Migrate testparm to new cmdline option parser
   via  a5a2636e20d lib:cmdline: Add a --option only parser for testparm
   via  e2b2baeb549 docs-xml: Update nmblookup manpage for new cmdline 
opition parser
   via  4a8a77c21d4 s3:utils: Migrate nmblookup to new cmdline option parser
   via  60427f5191e s3:utils: Remove duplicate '-R' option from nmblookup
   via  17513416714 docs-xml: Update dbwrap_tool manpage for new cmdline 
opition parser
   via  8e1fe474c9b s3:utils: Migrate dbwrap_tool to new cmdline option 
parser
   via  00cbce7bc9b docs-xml: Update profiles manpage for new cmdline 
opition parser
   via  7d6608d1f91 s3:utils: Migrate profiles to new cmdline option parser
   via  9d9ed421b26 docs-xml: Update smbcacls manpage
   via  2d7740f65c6 docs: Update list of available commands in rpcclient
   via  139cefceca2 s3:rpcclient: Document command of witness protocol
  from  1d781bbff84 s3: smbd: Allow SMB1+UNIX extensions rename of dangling 
symlink.

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


- Log -
commit a4c0666f6bc3ccb6eedb3f5c3ff3746ae07d1c47
Author: Andreas Schneider 
Date:   Mon Jan 18 16:28:28 2021 +0100

docs-xml: Update pdbedit manpage for new cmdline opition parser

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 

Autobuild-User(master): Andrew Bartlett 
Autobuild-Date(master): Tue May 25 01:14:09 UTC 2021 on sn-devel-184

commit aff65c0754c7727e8fe9b9449ad8c2a90d715086
Author: Andreas Schneider 
Date:   Wed Jan 13 13:42:53 2021 +0100

s3:utils: Migrate pdbedit to the new cmdline option parser

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 

commit 95e82b5b5f87836ae1c6efca970d9059d1cfeca4
Author: Andreas Schneider 
Date:   Mon Jan 18 15:42:39 2021 +0100

docs-xml: Update sharesec manpage for new cmdline opition parser

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 

commit b41a0cd199dfc0e67664026b90ba3b5cb87e5c23
Author: Andreas Schneider 
Date:   Wed Jan 13 13:40:26 2021 +0100

s3:utils: Migrate sharesec to new cmdline option parser

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 

commit 4f81d8459a48aecf6d342045caa1531234f4f87f
Author: Andreas Schneider 
Date:   Mon Jan 18 09:02:22 2021 +0100

s3:utils: Remove '-V' for '--viewsddl' from sharesec

The '-V' is already used for '-V|--version' in the common options.

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 

commit d8b6e843fb4dbb6f2e5e21015e14136f6103b677
Author: Andreas Schneider 
Date:   Wed Jan 13 13:32:24 2021 +0100

s3:utils: Migrate spilt_tokens to new cmdline option parser

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 

commit 0a6d6a28594813f40e773f0205907947b02077d2
Author: Andreas Schneider 
Date:   Mon Jan 18 15:38:35 2021 +0100

docs-xml: Update smbcontrol manpage for new cmdline opition parser

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 

commit 824c355ed786994e0b696c446edfb86e6a79d2c1
Author: Andreas Schneider 
Date:   Wed Jan 13 13:28:11 2021 +0100

s3:utils: Migrate smbcontrol to new cmdline option parser

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 

commit 774663094d5bcbf47453fdcf69dabf1793fbcf56
Author: Andreas Schneide

[SCM] Samba Shared Repository - branch master updated

2021-05-24 Thread Noel Power
The branch, master has been updated
   via  1d781bbff84 s3: smbd: Allow SMB1+UNIX extensions rename of dangling 
symlink.
   via  0c2ceb0435c s3: torture: Add regression test for renaming 
SMB1+POSIX symlinks, dangling and real.
   via  6917e324660 s3: smbd: Remove use of synthetic_pathref() in 
rename_internals_fsp().
  from  f96cc297111 smbd: correctly initialize close timestamp fields

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


- Log -
commit 1d781bbff84667b3ada4afc06c1d15829754dcb4
Author: Jeremy Allison 
Date:   Fri May 21 10:53:49 2021 -0700

s3: smbd: Allow SMB1+UNIX extensions rename of dangling symlink.

Remove knownfail. Only in master, so no bug number needed.

Signed-off-by: Jeremy Allison 
Reviewed-by: Noel Power 

Autobuild-User(master): Noel Power 
Autobuild-Date(master): Mon May 24 17:47:40 UTC 2021 on sn-devel-184

commit 0c2ceb0435c7d03d72c7f9c29b0240f944f6cc42
Author: Jeremy Allison 
Date:   Fri May 21 11:14:19 2021 -0700

s3: torture: Add regression test for renaming SMB1+POSIX symlinks, dangling 
and real.

Mark as knownfail.

Signed-off-by: Jeremy Allison 
Reviewed-by: Noel Power 

commit 6917e3246603b9d84133b10f0415e1cc11d184f7
Author: Jeremy Allison 
Date:   Fri May 21 10:27:09 2021 -0700

s3: smbd: Remove use of synthetic_pathref() in rename_internals_fsp().

As we're renaming an open file we don't need to do another
open, we already have an fsp here.

Signed-off-by: Jeremy Allison 
Reviewed-by: Noel Power 

---

Summary of changes:
 source3/selftest/tests.py|   1 +
 source3/smbd/reply.c |  54 +
 source3/torture/proto.h  |   1 +
 source3/torture/test_posix.c | 134 +++
 source3/torture/torture.c|   4 ++
 5 files changed, 169 insertions(+), 25 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 13f0466802e..d4f9ea27ba6 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -265,6 +265,7 @@ posix_tests = ["POSIX", "POSIX-APPEND", 
"POSIX-SYMLINK-ACL", "POSIX-SYMLINK-EA",
"POSIX-SYMLINK-PARENT",
"POSIX-SYMLINK-CHMOD",
"POSIX-DIR-DEFAULT-ACL",
+   "POSIX-SYMLINK-RENAME",
   ]
 
 for t in posix_tests:
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 4ba3b0ee624..1b670020143 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -7829,33 +7829,25 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
(lp_map_archive(SNUM(conn)) ||
lp_store_dos_attributes(SNUM(conn
{
-   struct smb_filename *pathref = NULL;
-   status = synthetic_pathref(ctx,
-   conn->cwd_fsp,
-   smb_fname_dst->base_name,
-   smb_fname_dst->stream_name,
-   NULL,
-   smb_fname_dst->twrp,
-   smb_fname_dst->flags,
-   &pathref);
-   if (NT_STATUS_IS_OK(status)) {
+   /*
+* We must set the archive bit on the newly renamed
+* file.
+*/
+   ret = SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st);
+   if (ret == 0) {
+   uint32_t old_dosmode;
+   old_dosmode = fdos_mode(fsp);
/*
-* We must set the archive bit on the newly 
renamed
-* file.
+* We can use fsp->fsp_name here as it has
+* already been changed to the new name.
 */
-   ret = SMB_VFS_FSTAT(fsp, &pathref->st);
-   if (ret == 0) {
-   uint32_t old_dosmode;
-   fsp->fsp_name->st = pathref->st;
-   old_dosmode = fdos_mode(fsp);
-   file_set_dosmode(conn,
-   pathref,
-   old_dosmode | 
FILE_ATTRIBUTE_ARCHIVE,
-   NULL,
-   true);
-   }
+

[SCM] Samba Shared Repository - branch master updated

2021-05-24 Thread Jeremy Allison
The branch, master has been updated
   via  f96cc297111 smbd: correctly initialize close timestamp fields
   via  ac9042ff4dc torture: add a test that verifies SMB2 close fields 
without postqueryattrib
  from  570ec75c7e8 s3/smbd: Fix stray line introduced in 
470b6223e7283ce1308e0b273eb893d20ab72d5b

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


- Log -
commit f96cc29711181b5237a5b92c4bfb5e75fe2a73b9
Author: Ralph Boehme 
Date:   Mon May 24 12:03:28 2021 +0200

smbd: correctly initialize close timestamp fields

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

Signed-off-by: Ralph Boehme 
Reviewed-by: Jeremy Allison 

Autobuild-User(master): Jeremy Allison 
Autobuild-Date(master): Mon May 24 16:56:22 UTC 2021 on sn-devel-184

commit ac9042ff4dc6c892764abd23a9445116ad40e62a
Author: Ralph Boehme 
Date:   Mon May 24 12:21:38 2021 +0200

torture: add a test that verifies SMB2 close fields without postqueryattrib

The server must set all fields to 0 if postqueryattrib is not set.

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

Signed-off-by: Ralph Boehme 
Reviewed-by: Jeremy Allison 

---

Summary of changes:
 source3/smbd/smb2_close.c |  8 ++---
 source4/torture/smb2/timestamps.c | 65 +++
 2 files changed, 69 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/smb2_close.c b/source3/smbd/smb2_close.c
index 5948ba95a5d..da2a8fa59c8 100644
--- a/source3/smbd/smb2_close.c
+++ b/source3/smbd/smb2_close.c
@@ -228,10 +228,10 @@ static NTSTATUS smbd_smb2_close(struct smbd_smb2_request 
*req,
uint16_t flags = 0;
bool posix_open = false;
 
-   ZERO_STRUCTP(out_creation_ts);
-   ZERO_STRUCTP(out_last_access_ts);
-   ZERO_STRUCTP(out_last_write_ts);
-   ZERO_STRUCTP(out_change_ts);
+   *out_creation_ts = (struct timespec){0, SAMBA_UTIME_OMIT};
+   *out_last_access_ts = (struct timespec){0, SAMBA_UTIME_OMIT};
+   *out_last_write_ts = (struct timespec){0, SAMBA_UTIME_OMIT};
+   *out_change_ts = (struct timespec){0, SAMBA_UTIME_OMIT};
 
*out_flags = 0;
*out_allocation_size = 0;
diff --git a/source4/torture/smb2/timestamps.c 
b/source4/torture/smb2/timestamps.c
index f0cc9c269ff..c37e81d2adc 100644
--- a/source4/torture/smb2/timestamps.c
+++ b/source4/torture/smb2/timestamps.c
@@ -29,6 +29,70 @@
 #define BASEDIR "smb2-timestamps"
 #define FNAME "testfile.dat"
 
+static bool test_close_no_attrib(struct torture_context *tctx,
+struct smb2_tree *tree)
+{
+   const char *filename = BASEDIR "/" FNAME;
+   struct smb2_create cr;
+   struct smb2_handle handle = {{0}};
+   struct smb2_handle testdirh = {{0}};
+   struct smb2_close c;
+   NTSTATUS status;
+   bool ret = true;
+
+   smb2_deltree(tree, BASEDIR);
+
+   status = torture_smb2_testdir(tree, BASEDIR, &testdirh);
+   torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
+   "torture_smb2_testdir failed\n");
+   smb2_util_close(tree, testdirh);
+
+   cr = (struct smb2_create) {
+   .in.desired_access = SEC_FLAG_MAXIMUM_ALLOWED,
+   .in.file_attributes = FILE_ATTRIBUTE_NORMAL,
+   .in.share_access = NTCREATEX_SHARE_ACCESS_MASK,
+   .in.create_disposition = NTCREATEX_DISP_OPEN_IF,
+   .in.impersonation_level = NTCREATEX_IMPERSONATION_ANONYMOUS,
+   .in.fname = filename,
+   };
+
+   status = smb2_create(tree, tctx, &cr);
+   torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
+   "smb2_create failed\n");
+   handle = cr.out.file.handle;
+
+   c = (struct smb2_close) {
+   .in.file.handle = handle,
+   };
+
+   status = smb2_close(tree, &c);
+   torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
+   "close failed\n");
+   ZERO_STRUCT(handle);
+
+   torture_assert_u64_equal_goto(tctx, c.out.create_time, NTTIME_OMIT,
+ ret, done, "Unexpected create time\n");
+   torture_assert_u64_equal_goto(tctx, c.out.access_time, NTTIME_OMIT,
+ ret, done, "Unexpected access time\n");
+   torture_assert_u64_equal_goto(tctx, c.out.write_time, NTTIME_OMIT,
+ ret, done, "Unexpected write time\n");
+   torture_assert_u64_equal_goto(tctx, c.out.change_time, NTTIME_OMIT,
+ ret, done, "Unexpected change time\n");
+   torture_assert_u64_equal_goto(tctx, c.out.alloc_size, 0,
+ ret, done, "Unexpected allocation 
s