[SCM] SAMBA-CTDB repository - branch v3-2-ctdb updated - 3.2.11-ctdb-65-5-g587caa3

Michael Adam obnox at samba.org
Wed Oct 21 06:12:52 MDT 2009


The branch, v3-2-ctdb has been updated
       via  587caa3d8ad6a97c480e371a3cc5bc3b2c932ec7 (commit)
       via  a2d1d3cd0add8d116454b32d337813fbaf8f1c76 (commit)
       via  ea3128a0f1d3842f1e6c14390b4967a5758b5257 (commit)
       via  415fb7fc0e07517f4e681b5872ac3f0e59632d96 (commit)
      from  bf00bbf3e71eff5f2cb732f78b8fd9aed84dfa2e (commit)

http://gitweb.samba.org/?p=obnox/samba-ctdb.git;a=shortlog;h=v3-2-ctdb


- Log -----------------------------------------------------------------
commit 587caa3d8ad6a97c480e371a3cc5bc3b2c932ec7
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Oct 19 13:10:58 2009 +0200

    v3-2-ctdb: Bump the ctdb vendor patch level to 67.

commit a2d1d3cd0add8d116454b32d337813fbaf8f1c76
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Oct 16 12:37:27 2009 +0200

    s3: Attempt to fix a deadlock between smbd and ctdbd
    
    In Samba we access the notify databases under the locking.tdb lock when closing a file. This leads to a deadlock with ctdb when doing a recovery.
    
    This is a bad hack, and ctdb will need to get fixed for this. But for now, it
    seems necessary.

commit ea3128a0f1d3842f1e6c14390b4967a5758b5257
Author: Günther Deschner <gd at samba.org>
Date:   Tue Sep 1 11:58:05 2009 +0200

    wbclient: Fix Bug #6680: always activate handling of large (> 256 byte) ntlmv2 blobs in wbcAuthenticateUserEx().
    
    Guenther

commit 415fb7fc0e07517f4e681b5872ac3f0e59632d96
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Oct 8 14:02:39 2009 +0200

    s3: Fix shadow copy display on Windows 7
    
    Windows 7 is a bit more picky on our NT_STATUS_BUFFER_TOO_SMALL. Announce the
    right buffer size, the same amount we later check for.

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

Summary of changes:
 source/VERSION                        |    2 +-
 source/nsswitch/libwbclient/wbc_pam.c |   19 +++++--
 source/smbd/notify.c                  |   92 ++++++++++++++++++++++++++++-----
 source/smbd/nttrans.c                 |    2 +-
 4 files changed, 96 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/VERSION b/source/VERSION
index f071384..7374600 100644
--- a/source/VERSION
+++ b/source/VERSION
@@ -96,4 +96,4 @@ SAMBA_VERSION_IS_GIT_SNAPSHOT=
 #  ->  "CVS 3.0.0rc2-VendorVersion"                    #
 ########################################################
 SAMBA_VERSION_VENDOR_SUFFIX="ctdb"
-SAMBA_VERSION_VENDOR_PATCH=66
+SAMBA_VERSION_VENDOR_PATCH=67
diff --git a/source/nsswitch/libwbclient/wbc_pam.c b/source/nsswitch/libwbclient/wbc_pam.c
index 5427ddb..8f1df16 100644
--- a/source/nsswitch/libwbclient/wbc_pam.c
+++ b/source/nsswitch/libwbclient/wbc_pam.c
@@ -369,15 +369,24 @@ wbcErr wbcAuthenticateUserEx(const struct wbcAuthUserParams *params,
 		request.data.auth_crap.lm_resp_len =
 				MIN(params->password.response.lm_length,
 				    sizeof(request.data.auth_crap.lm_resp));
-		request.data.auth_crap.nt_resp_len =
-				MIN(params->password.response.nt_length,
-				    sizeof(request.data.auth_crap.nt_resp));
 		if (params->password.response.lm_data) {
 			memcpy(request.data.auth_crap.lm_resp,
 			       params->password.response.lm_data,
 			       request.data.auth_crap.lm_resp_len);
 		}
-		if (params->password.response.nt_data) {
+		request.data.auth_crap.nt_resp_len = params->password.response.nt_length;
+		if (params->password.response.nt_length > sizeof(request.data.auth_crap.nt_resp)) {
+			request.flags |= WBFLAG_BIG_NTLMV2_BLOB;
+			request.extra_len = params->password.response.nt_length;
+			request.extra_data.data = talloc_zero_array(NULL, char, request.extra_len);
+			if (request.extra_data.data == NULL) {
+				wbc_status = WBC_ERR_NO_MEMORY;
+				BAIL_ON_WBC_ERROR(wbc_status);
+			}
+			memcpy(request.extra_data.data,
+			       params->password.response.nt_data,
+			       request.data.auth_crap.nt_resp_len);
+		} else if (params->password.response.nt_data) {
 			memcpy(request.data.auth_crap.nt_resp,
 			       params->password.response.nt_data,
 			       request.data.auth_crap.nt_resp_len);
@@ -419,6 +428,8 @@ done:
 	if (response.extra_data.data)
 		free(response.extra_data.data);
 
+	talloc_free(request.extra_data.data);
+
 	return wbc_status;
 }
 
diff --git a/source/smbd/notify.c b/source/smbd/notify.c
index 180e086..8b5a14e 100644
--- a/source/smbd/notify.c
+++ b/source/smbd/notify.c
@@ -357,32 +357,98 @@ void remove_pending_change_notify_requests_by_fid(files_struct *fsp,
 	}
 }
 
-void notify_fname(connection_struct *conn, uint32 action, uint32 filter,
-		  const char *path)
-{
+struct notify_fname_state {
+	struct notify_context *ctx;
+	uint32_t action;
+	uint32_t filter;
 	char *fullpath;
+
+	bool do_onelevel;
+	struct file_id fid;
 	char *parent;
 	const char *name;
+};
+
+static void notify_fname_callback(struct event_context *ev,
+				  struct timed_event *te,
+				  const struct timeval *now,
+				  void *private_data)
+{
+	struct notify_fname_state *state = talloc_get_type_abort(
+		private_data, struct notify_fname_state);
+
+	DEBUG(10, ("notify_fname_callback called for fullpath=%s, name=%s, "
+		   "action=%d, filter=%d\n", state->fullpath,
+		   state->do_onelevel ? state->name : "::no onelevel",
+		   (int)state->action, (int)state->filter));
+
+	if (state->do_onelevel) {
+		notify_onelevel(state->ctx, state->action, state->filter,
+				state->fid, state->name);
+	}
+	notify_trigger(state->ctx, state->action, state->filter,
+		       state->fullpath);
+	TALLOC_FREE(te);
+}
+
+void notify_fname(connection_struct *conn, uint32 action, uint32 filter,
+		  const char *path)
+{
+	struct notify_fname_state *state;
 	SMB_STRUCT_STAT sbuf;
+	struct timed_event *te;
+	const char *name;
+
+
+	state = talloc(talloc_tos(), struct notify_fname_state);
+	if (state == NULL) {
+		return;
+	}
+	state->ctx = conn->notify_ctx;
+	state->action = action;
+	state->filter = filter;
 
 	if (path[0] == '.' && path[1] == '/') {
 		path += 2;
 	}
-	if (asprintf(&fullpath, "%s/%s", conn->connectpath, path) == -1) {
-		DEBUG(0, ("asprintf failed\n"));
+
+	state->fullpath = talloc_asprintf(state, "%s/%s", conn->connectpath,
+					  path);
+	if (state->fullpath == NULL) {
+		TALLOC_FREE(state);
+		DEBUG(0, ("talloc_asprintf failed\n"));
 		return;
 	}
 
-	if (parent_dirname_talloc(talloc_tos(), path, &parent, &name)
-	    && (SMB_VFS_STAT(conn, parent, &sbuf) != -1)) {
-		notify_onelevel(conn->notify_ctx, action, filter,
-				SMB_VFS_FILE_ID_CREATE(conn, sbuf.st_dev,
-						       sbuf.st_ino),
-				name);
+	if (parent_dirname_talloc(state, path, &state->parent, &name)
+	    && (SMB_VFS_STAT(conn, state->parent, &sbuf) != -1)) {
+		state->do_onelevel = true;
+		state->name = talloc_strdup(state, name);
+		if (state->name == NULL) {
+			DEBUG(0, ("talloc_strdup failed\n"));
+			TALLOC_FREE(state);
+			return;
+		}
+		state->fid = SMB_VFS_FILE_ID_CREATE(conn, sbuf.st_dev,
+						    sbuf.st_ino);
+	} else {
+		state->do_onelevel = false;
 	}
 
-	notify_trigger(conn->notify_ctx, action, filter, fullpath);
-	SAFE_FREE(fullpath);
+	DEBUG(10, ("notify_fname created for fullpath=%s, name=%s, "
+		   "action=%d, filter=%d\n", state->fullpath,
+		   state->do_onelevel ? state->name : "::no onelevel",
+		   (int)state->action, (int)state->filter));
+
+	te = event_add_timed(smbd_event_context(), NULL, timeval_zero(),
+			     "notify_fname_callback", notify_fname_callback,
+			     state);
+	if (te == NULL) {
+		DEBUG(10, ("event_add_timed failed\n"));
+		TALLOC_FREE(state);
+		return;
+	}
+	state = talloc_move(te, &state);
 }
 
 static void notify_fsp(files_struct *fsp, uint32 action, const char *name)
diff --git a/source/smbd/nttrans.c b/source/smbd/nttrans.c
index da39986..3d6fd4c 100644
--- a/source/smbd/nttrans.c
+++ b/source/smbd/nttrans.c
@@ -1944,7 +1944,7 @@ static void call_nt_transact_ioctl(connection_struct *conn,
 		}
 
 		/* needed_data_count 4 bytes */
-		SIVAL(pdata,8,labels_data_count);
+		SIVAL(pdata, 8, labels_data_count+4);
 
 		cur_pdata+=12;
 


-- 
SAMBA-CTDB repository


More information about the samba-cvs mailing list