[SCM] Samba Shared Repository - branch master updated

Christian Ambach ambi at samba.org
Tue Jun 25 06:49:03 MDT 2013


The branch, master has been updated
       via  4ee73fd s3:smbd/close remove filesystem lock before removing sharemode
       via  935992f s3:smbd/close use common exit path
       via  245b5ff s3:lib add mapping for ETXTBSY
       via  526f0df s3-ctdb: Fix auto-enabling of CTDB readonly support
       via  c9924eb s3:smbd/aio mark file as modified in the SMB2 case
       via  e65c532 nsswitch: fix a comment
      from  48ae86f heimdal_build: Add missing dep on samba4kgetcred

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


- Log -----------------------------------------------------------------
commit 4ee73fd97b63c65cdb8d4fcbe3287a746d667de0
Author: Christian Ambach <ambi at samba.org>
Date:   Thu Jun 13 15:23:07 2013 +0200

    s3:smbd/close remove filesystem lock before removing sharemode
    
    otherwise we are open for a race condition:
    
    opener 1 opens file and closes it
    - during the close, the share mode entry will be removed from
      locking.tdb, but share mode in the file system will be dropped later
      after delete_on_close and write time updates have been done
    
    opener 2 requests open of same file with file overwrite
    - locking.tdb does not list original entry, but file system share mode
      is still around
    - VFS_FTRUNCATE will fail and error was converted to STATUS_ACCESS_DENIED
    
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Christian Ambach <ambi at samba.org>
    Autobuild-Date(master): Tue Jun 25 14:48:44 CEST 2013 on sn-devel-104

commit 935992fc5502ac63cc0c1ebf00089e7f39558c82
Author: Christian Ambach <ambi at samba.org>
Date:   Fri Jun 21 15:11:55 2013 +0200

    s3:smbd/close use common exit path
    
    do not return early here, but use the common exit path that will
    remove the share mode from the record
    
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 245b5ffddef945e071ea1b5d26de1da80a0b7ae8
Author: Christian Ambach <ambi at samba.org>
Date:   Tue Jun 11 18:20:20 2013 +0200

    s3:lib add mapping for ETXTBSY
    
    add ETXTBSY to the errno->STATUS conversion table.
    It will be mapped to STATUS_SHARING_VIOLATION
    
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit 526f0dff9635ed1572152a61672013d5f96ddd74
Author: Daniel Gan-Levi <danielg at il.ibm.com>
Date:   Mon Jun 17 19:39:09 2013 +0300

    s3-ctdb: Fix auto-enabling of CTDB readonly support
    
    This fixes Bug 9957
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=9957
    Signed-off-by: Daniel Gan-Levi <danielg at il.ibm.com>
    Reviewed-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit c9924ebccd4953bc61ebcce9187a54c48ec67962
Author: Christian Ambach <ambi at samba.org>
Date:   Thu Jun 20 18:27:39 2013 +0200

    s3:smbd/aio mark file as modified in the SMB2 case
    
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

commit e65c53226c21877e99879e4483d9b515dfe87672
Author: Christian Ambach <ambi at samba.org>
Date:   Fri Jun 21 13:26:18 2013 +0200

    nsswitch: fix a comment
    
    the beginning if is only ifdef LINUX now, not the long list this comment refers to
    
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

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

Summary of changes:
 nsswitch/pam_winbind.h    |    2 +-
 source3/lib/errmap_unix.c |    3 +++
 source3/smbd/aio.c        |    2 ++
 source3/smbd/close.c      |   20 +++++++++++---------
 source3/wscript           |   28 ++++++++++++++++++++++++++++
 5 files changed, 45 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/nsswitch/pam_winbind.h b/nsswitch/pam_winbind.h
index 0d9529e..2a9dd0e 100644
--- a/nsswitch/pam_winbind.h
+++ b/nsswitch/pam_winbind.h
@@ -93,7 +93,7 @@
 #define PAM_AUTHTOK_RECOVER_ERR PAM_AUTHTOK_RECOVERY_ERR
 #endif
 
-#endif /* defined(SUNOS5) || defined(SUNOS4) || defined(HPUX) || defined(FREEBSD) || defined(AIX) */
+#endif /* (!)LINUX */
 
 #if defined(HAVE_SECURITY_PAM_MODULES_H)
 #include <security/pam_modules.h>
diff --git a/source3/lib/errmap_unix.c b/source3/lib/errmap_unix.c
index 28f527e..c5e190c 100644
--- a/source3/lib/errmap_unix.c
+++ b/source3/lib/errmap_unix.c
@@ -111,6 +111,9 @@ static const struct {
 #ifdef ENOTSUP
         { ENOTSUP,      NT_STATUS_NOT_SUPPORTED},
 #endif
+#ifdef ETXTBSY
+	{ ETXTBSY,      NT_STATUS_SHARING_VIOLATION },
+#endif
 };
 
 /*********************************************************************
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index e8be408..24a822e 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -959,6 +959,8 @@ static void aio_pwrite_smb2_done(struct tevent_req *req)
 	/* Unlock now we're done. */
 	SMB_VFS_STRICT_UNLOCK(fsp->conn, fsp, &aio_ex->lock);
 
+	mark_file_modified(fsp);
+
         status = smb2_write_complete_nosync(subreq, nwritten, err);
 
 	DEBUG(10, ("smb2: scheduled aio_write completed "
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 64faf98..2bd588b 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -246,6 +246,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
 	const struct security_token *del_nt_token = NULL;
 	bool got_tokens = false;
 	bool normal_close;
+	int ret_flock;
 
 	/* Ensure any pending write time updates are done. */
 	if (fsp->update_write_time_event) {
@@ -350,15 +351,8 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
 	normal_close = (close_type == NORMAL_CLOSE || close_type == SHUTDOWN_CLOSE);
 
 	if (!normal_close || !delete_file) {
-
-		if (!del_share_mode(lck, fsp)) {
-			DEBUG(0, ("close_remove_share_mode: Could not delete "
-				  "share entry for file %s\n",
-				  fsp_str_dbg(fsp)));
-		}
-
-		TALLOC_FREE(lck);
-		return NT_STATUS_OK;
+		status = NT_STATUS_OK;
+		goto done;
 	}
 
 	/*
@@ -476,6 +470,14 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
 		pop_sec_ctx();
 	}
 
+	/* remove filesystem sharemodes */
+	ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, 0, 0);
+	if (ret_flock == -1) {
+		DEBUG(2, ("close_remove_share_mode: removing kernel flock for "
+					"%s failed: %s\n", fsp_str_dbg(fsp),
+					strerror(errno)));
+	}
+
 	if (!del_share_mode(lck, fsp)) {
 		DEBUG(0, ("close_remove_share_mode: Could not delete share "
 			  "entry for file %s\n", fsp_str_dbg(fsp)));
diff --git a/source3/wscript b/source3/wscript
index b23608c..3c0145b 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1555,6 +1555,34 @@ main() {
 
         if have_cluster_support:
             conf.CHECK_CODE('''
+               #define NO_CONFIG_H
+               #include "replace.h"
+               #include "system/wait.h"
+               #include "system/network.h"
+               #include <talloc.h>
+               #include <tdb.h>
+               #include <ctdb.h>
+
+               int main(void)
+               {
+                   int i = (int)CTDB_WANT_READONLY;
+                   return 0;
+               }
+               ''',
+               'HAVE_CTDB_WANT_READONLY_DECL',
+               addmain=False,
+               includes=includes,
+               msg='Checking for CTDB readonly records support')
+
+            if not conf.CONFIG_SET('HAVE_CTDB_WANT_READONLY_DECL'):
+                if not Options.options.enable_old_ctdb:
+                    have_cluster_support = False
+                    ctdb_broken = "support for CTDB readonly records missing"
+                else:
+                    Logs.warn("ignoring missing READONLY support (--enable-old-ctdb)")
+
+        if have_cluster_support:
+            conf.CHECK_CODE('''
                 #define NO_CONFIG_H
                 #include "replace.h"
                 #include "system/wait.h"


-- 
Samba Shared Repository


More information about the samba-cvs mailing list