[SCM] Samba Shared Repository - branch v4-0-test updated

Karolin Seeger kseeger at samba.org
Mon Jul 15 14:57:05 MDT 2013


The branch, v4-0-test has been updated
       via  ed120ed lib/param: sync debug related options with source3/param
       via  ba584a5 lib/ldb-samba: only debug LDB_DEBUG_TRACE at level 10
       via  42cb71b lib/ldb-samba: make use of DBGC_LDB
       via  89644f4 lib/util: add 'ldb' debug class
       via  580740d debug: Add debugclass for DNS server
       via  a56ccfb dsdb-ridalloc: Fix RID pools - RID numbers increase too quickly
       via  afab702 smbd: Fix a 100% loop at shutdown time
       via  f31f55b s3-smbstatus: display [u|g]id of -1 as "-1" in connection list
       via  c286950 s3-lib: hide incomplete smbXsrv_tcon_global records
       via  d15f6a8 s3-lib: fix segf while reading incomplete session info (bug #10003)
      from  0b80e93 vfs_streams_xattr: Do not attempt to write empty attribute twice

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit ed120ed4fc6e86d35a40206ad69813dee308d727
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 4 18:11:02 2013 +0200

    lib/param: sync debug related options with source3/param
    
    The most important change is "debug hires timestamp = Yes"
    and "syslog = 1".
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Björn Jacke <bj at sernet.de>
    
    Autobuild-User(master): Björn Jacke <bj at sernet.de>
    Autobuild-Date(master): Tue Jul  9 17:15:15 CEST 2013 on sn-devel-104
    (cherry picked from commit cd36a3e902813c065e14059d325f7628b06595aa)
    
    The last 5 patches address bug #10015 - Fix/Improve debug options.
    
    Autobuild-User(v4-0-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-0-test): Mon Jul 15 22:56:13 CEST 2013 on sn-devel-104

commit ba584a5ce8e7795b3359435860b5f213fcfc87e4
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jul 9 13:56:35 2013 +0200

    lib/ldb-samba: only debug LDB_DEBUG_TRACE at level 10
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Björn Jacke <bj at sernet.de>
    (cherry picked from commit 5f93822ede7ec3dc79a8057174342b2c6bb94a3b)

commit 42cb71be5da8788c0294d960bcb541b627c24076
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jul 9 13:56:08 2013 +0200

    lib/ldb-samba: make use of DBGC_LDB
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Björn Jacke <bj at sernet.de>
    (cherry picked from commit 8e0752f4d6feea35304377222d3dd487355e4120)

commit 89644f40d77a71b25c0a5f50f8ae6bfbe0ddd2db
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jul 9 13:55:44 2013 +0200

    lib/util: add 'ldb' debug class
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Björn Jacke <bj at sernet.de>
    (cherry picked from commit baecc863de0ceb64187c6eb3545bf28706bd84fc)

commit 580740dd7fe8fcdf6fa307744087344f7533cfab
Author: Kai Blin <kai at samba.org>
Date:   Mon Jan 14 01:13:47 2013 +0100

    debug: Add debugclass for DNS server
    
    Signed-off-by: Kai Blin <kai at samba.org>
    Reviewed-By: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit 4b010997486b059b90be1f69783a451f400d7df7)

commit a56ccfbe9786c57ba0b02440a957a6b6b6334b65
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Sat Jun 22 19:30:50 2013 +1000

    dsdb-ridalloc: Fix RID pools - RID numbers increase too quickly
    
    A patch by Cove Schneider <cove_s at yahoo.com> who reports:
    
    I noticed that the RID numbers seem to increase incrementally, then
    will suddenly jump by 124501. Unless I'm misunderstanding, shouldn't
    RID pool allocations just be 500 at a time?
    
    e.g.  Adding accounts one after another on a single test instance here's how they're incrementing (from 4.0.6):
    1596
    1597
    1598
    1599
    126100
    126101
    126102
    ...
    126599
    
    251100
    ...
    
    251599
    
    376100
    ...
    
    The problem is that this complicates using sssd's AD integration, as
    that it doesn't expect the RIDs to increase in a single domain so
    quickly.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Thu Jul  4 20:13:05 CEST 2013 on sn-devel-104
    (cherry picked from commit 2763cad409430c183f7f1f6f57bc6b38ae616ed9)
    
    Fix bug #10014 - Excessive RID allocation.

commit afab702a7d319a9dd6ba4e6f607d3868a4f8dbb8
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Jul 11 16:22:26 2013 +0200

    smbd: Fix a 100% loop at shutdown time
    
    In the destructor of fsp->aio_requests[0] we put another request into
    fsp->aio_requests[0]. Don't overwrite that with TALLOC_FREE.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Jul 11 20:56:42 CEST 2013 on sn-devel-104
    (cherry picked from commit 940395d38bcc348eb5f1be7ba03cd554d9d3bc93)
    
    Fix bug #10013 - 940395d from master needs porting to 4.0 and 4.1.

commit f31f55b7b0f4e3acca06660ce42fc82ecd690f91
Author: Björn Baumbach <bb at sernet.de>
Date:   Tue Jul 9 12:32:34 2013 +0200

    s3-smbstatus: display [u|g]id of -1 as "-1" in connection list
    
    In order to avoid displayed uid or gid of "4294967295" instead of "-1", we
    need to fetch the special case -1.
    The id can be -1 if we are reading e.g. incomplete session information.
    
    Signed-off-by: Björn Baumbach <bb at sernet.de>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Jul 10 01:18:30 CEST 2013 on sn-devel-104
    (cherry picked from commit 577cef82c776759c9f3cad7d33057ac865c40769)
    
    The last 3 patches address bug #10003 - s3-lib:segmentation fault while
    reading incomplete session info.

commit c286950a5499632cc5241e58bb2e552297581c9e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jul 8 16:31:13 2013 +0200

    s3-lib: hide incomplete smbXsrv_tcon_global records
    
    Part of fix for bug #10003
    
    Pair-programmed-with: Björn Baumbach <bb at sernet.de>
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Signed-off-by: Björn Baumbach <bb at sernet.de>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit c52e61f7ba215da28cbb7b8e328aea110ad79b11)

commit d15f6a82aa14fa60f59891b12b78ad4a2881a68d
Author: Björn Baumbach <bb at sernet.de>
Date:   Fri Jul 5 13:19:59 2013 +0200

    s3-lib: fix segf while reading incomplete session info (bug #10003)
    
    Pair-programmed-with: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Signed-off-by: Björn Baumbach <bb at sernet.de>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 53aa069b97070c73b782e2868b9b9686abe353cc)

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

Summary of changes:
 lib/ldb-samba/ldb_wrap.c                  |    4 +++-
 lib/param/loadparm.c                      |   18 +++++++++++++++++-
 lib/util/debug.c                          |    2 ++
 lib/util/debug.h                          |    4 +++-
 source3/lib/conn_tdb.c                    |   22 ++++++++++++++++++++--
 source3/lib/sessionid_tdb.c               |   15 ++++++++++-----
 source3/smbd/close.c                      |    7 +++++--
 source3/utils/status.c                    |   24 ++++++++++++++++++++----
 source4/dsdb/samdb/ldb_modules/ridalloc.c |    3 ++-
 9 files changed, 82 insertions(+), 17 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb-samba/ldb_wrap.c b/lib/ldb-samba/ldb_wrap.c
index 028bd6f..65956ef 100644
--- a/lib/ldb-samba/ldb_wrap.c
+++ b/lib/ldb-samba/ldb_wrap.c
@@ -37,6 +37,8 @@
 #include "../lib/util/dlinklist.h"
 #include <tdb.h>
 
+#define DBGC_CLASS DBGC_LDB
+
 /*
   this is used to catch debug messages from ldb
 */
@@ -58,7 +60,7 @@ static void ldb_wrap_debug(void *context, enum ldb_debug_level level,
 		samba_level = 2;
 		break;
 	case LDB_DEBUG_TRACE:
-		samba_level = 5;
+		samba_level = 10;
 		break;
 
 	};
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index b2e4218..aa4589d 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -2080,6 +2080,15 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
 
 	lpcfg_do_global_parameter(lp_ctx, "log level", "0");
 
+	lpcfg_do_global_parameter(lp_ctx, "syslog", "1");
+	lpcfg_do_global_parameter(lp_ctx, "syslog only", "No");
+	lpcfg_do_global_parameter(lp_ctx, "debug timestamp", "Yes");
+	lpcfg_do_global_parameter(lp_ctx, "debug prefix timestamp", "No");
+	lpcfg_do_global_parameter(lp_ctx, "debug hires timestamp", "Yes");
+	lpcfg_do_global_parameter(lp_ctx, "debug pid", "No");
+	lpcfg_do_global_parameter(lp_ctx, "debug uid", "No");
+	lpcfg_do_global_parameter(lp_ctx, "debug class", "No");
+
 	lpcfg_do_global_parameter(lp_ctx, "share backend", "classic");
 
 	lpcfg_do_global_parameter(lp_ctx, "server role", "auto");
@@ -2302,7 +2311,14 @@ static bool lpcfg_update(struct loadparm_context *lp_ctx)
 	ZERO_STRUCT(settings);
 	/* Add any more debug-related smb.conf parameters created in
 	 * future here */
-	settings.timestamp_logs = true;
+	settings.syslog = lp_ctx->globals->syslog;
+	settings.syslog_only = lp_ctx->globals->bSyslogOnly;
+	settings.timestamp_logs = lp_ctx->globals->bTimestampLogs;
+	settings.debug_prefix_timestamp = lp_ctx->globals->bDebugPrefixTimestamp;
+	settings.debug_hires_timestamp = lp_ctx->globals->bDebugHiresTimestamp;
+	settings.debug_pid = lp_ctx->globals->bDebugPid;
+	settings.debug_uid = lp_ctx->globals->bDebugUid;
+	settings.debug_class = lp_ctx->globals->bDebugClass;
 	debug_set_settings(&settings);
 
 	/* FIXME: This is a bit of a hack, but we can't use a global, since 
diff --git a/lib/util/debug.c b/lib/util/debug.c
index 6207b61..a46b275 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -177,6 +177,8 @@ static const char *default_classname_table[] = {
 	"dmapi",	     /* DBGC_DMAPI	  */
 	"registry",          /* DBGC_REGISTRY     */
 	"scavenger",         /* DBGC_SCAVENGER    */
+	"dns",               /* DBGC_DNS          */
+	"ldb",               /* DBGC_LDB          */
 	NULL
 };
 
diff --git a/lib/util/debug.h b/lib/util/debug.h
index c61fd13..bd7056e 100644
--- a/lib/util/debug.h
+++ b/lib/util/debug.h
@@ -80,9 +80,11 @@ bool dbghdr( int level, const char *location, const char *func);
 #define DBGC_DMAPI		18
 #define DBGC_REGISTRY		19
 #define DBGC_SCAVENGER		20
+#define DBGC_DNS		21
+#define DBGC_LDB		22
 
 /* Always ensure this is updated when new fixed classes area added, to ensure the array in debug.c is the right size */
-#define DBGC_MAX_FIXED		20
+#define DBGC_MAX_FIXED		22
 
 /* So you can define DBGC_CLASS before including debug.h */
 #ifndef DBGC_CLASS
diff --git a/source3/lib/conn_tdb.c b/source3/lib/conn_tdb.c
index a7e7cf0..b218831 100644
--- a/source3/lib/conn_tdb.c
+++ b/source3/lib/conn_tdb.c
@@ -53,8 +53,13 @@ static int collect_sessions_fn(struct smbXsrv_session_global0 *global,
 	uint32_t id = global->session_global_id;
 	struct connections_forall_session sess;
 
-	sess.uid = global->auth_session_info->unix_token->uid;
-	sess.gid = global->auth_session_info->unix_token->gid;
+	if (global->auth_session_info == NULL) {
+		sess.uid = -1;
+		sess.gid = -1;
+	} else {
+		sess.uid = global->auth_session_info->unix_token->uid;
+		sess.gid = global->auth_session_info->unix_token->gid;
+	}
 	strncpy(sess.machine, global->channels[0].remote_name, sizeof(sess.machine));
 	strncpy(sess.addr, global->channels[0].remote_address, sizeof(sess.addr));
 
@@ -86,6 +91,19 @@ static int traverse_tcon_fn(struct smbXsrv_tcon_global0 *global,
 
 	TDB_DATA val = tdb_null;
 
+	/*
+	 * Note: that share_name is defined as array without a pointer.
+	 * that's why it's always a valid pointer here.
+	 */
+	if (strlen(global->share_name) == 0) {
+		/*
+		 * when a smbXsrv_tcon is created it's created
+		 * with emtpy share_name first in order to allocate
+		 * an id, before filling in the details.
+		 */
+		return 0;
+	}
+
 	status = dbwrap_fetch(state->session_by_pid, state,
 			      make_tdb_data((void*)&sess_id, sizeof(sess_id)),
 			      &val);
diff --git a/source3/lib/sessionid_tdb.c b/source3/lib/sessionid_tdb.c
index 045b3d2..7a19611 100644
--- a/source3/lib/sessionid_tdb.c
+++ b/source3/lib/sessionid_tdb.c
@@ -38,16 +38,21 @@ static int sessionid_traverse_read_fn(struct smbXsrv_session_global0 *global,
 		(struct sessionid_traverse_read_state *)private_data;
 	struct auth_session_info *session_info = global->auth_session_info;
 	struct sessionid session = {
-		.uid = session_info->unix_token->uid,
-		.gid = session_info->unix_token->gid,
+		.uid = -1,
+		.gid = -1,
 		.id_num = global->session_global_id,
 		.connect_start = nt_time_to_unix(global->creation_time),
 		.pid = global->channels[0].server_id,
 	};
 
-	strncpy(session.username,
-		session_info->unix_info->unix_name,
-		sizeof(fstring)-1);
+	if (session_info != NULL) {
+		session.uid = session_info->unix_token->uid;
+		session.gid = session_info->unix_token->gid;
+		strncpy(session.username,
+			session_info->unix_info->unix_name,
+			sizeof(fstring)-1);
+	}
+
 	strncpy(session.remote_machine,
 		global->channels[0].remote_name,
 		sizeof(fstring)-1);
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 5dddf45..e5b1fb7 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -740,9 +740,12 @@ static NTSTATUS close_normal_file(struct smb_request *req, files_struct *fsp,
 		while (fsp->num_aio_requests != 0) {
 			/*
 			 * The destructor of the req will remove
-			 * itself from the fsp
+			 * itself from the fsp.
+			 * Don't use TALLOC_FREE here, this will overwrite
+			 * what the destructor just wrote into
+			 * aio_requests[0].
 			 */
-			TALLOC_FREE(fsp->aio_requests[0]);
+			talloc_free(fsp->aio_requests[0]);
 		}
 	}
 
diff --git a/source3/utils/status.c b/source3/utils/status.c
index 0cb46a5..4e823da 100644
--- a/source3/utils/status.c
+++ b/source3/utils/status.c
@@ -277,13 +277,29 @@ static int traverse_sessionid(const char *key, struct sessionid *session,
 
 	Ucrit_addPid(session->pid);
 
-	fstr_sprintf(uid_str, "%u", (unsigned int)session->uid);
-	fstr_sprintf(gid_str, "%u", (unsigned int)session->gid);
+	fstrcpy(uid_str, "-1");
+
+	if (session->uid != -1) {
+		if (numeric_only) {
+			fstr_sprintf(uid_str, "%u", (unsigned int)session->uid);
+		} else {
+			fstrcpy(uid_str, uidtoname(session->uid));
+		}
+	}
+
+	fstrcpy(gid_str, "-1");
+
+	if (session->gid != -1) {
+		if (numeric_only) {
+			fstr_sprintf(gid_str, "%u", (unsigned int)session->gid);
+		} else {
+			fstrcpy(gid_str, gidtoname(session->gid));
+		}
+	}
 
 	d_printf("%-7s   %-12s  %-12s  %-12s (%s)\n",
 		 procid_str_static(&session->pid),
-		 numeric_only ? uid_str : uidtoname(session->uid),
-		 numeric_only ? gid_str : gidtoname(session->gid),
+		 uid_str, gid_str,
 		 session->remote_machine, session->hostname);
 
 	return 0;
diff --git a/source4/dsdb/samdb/ldb_modules/ridalloc.c b/source4/dsdb/samdb/ldb_modules/ridalloc.c
index d0266ed..3b4f73d 100644
--- a/source4/dsdb/samdb/ldb_modules/ridalloc.c
+++ b/source4/dsdb/samdb/ldb_modules/ridalloc.c
@@ -605,7 +605,8 @@ int ridalloc_allocate_rid(struct ldb_module *module, uint32_t *rid, struct ldb_r
 	/*
 	 * if we are half-exhausted then try to get a new pool.
 	 */
-	if (nridset.next_rid > (prev_pool_hi + prev_pool_lo)/2) {
+	if (nridset.next_rid > (prev_pool_hi + prev_pool_lo)/2 &&
+	    nridset.alloc_pool == nridset.prev_pool) {
 		/*
 		 * if we are the RID Manager,
 		 * we can get a new pool localy.


-- 
Samba Shared Repository


More information about the samba-cvs mailing list