The branch, master has been updated
       via  f1835d8 dynconfig: Use replace.h and memory.h directly, not via 
includes.h
       via  e4054f2 s3-torture: Remove (incorrect) samba3-specific behavior in 
samba3.raw.unlink now the server is correct
       via  618d3dd s3-torture: Add WILDDELETE test to smbtorture3 to test old 
wildcard delete with zero attribute
       via  1d51119 s3-smbd: Fix old DOS client doing wildcard delete - gives a 
attribute type of zero
      from  7f8f1ab net: print file path in serverid wipedbs --verbose

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


- Log -----------------------------------------------------------------
commit f1835d85310dbb2f7e4617c9cc162a00e6641802
Author: Andrew Bartlett <abart...@samba.org>
Date:   Wed Oct 21 14:10:57 2015 +1300

    dynconfig: Use replace.h and memory.h directly, not via includes.h
    
    includes.h brings in talloc.h, but this was recently removed as a 
dependency.
    
    Signed-off-by: Andrew Bartlett <abart...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>
    
    Autobuild-User(master): Andreas Schneider <a...@cryptomilk.org>
    Autobuild-Date(master): Wed Oct 21 11:26:38 CEST 2015 on sn-devel-104

commit e4054f211872168ac4cf022e2d961e8979610920
Author: Jeremy Allison <j...@samba.org>
Date:   Tue Oct 20 12:31:03 2015 -0700

    s3-torture: Remove (incorrect) samba3-specific behavior in 
samba3.raw.unlink now the server is correct
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11452
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 618d3dd5990e7477d45220cf7183c5cdaa548f1a
Author: Jeremy Allison <j...@samba.org>
Date:   Mon Oct 19 16:06:01 2015 -0700

    s3-torture: Add WILDDELETE test to smbtorture3 to test old wildcard delete 
with zero attribute
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11452
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 1d51119f8acaa586e9ec09d14f10b43ed0053df5
Author: Jeremy Allison <j...@samba.org>
Date:   Mon Oct 19 16:04:02 2015 -0700

    s3-smbd: Fix old DOS client doing wildcard delete - gives a attribute type 
of zero
    
    In the wildcard delete path we forgot to map 0 -> FILE_ATTRIBUTE_NORMAL
    as we do in the non-wildcard delete path.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11452
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

-----------------------------------------------------------------------

Summary of changes:
 dynconfig/dynconfig.c        |  7 ++---
 source3/selftest/tests.py    |  2 +-
 source3/smbd/reply.c         |  3 ++
 source3/torture/torture.c    | 67 ++++++++++++++++++++++++++++++++++++++++++++
 source4/torture/raw/unlink.c |  7 +----
 5 files changed, 74 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/dynconfig/dynconfig.c b/dynconfig/dynconfig.c
index cf35bdb..9614152 100644
--- a/dynconfig/dynconfig.c
+++ b/dynconfig/dynconfig.c
@@ -18,8 +18,6 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "includes.h"
-
 /**
  * @file dynconfig.c
  *
@@ -40,10 +38,9 @@
  * table?  There's kind of a chicken-and-egg situation there...
  **/
 
+#include "replace.h"
 #include "dynconfig.h"
-#ifdef strdup
-#undef strdup
-#endif
+#include "lib/util/memory.h"
 
 #define DEFINE_DYN_CONFIG_PARAM(name) \
 const char *dyn_##name = name; \
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 4f6c123..048675a 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -48,7 +48,7 @@ tests = ["FDPASS", "LOCK1", "LOCK2", "LOCK3", "LOCK4", 
"LOCK5", "LOCK6", "LOCK7"
         "UNLINK", "BROWSE", "ATTR", "TRANS2", "TORTURE",
         "OPLOCK1", "OPLOCK2", "OPLOCK4", "STREAMERROR",
         "DIR", "DIR1", "DIR-CREATETIME", "TCON", "TCONDEV", "RW1", "RW2", 
"RW3", "LARGE_READX", "RW-SIGNING",
-        "OPEN", "XCOPY", "RENAME", "DELETE", "DELETE-LN", "PROPERTIES", "W2K",
+        "OPEN", "XCOPY", "RENAME", "DELETE", "DELETE-LN", "WILDDELETE", 
"PROPERTIES", "W2K",
         "TCON2", "IOCTL", "CHKPATH", "FDSESS", "CHAIN1", "CHAIN2",
         "CHAIN3",
         "GETADDRINFO", "UID-REGRESSION-TEST", "SHORTNAME-TEST",
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index bebb789..c796c00 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2915,6 +2915,9 @@ NTSTATUS unlink_internals(connection_struct *conn, struct 
smb_request *req,
                        status = NT_STATUS_OBJECT_NAME_INVALID;
                        goto out;
                }
+               if (dirtype == 0) {
+                       dirtype = FILE_ATTRIBUTE_NORMAL;
+               }
 
                if (strequal(fname_mask,"????????.???")) {
                        TALLOC_FREE(fname_mask);
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 21d2dd2..ef75d21 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -4409,6 +4409,72 @@ static bool run_deletetest(int dummy)
        return correct;
 }
 
+
+/*
+  Test wildcard delete.
+ */
+static bool run_wild_deletetest(int dummy)
+{
+       struct cli_state *cli = NULL;
+       const char *dname = "\\WTEST";
+       const char *fname = "\\WTEST\\A";
+       const char *wunlink_name = "\\WTEST\\*";
+       uint16_t fnum1 = (uint16_t)-1;
+       bool correct = false;
+       NTSTATUS status;
+
+       printf("starting wildcard delete test\n");
+
+       if (!torture_open_connection(&cli, 0)) {
+               return false;
+       }
+
+       smbXcli_conn_set_sockopt(cli->conn, sockops);
+
+       cli_unlink(cli, fname, 0);
+       cli_rmdir(cli, dname);
+       status = cli_mkdir(cli, dname);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("mkdir of %s failed %s!\n", dname, nt_errstr(status));
+               goto fail;
+       }
+       status = cli_openx(cli, fname, O_CREAT|O_RDONLY, DENY_NONE, &fnum1);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("open of %s failed %s!\n", fname, nt_errstr(status));
+               goto fail;
+       }
+       status = cli_close(cli, fnum1);
+       fnum1 = -1;
+
+       /*
+        * Note the unlink attribute-type of zero. This should
+        * map into FILE_ATTRIBUTE_NORMAL at the server even
+        * on a wildcard delete.
+        */
+
+       status = cli_unlink(cli, wunlink_name, 0);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("unlink of %s failed %s!\n",
+                       wunlink_name, nt_errstr(status));
+               goto fail;
+       }
+
+       printf("finished wildcard delete test\n");
+
+       correct = true;
+
+  fail:
+
+       if (fnum1 != (uint16_t)-1) cli_close(cli, fnum1);
+       cli_unlink(cli, fname, 0);
+       cli_rmdir(cli, dname);
+
+       if (cli && !torture_close_connection(cli)) {
+               correct = false;
+       }
+       return correct;
+}
+
 static bool run_deletetest_ln(int dummy)
 {
        struct cli_state *cli;
@@ -9548,6 +9614,7 @@ static struct {
        {"XCOPY", run_xcopy, 0},
        {"RENAME", run_rename, 0},
        {"DELETE", run_deletetest, 0},
+       {"WILDDELETE", run_wild_deletetest, 0},
        {"DELETE-LN", run_deletetest_ln, 0},
        {"PROPERTIES", run_properties, 0},
        {"MANGLE", torture_mangle, 0},
diff --git a/source4/torture/raw/unlink.c b/source4/torture/raw/unlink.c
index 25edb5e..4f198fa 100644
--- a/source4/torture/raw/unlink.c
+++ b/source4/torture/raw/unlink.c
@@ -178,12 +178,7 @@ static bool test_unlink(struct torture_context *tctx, 
struct smbcli_state *cli)
        io.unlink.in.pattern = BASEDIR "\\*.tx?";
        io.unlink.in.attrib = 0;
        status = smb_raw_unlink(cli->tree, &io);
-       if (torture_setting_bool(tctx, "samba3", false)) {
-               CHECK_STATUS(status, NT_STATUS_NO_SUCH_FILE);
-       }
-       else {
-               CHECK_STATUS(status, NT_STATUS_OK);
-       }
+       CHECK_STATUS(status, NT_STATUS_OK);
 
        status = smb_raw_unlink(cli->tree, &io);
        CHECK_STATUS(status, NT_STATUS_NO_SUCH_FILE);


-- 
Samba Shared Repository

Reply via email to