[SCM] Samba Shared Repository - branch master updated

2013-04-15 Thread Richard Sharpe
The branch, master has been updated
   via  0f9eb25 smbd: Fix an error return in change_dir_owner_to_parent
  from  f67ae78 samba-tool - MX records cannot be deleted (part2)

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


- Log -
commit 0f9eb25183e6ed5a2f4ec8e385bc5f985f2087e5
Author: Volker Lendecke 
Date:   Mon Apr 15 11:15:23 2013 +0200

smbd: Fix an error return in change_dir_owner_to_parent

Signed-off-by: Volker Lendecke 
Reviewed-by: Richard Sharpe 

Autobuild-User(master): Richard Sharpe 
Autobuild-Date(master): Mon Apr 15 18:05:06 CEST 2013 on sn-devel-104

---

Summary of changes:
 source3/smbd/open.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index be8d31b..1086e80 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -493,7 +493,7 @@ NTSTATUS change_dir_owner_to_parent(connection_struct *conn,
status = create_synthetic_smb_fname(ctx, ".", NULL, NULL,
&smb_fname_cwd);
if (!NT_STATUS_IS_OK(status)) {
-   return status;
+   goto chdir;
}
 
ret = SMB_VFS_STAT(conn, smb_fname_cwd);


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2013-04-15 Thread Jeremy Allison
The branch, master has been updated
   via  b08c0b3 Add a test that shows the difference between Windows and 
Samba with respect to DeleteOnClose.
  from  0f9eb25 smbd: Fix an error return in change_dir_owner_to_parent

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


- Log -
commit b08c0b317cb8064aac5cc32774a52243aa4af973
Author: Richard Sharpe 
Date:   Thu Apr 4 17:15:30 2013 -0700

Add a test that shows the difference between Windows and Samba with respect 
to DeleteOnClose.

Signed-off-by: Richard Sharpe 
Reviewed-by: Jeremy Allison 

Autobuild-User(master): Jeremy Allison 
Autobuild-Date(master): Tue Apr 16 00:46:54 CEST 2013 on sn-devel-104

---

Summary of changes:
 source4/torture/smb2/delete-on-close.c |  537 
 source4/torture/smb2/smb2.c|2 +
 source4/torture/smb2/wscript_build |2 +-
 3 files changed, 540 insertions(+), 1 deletions(-)
 create mode 100644 source4/torture/smb2/delete-on-close.c


Changeset truncated at 500 lines:

diff --git a/source4/torture/smb2/delete-on-close.c 
b/source4/torture/smb2/delete-on-close.c
new file mode 100644
index 000..0eef8fa
--- /dev/null
+++ b/source4/torture/smb2/delete-on-close.c
@@ -0,0 +1,537 @@
+/*
+   Unix SMB/CIFS implementation.
+
+   test delete-on-close in more detail
+
+   Copyright (C) Richard Sharpe, 2013
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see .
+*/
+
+#include "unistd.h"
+#include "includes.h"
+#include "libcli/smb2/smb2.h"
+#include "libcli/smb2/smb2_calls.h"
+#include "torture/torture.h"
+#include "torture/util.h"
+#include "torture/smb2/proto.h"
+#include "libcli/security/security.h"
+#include "librpc/gen_ndr/ndr_security.h"
+
+#define DNAME "test_dir"
+#define FNAME DNAME "\\test_create.dat"
+
+#define CHECK_STATUS(status, correct) do { \
+   if (!NT_STATUS_EQUAL(status, correct)) { \
+   torture_result(tctx, TORTURE_FAIL, \
+   "(%s) Incorrect status %s - should be %s\n", \
+__location__, nt_errstr(status), nt_errstr(correct)); \
+   return false; \
+   }} while (0)
+
+static bool create_dir(struct torture_context *tctx, struct smb2_tree *tree)
+{
+   NTSTATUS status;
+   struct smb2_create io;
+   struct smb2_handle handle;
+   union smb_fileinfo q;
+   union smb_setfileinfo set;
+   struct security_descriptor *sd, *sd_orig;
+   const char *owner_sid;
+   uint32_t perms = 0;
+
+   torture_comment(tctx, "Creating Directory for testing: %s\n", DNAME);
+
+   ZERO_STRUCT(io);
+   io.level = RAW_OPEN_SMB2;
+   io.in.create_flags = 0;
+   io.in.desired_access =
+   SEC_STD_READ_CONTROL |
+   SEC_STD_WRITE_DAC |
+   SEC_STD_WRITE_OWNER;
+   io.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
+   io.in.file_attributes = FILE_ATTRIBUTE_DIRECTORY;
+   io.in.share_access =
+   NTCREATEX_SHARE_ACCESS_READ |
+   NTCREATEX_SHARE_ACCESS_WRITE;
+   io.in.alloc_size = 0;
+   io.in.create_disposition = NTCREATEX_DISP_OPEN_IF;
+   io.in.impersonation_level = NTCREATEX_IMPERSONATION_ANONYMOUS;
+   io.in.security_flags = 0;
+   io.in.fname = DNAME;
+   status = smb2_create(tree, tctx, &io);
+   CHECK_STATUS(status, NT_STATUS_OK);
+   handle = io.out.file.handle;
+
+   torture_comment(tctx, "get the original sd\n");
+   q.query_secdesc.level = RAW_FILEINFO_SEC_DESC;
+   q.query_secdesc.in.file.handle = handle;
+   q.query_secdesc.in.secinfo_flags = SECINFO_DACL | SECINFO_OWNER;
+   status = smb2_getinfo_file(tree, tctx, &q);
+   CHECK_STATUS(status, NT_STATUS_OK);
+   sd_orig = q.query_secdesc.out.sd;
+
+   owner_sid = dom_sid_string(tctx, sd_orig->owner_sid);
+
+   /*
+* We create an SD that allows us to do most things but we do not
+* get DELETE and DELETE CHILD access!
+*/
+
+   perms = SEC_STD_SYNCHRONIZE | SEC_STD_WRITE_OWNER |
+   SEC_STD_WRITE_DAC | SEC_STD_READ_CONTROL | 
+   SEC_DIR_WRITE_ATTRIBUTE | SEC_DIR_READ_ATTRIBUTE | 
+   SEC_DIR_TRAVERSE | SEC_DIR_WRITE_EA | 
+   SEC_FILE