[SCM] SAMBA-CTDB repository - branch v3-4-ctdb updated - 3.4.2-ctdb-10-12-g2db5f5b

Michael Adam obnox at samba.org
Thu Nov 12 17:24:28 MST 2009


The branch, v3-4-ctdb has been updated
       via  2db5f5bbda842611f9b58a18f0b9dc9d6438d770 (commit)
       via  5ea4ada54e1805a349b9ee21f5c2e6e5bb5ea63a (commit)
       via  5d3977f3267c88912ad1bdcca53df565041f6e55 (commit)
       via  fc79ae0a9f776e41bf30a7c4ba4832b331633c7d (commit)
       via  4f6a12a4b275bf574cd57a0936647443e3b63a1d (commit)
       via  b39bb0f239cdff1155ab421e21e78136323a7e6d (commit)
       via  c313c9806686ebd3926ae0e40146b6a8853f7e35 (commit)
       via  7b4b2604de55f86f972891d419648b8a43042a06 (commit)
      from  4f337138a60a76f1431af3769cd5d075a8755813 (commit)

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


- Log -----------------------------------------------------------------
commit 2db5f5bbda842611f9b58a18f0b9dc9d6438d770
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Nov 12 12:34:17 2009 +0100

    v3-4-ctdb: Bumb vendor version number to 12

commit 5ea4ada54e1805a349b9ee21f5c2e6e5bb5ea63a
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Nov 12 12:30:58 2009 +0100

    s3: Fix shadow copies after the change for in-path @GMT-

commit 5d3977f3267c88912ad1bdcca53df565041f6e55
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Nov 12 12:29:19 2009 +0100

    s3: Fix check_reduced_name for access to the share root itself

commit fc79ae0a9f776e41bf30a7c4ba4832b331633c7d
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Nov 12 11:07:15 2009 +0100

    s3: Fix debug messages in check_reduced_name

commit 4f6a12a4b275bf574cd57a0936647443e3b63a1d
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Nov 11 17:07:32 2009 +0100

    v3-4-ctdb: Bumb vendor version number to 11

commit b39bb0f239cdff1155ab421e21e78136323a7e6d
Author: Michael Adam <obnox at samba.org>
Date:   Wed Nov 11 00:13:14 2009 +0100

    s3:vfs_fs_capabilities: fix a debug message
    
    Michael

commit c313c9806686ebd3926ae0e40146b6a8853f7e35
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Nov 9 17:06:48 2009 +0100

    s3: Try to avoid dns searches with an empty site

commit 7b4b2604de55f86f972891d419648b8a43042a06
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Nov 9 11:06:30 2009 +0100

    s3: Fix in-path shadowcopy2 module

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

Summary of changes:
 source3/VERSION                    |    2 +-
 source3/libsmb/dsgetdcname.c       |    2 +-
 source3/modules/vfs_default.c      |    2 +-
 source3/modules/vfs_shadow_copy2.c |    6 ++--
 source3/smbd/vfs.c                 |   54 ++++++++++++++++++++++++++---------
 5 files changed, 46 insertions(+), 20 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/VERSION b/source3/VERSION
index 3b67f88..9ff3a21 100644
--- a/source3/VERSION
+++ b/source3/VERSION
@@ -85,7 +85,7 @@ SAMBA_VERSION_IS_GIT_SNAPSHOT=no
 #                                                      #
 ########################################################
 SAMBA_VERSION_VENDOR_SUFFIX="ctdb"
-SAMBA_VERSION_VENDOR_PATCH=10
+SAMBA_VERSION_VENDOR_PATCH=12
 
 ########################################################
 # This can be set by vendors if they want..            #
diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c
index cc70946..89a3a6e 100644
--- a/source3/libsmb/dsgetdcname.c
+++ b/source3/libsmb/dsgetdcname.c
@@ -1137,7 +1137,7 @@ NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx,
 		return NT_STATUS_INVALID_PARAMETER;
 	}
 
-	if (!site_name) {
+	if ((site_name == NULL) || (site_name[0] == '\0')) {
 		query_site = sitename_fetch(domain_name);
 	} else {
 		query_site = SMB_STRDUP(site_name);
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 6f7208b..6da2f74 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -138,7 +138,7 @@ static uint32_t vfswrap_fs_capabilities(struct vfs_handle_struct *handle)
 			"resolution of %s "
 			"available on share %s, directory %s\n",
 			conn->ts_res == TIMESTAMP_SET_MSEC ? "msec" : "sec",
-			lp_servicename(conn->cnum),
+			lp_servicename(conn->params->service),
 			conn->connectpath ));
 	}
 	return caps;
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index a4e54c7..61f52ec 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -504,11 +504,11 @@ static char *shadow_copy2_realpath(vfs_handle_struct *handle,
 		}
 
 		copy[gmt_start - fname] = '.';
+		copy[gmt_start - fname + 1] = '\0';
 
 		DEBUG(10, ("calling NEXT_REALPATH with %s\n", copy));
-		result = SMB_VFS_NEXT_REALPATH(handle, copy, resolved_path);
-		TALLOC_FREE(copy);
-		return result;
+		SHADOW2_NEXT(REALPATH, (handle, name, resolved_path), char *,
+			     NULL);
 	}
 
 	SHADOW2_NEXT(REALPATH, (handle, name, resolved_path), char *, NULL);
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 95af1dd..90171e7 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -861,7 +861,7 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
 	char *resolved_name = NULL;
 	char *p = NULL;
 
-	DEBUG(3,("reduce_name [%s] [%s]\n", fname, conn->connectpath));
+	DEBUG(3,("check_reduced_name [%s] [%s]\n", fname, conn->connectpath));
 
 #ifdef REALPATH_TAKES_NULL
 	resolved_name = SMB_VFS_REALPATH(conn,fname,NULL);
@@ -872,7 +872,9 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
 	if (!resolved_name) {
 		switch (errno) {
 			case ENOTDIR:
-				DEBUG(3,("reduce_name: Component not a directory in getting realpath for %s\n", fname));
+				DEBUG(3,("check_reduced_name: Component not a "
+					 "directory in getting realpath for "
+					 "%s\n", fname));
 				return map_nt_error_from_unix(errno);
 			case ENOENT:
 			{
@@ -904,7 +906,9 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
 				resolved_name = SMB_VFS_REALPATH(conn,tmp_fname,resolved_name_buf);
 #endif
 				if (!resolved_name) {
-					DEBUG(3,("reduce_name: couldn't get realpath for %s\n", fname));
+					DEBUG(3,("check_reduce_named: "
+						 "couldn't get realpath for "
+						 "%s\n", fname));
 					return map_nt_error_from_unix(errno);
 				}
 				tmp_fname = talloc_asprintf(ctx,
@@ -918,7 +922,8 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
 				SAFE_FREE(resolved_name);
 				resolved_name = SMB_STRDUP(tmp_fname);
 				if (!resolved_name) {
-					DEBUG(0,("reduce_name: malloc fail for %s\n", tmp_fname));
+					DEBUG(0, ("check_reduced_name: malloc "
+						  "fail for %s\n", tmp_fname));
 					return NT_STATUS_NO_MEMORY;
 				}
 #else
@@ -928,15 +933,18 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
 				break;
 			}
 			default:
-				DEBUG(1,("reduce_name: couldn't get realpath for %s\n", fname));
+				DEBUG(1,("check_reduced_name: couldn't get "
+					 "realpath for %s\n", fname));
 				return map_nt_error_from_unix(errno);
 		}
 	}
 
-	DEBUG(10,("reduce_name realpath [%s] -> [%s]\n", fname, resolved_name));
+	DEBUG(10,("check_reduced_name realpath [%s] -> [%s]\n", fname,
+		  resolved_name));
 
 	if (*resolved_name != '/') {
-		DEBUG(0,("reduce_name: realpath doesn't return absolute paths !\n"));
+		DEBUG(0,("check_reduced_name: realpath doesn't return "
+			 "absolute paths !\n"));
 		if (free_resolved_name) {
 			SAFE_FREE(resolved_name);
 		}
@@ -946,21 +954,37 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
 	/* Check for widelinks allowed. */
 	if (!lp_widelinks(SNUM(conn))) {
 		    const char *conn_rootdir;
+		    size_t rootdirlen;
 
 		    conn_rootdir = SMB_VFS_CONNECTPATH(conn, fname);
 		    if (conn_rootdir == NULL) {
-			    DEBUG(2, ("check_reduced_name: Could not get conn_rootdir\n"));
+			    DEBUG(2, ("check_reduced_name: Could not get "
+				      "conn_rootdir\n"));
 			    if (free_resolved_name) {
 				    SAFE_FREE(resolved_name);
 			    }
 			    return NT_STATUS_ACCESS_DENIED;
 		    }
 
+		    DEBUG(10, ("resolved_name=%s\n", resolved_name));
+		    DEBUGADD(10, ("conn_rootdir =%s\n", conn_rootdir));
+
+		    rootdirlen = strlen(conn_rootdir);
+
+		    /*
+		     * We have to take care of an access to the
+		     * rootdir itself.
+		     */
+		    if ((strlen(resolved_name) == (rootdirlen-1))
+			&& (conn_rootdir[rootdirlen-1] == '/')) {
+			    rootdirlen -= 1;
+		    }
+
 		    if (strncmp(conn_rootdir, resolved_name,
-				strlen(conn_rootdir)) != 0) {
-			    DEBUG(2, ("reduce_name: Bad access attempt: %s is "
-				      "a symlink outside the share path",
-				      fname));
+				rootdirlen) != 0) {
+			    DEBUG(2, ("check_reduced_name: Bad access "
+				      "attempt: %s is a symlink outside the "
+				      "share path", fname));
 			    if (free_resolved_name) {
 				    SAFE_FREE(resolved_name);
 			    }
@@ -980,13 +1004,15 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
 			if (free_resolved_name) {
 				SAFE_FREE(resolved_name);
 			}
-                        DEBUG(3,("reduce_name: denied: file path name %s is a symlink\n",resolved_name));
+                        DEBUG(3,("check_reduced_name: denied: file path name "
+				 "%s is a symlink\n",resolved_name));
 			return NT_STATUS_ACCESS_DENIED;
                 }
         }
 #endif
 
-	DEBUG(3,("reduce_name: %s reduced to %s\n", fname, resolved_name));
+	DEBUG(3,("check_reduced_name: %s reduced to %s\n", fname,
+		 resolved_name));
 	if (free_resolved_name) {
 		SAFE_FREE(resolved_name);
 	}


-- 
SAMBA-CTDB repository


More information about the samba-cvs mailing list