Rev 5348: merge from upstream in http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/

Michael Adam ma at sernet.de
Wed Apr 11 14:34:33 GMT 2007


At http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/

------------------------------------------------------------
revno: 5348
revision-id: ma at sernet.de-20070411143428-49f14e3085db5e99
parent: ma at sernet.de-20070410212018-6a54e7de1e2cc21b
parent: jra at samba.org-20070411110342-vmenxo050isa4psg
committer: Michael Adam <ma at sernet.de>
branch nick: SAMBA_3_0-registry.bzr
timestamp: Wed 2007-04-11 16:34:28 +0200
message:
  merge from upstream
modified:
  REVISION                       REVISION-20060530022625-68239662668b41c3
  source/client/client.c         client.c-20060530022627-a5e98bdfdd1ca9d9
  source/include/smb_share_modes.h smb_share_modes.h-20060530073737-c8fce1dbe2345de9
  source/libsmb/smb_share_modes.c smb_share_modes.c-20060530073738-d37c371a41d3c54a
  source/nmbd/nmbd_subnetdb.c    nmbd_subnetdb.c-20060530022627-74c441c66a29c8c4
  source/nsswitch/idmap.c        idmap.c-20061212152801-ke1ub3n5v1jjf8gy-1
  source/nsswitch/idmap_ad.c     idmap_ad.c-20061212152802-3w9k6jbk4ef61xmv-1
  source/rpc_parse/parse_prs.c   parse_prs.c-20060530022627-0ebae6d950fb538d
  source/tdb/common/transaction.c transaction.c-20060823151029-6cd356e535b2baa2
    ------------------------------------------------------------
    merged: jra at samba.org-20070411110342-vmenxo050isa4psg
    parent: jra at samba.org-20070411110155-o9ry9zx1awjiqayl
    committer: jra at samba.org
    branch nick: SAMBA_3_0.bzr
    timestamp: Wed 2007-04-11 06:03:42 -0500
    message:
      jra at samba.org (r22164)  2007-04-11 00:27:00 -0500 (Wed, 11 Apr 2007)
          
          Fix missing lock count release in transaction cancel.
          Found by Taj Khattra <taj.khattra at gmail.com>.
          Jeremy.
          
    ------------------------------------------------------------
    merged: jra at samba.org-20070411110155-o9ry9zx1awjiqayl
    parent: jerry at samba.org-20070410231730-0adilk9fmoa50vc6
    committer: jra at samba.org
    branch nick: SAMBA_3_0.bzr
    timestamp: Wed 2007-04-11 06:01:55 -0500
    message:
      jra at samba.org (r22163)  2007-04-11 00:05:33 -0500 (Wed, 11 Apr 2007)
          
          Pure reformatting. I hate 4 space tabstops :-).
          Jeremy.
          
    ------------------------------------------------------------
    merged: jerry at samba.org-20070410231730-0adilk9fmoa50vc6
    parent: jerry at samba.org-20070410231555-1vf31cp6cvs7r5kz
    committer: jerry at samba.org
    branch nick: SAMBA_3_0.bzr
    timestamp: Tue 2007-04-10 18:17:30 -0500
    message:
      jerry at samba.org (r22159)  2007-04-10 17:59:42 -0500 (Tue, 10 Apr 2007)
          
          BUG 4501 (second half of fix): Just disable the
          uid/gid allocation if no idmap alloca backend has been 
          defined and we are not using a 3.0.24 idmap backend 
          compatible configuration.
          
          
    ------------------------------------------------------------
    merged: jerry at samba.org-20070410231555-1vf31cp6cvs7r5kz
    parent: jra at samba.org-20070410231420-33x8mp3fbhfx8gn3
    committer: jerry at samba.org
    branch nick: SAMBA_3_0.bzr
    timestamp: Tue 2007-04-10 18:15:55 -0500
    message:
      jerry at samba.org (r22158)  2007-04-10 16:14:44 -0500 (Tue, 10 Apr 2007)
          
          BUG 4501 (partial): Fix a crash caused by not using the 
          nss_info_{rfc2307,sfu} plugin with idmap_ad.
          
          
    ------------------------------------------------------------
    merged: jra at samba.org-20070410231420-33x8mp3fbhfx8gn3
    parent: jra at samba.org-20070410231110-gqxo6ew39ujd803u
    committer: jra at samba.org
    branch nick: SAMBA_3_0.bzr
    timestamp: Tue 2007-04-10 18:14:20 -0500
    message:
      jra at samba.org (r22157)  2007-04-10 15:35:30 -0500 (Tue, 10 Apr 2007)
          
          Fix bug #3634 - stop nmbd segfaulting with bad interface line.
          Jeremy.
          
    ------------------------------------------------------------
    merged: jra at samba.org-20070410231110-gqxo6ew39ujd803u
    parent: jra at samba.org-20070410230833-e0t6woa3l9l5ozde
    committer: jra at samba.org
    branch nick: SAMBA_3_0.bzr
    timestamp: Tue 2007-04-10 18:11:10 -0500
    message:
      jra at samba.org (r22155)  2007-04-10 13:21:37 -0500 (Tue, 10 Apr 2007)
          
          Fixed warning #4498 from jason at ncac.gwu.edu.
          Jeremy.
          
    ------------------------------------------------------------
    merged: jra at samba.org-20070410230833-e0t6woa3l9l5ozde
    parent: metze at samba.org-20070410170757-9ky0kr0jt9elqesd
    committer: jra at samba.org
    branch nick: SAMBA_3_0.bzr
    timestamp: Tue 2007-04-10 18:08:33 -0500
    message:
      jra at samba.org (r22154)  2007-04-10 13:12:25 -0500 (Tue, 10 Apr 2007)
          
          Make struct smbdb_ctx an opaque pointer so users of the API
          don't need to have tdb.h.
          Jeremy.
          
=== modified file 'REVISION'
--- a/REVISION	2007-04-10 17:07:57 +0000
+++ b/REVISION	2007-04-11 11:03:42 +0000
@@ -2,9 +2,9 @@
 URL: svn+ssh://svn.samba.org/home/svn/samba/branches/SAMBA_3_0
 Repository Root: svn+ssh://svn.samba.org/home/svn/samba
 Repository UUID: 0c0555d6-39d7-0310-84fc-f1cc0bd64818
-Revision: 22153
+Revision: 22164
 Node Kind: directory
-Last Changed Author: metze
-Last Changed Rev: 22153
-Last Changed Date: 2007-04-10 11:04:22 -0500 (Tue, 10 Apr 2007)
+Last Changed Author: jra
+Last Changed Rev: 22164
+Last Changed Date: 2007-04-11 00:27:00 -0500 (Wed, 11 Apr 2007)
 

=== modified file 'source/client/client.c'
--- a/source/client/client.c	2007-03-30 15:40:29 +0000
+++ b/source/client/client.c	2007-04-10 23:11:10 +0000
@@ -4020,13 +4020,13 @@
 			/* We must use old option processing for this. Find the
 			 * position of the -T option in the raw argv[]. */
 			{
-				int i, optnum;
+				int i;
 				for (i = 1; i < argc; i++) {
 					if (strncmp("-T", argv[i],2)==0)
 						break;
 				}
 				i++;
-				if (!(optnum = tar_parseargs(argc, argv, poptGetOptArg(pc), i))) {
+				if (!tar_parseargs(argc, argv, poptGetOptArg(pc), i)) {
 					poptPrintUsage(pc, stderr, 0);
 					exit(1);
 				}

=== modified file 'source/include/smb_share_modes.h'
--- a/source/include/smb_share_modes.h	2006-05-30 07:47:30 +0000
+++ b/source/include/smb_share_modes.h	2007-04-10 23:08:33 +0000
@@ -33,12 +33,8 @@
 # endif
 #endif
 
-#include "tdb.h"
-
-/* Database context handle. */
-struct smbdb_ctx {
-	TDB_CONTEXT *smb_tdb;
-};
+/* Opaque database context handle. */
+struct smbdb_ctx;
 
 /* Share mode entry. */
 /*

=== modified file 'source/libsmb/smb_share_modes.c'
--- a/source/libsmb/smb_share_modes.c	2007-03-30 15:45:48 +0000
+++ b/source/libsmb/smb_share_modes.c	2007-04-10 23:08:33 +0000
@@ -28,6 +28,11 @@
 #include "includes.h"
 #include "smb_share_modes.h"
 
+/* Database context handle. */
+struct smbdb_ctx {
+	TDB_CONTEXT *smb_tdb;
+};
+
 /* Remove the paranoid malloc checker. */
 #ifdef malloc
 #undef malloc

=== modified file 'source/nmbd/nmbd_subnetdb.c'
--- a/source/nmbd/nmbd_subnetdb.c	2006-06-28 01:36:29 +0000
+++ b/source/nmbd/nmbd_subnetdb.c	2007-04-10 23:14:20 +0000
@@ -223,6 +223,13 @@
 			return False;
 	}
 
+        /* We must have at least one subnet. */
+	if (subnetlist == NULL) {
+		DEBUG(0,("create_subnets: unable to create any subnet from "
+				"given interfaces. nmbd is terminating\n"));
+		return False;
+	}
+
 	if (lp_we_are_a_wins_server()) {
 		/* Pick the first interface ip address as the WINS server ip. */
 		struct in_addr *nip = iface_n_ip(0);

=== modified file 'source/nsswitch/idmap.c'
--- a/source/nsswitch/idmap.c	2007-04-06 23:11:38 +0000
+++ b/source/nsswitch/idmap.c	2007-04-10 23:17:30 +0000
@@ -259,7 +259,7 @@
 	char *compat_backend = NULL;
 	char *compat_params = NULL;
 	const char **dom_list = NULL;
-	char *alloc_backend;
+	char *alloc_backend = NULL;
 	BOOL default_already_defined = False;
 	BOOL pri_dom_is_in_list = False;
 	int compat = 0;
@@ -561,11 +561,11 @@
 	}
 
 
-	/***************************
-	 * initialize alloc module
-	 */
-	DEBUG(1, ("Initializing idmap alloc module\n"));
-
+	/* Initialize alloc module */
+
+	DEBUG(3, ("Initializing idmap alloc module\n"));
+
+	alloc_backend = NULL;
 	if (compat) {
 		alloc_backend = talloc_strdup(idmap_ctx, compat_backend);
 	} else {
@@ -573,11 +573,10 @@
 		
 		if (ab && (ab[0] != '\0')) {
 			alloc_backend = talloc_strdup(idmap_ctx, lp_idmap_alloc_backend());
-		} else {
-			alloc_backend = talloc_strdup(idmap_ctx, "tdb");
 		}
 	}
-	IDMAP_CHECK_ALLOC(alloc_backend);
+
+	if ( alloc_backend ) {
 
 	alloc_methods = get_alloc_methods(alloc_backends, alloc_backend);
 	if ( ! alloc_methods) {
@@ -603,6 +602,7 @@
 		else
 			ret = NT_STATUS_UNSUCCESSFUL;
 	}
+	}
 
 	/* cleanpu temporary strings */
 	TALLOC_FREE( compat_backend );

=== modified file 'source/nsswitch/idmap_ad.c'
--- a/source/nsswitch/idmap_ad.c	2007-04-06 23:11:38 +0000
+++ b/source/nsswitch/idmap_ad.c	2007-04-10 23:15:55 +0000
@@ -164,14 +164,10 @@
 {
 	struct idmap_ad_context *ctx;
 	char *config_option;
-	const char *range;
+	const char *range = NULL;
+	const char *schema_mode = NULL;	
 	ADS_STRUCT *ads;
 
-	/* verify AD is reachable (not critical, we may just be offline at start) */
-	if ( (ads = ad_idmap_cached_connection()) == NULL ) {
-		DEBUG(1, ("WARNING: Could not init an AD connection! Mapping might not work.\n"));
-	}
-
 	if ( (ctx = talloc_zero(dom, struct idmap_ad_context)) == NULL ) {
 		DEBUG(0, ("Out of memory!\n"));
 		return NT_STATUS_NO_MEMORY;
@@ -194,6 +190,20 @@
 		}
 	}
 
+	/* schema mode */
+	if ( ad_map_type == WB_POSIX_MAP_UNKNOWN )
+		ad_map_type = WB_POSIX_MAP_RFC2307;
+	schema_mode = lp_parm_const_string(-1, config_option, "schema_mode", NULL);
+	if ( schema_mode && schema_mode[0] ) {
+		if ( strequal(schema_mode, "sfu") )
+			ad_map_type = WB_POSIX_MAP_SFU;
+		else if ( strequal(schema_mode, "rfc2307" ) )
+			ad_map_type = WB_POSIX_MAP_RFC2307;
+		else
+			DEBUG(0,("idmap_ad_initialize: Unknown schema_mode (%s)\n",
+				 schema_mode));
+	}
+
 	dom->private_data = ctx;
 
 	talloc_free(config_option);

=== modified file 'source/rpc_parse/parse_prs.c'
--- a/source/rpc_parse/parse_prs.c	2007-03-30 15:43:31 +0000
+++ b/source/rpc_parse/parse_prs.c	2007-04-11 11:01:55 +0000
@@ -1456,38 +1456,38 @@
 /* useful function to store a structure in rpc wire format */
 int tdb_prs_store(TDB_CONTEXT *tdb, TDB_DATA kbuf, prs_struct *ps)
 {
-    TDB_DATA dbuf;
-    dbuf.dptr = (uint8 *)ps->data_p;
-    dbuf.dsize = prs_offset(ps);
-    return tdb_trans_store(tdb, kbuf, dbuf, TDB_REPLACE);
+	TDB_DATA dbuf;
+	dbuf.dptr = (uint8 *)ps->data_p;
+	dbuf.dsize = prs_offset(ps);
+	return tdb_trans_store(tdb, kbuf, dbuf, TDB_REPLACE);
 }
 
 int tdb_prs_store_bystring(TDB_CONTEXT *tdb, char *keystr, prs_struct *ps)
 {
-    TDB_DATA kbuf = string_term_tdb_data(keystr);
-    return tdb_prs_store(tdb, kbuf, ps);
+	TDB_DATA kbuf = string_term_tdb_data(keystr);
+	return tdb_prs_store(tdb, kbuf, ps);
 }
 
 /* useful function to fetch a structure into rpc wire format */
 int tdb_prs_fetch(TDB_CONTEXT *tdb, TDB_DATA kbuf, prs_struct *ps, TALLOC_CTX *mem_ctx)
 {
-    TDB_DATA dbuf;
-
-    prs_init(ps, 0, mem_ctx, UNMARSHALL);
-
-    dbuf = tdb_fetch(tdb, kbuf);
-    if (!dbuf.dptr)
-	    return -1;
-
-    prs_give_memory(ps, (char *)dbuf.dptr, dbuf.dsize, True);
-
-    return 0;
+	TDB_DATA dbuf;
+
+	prs_init(ps, 0, mem_ctx, UNMARSHALL);
+
+	dbuf = tdb_fetch(tdb, kbuf);
+	if (!dbuf.dptr)
+		return -1;
+
+	prs_give_memory(ps, (char *)dbuf.dptr, dbuf.dsize, True);
+
+	return 0;
 } 
 
 int tdb_prs_fetch_bystring(TDB_CONTEXT *tdb, char *keystr, prs_struct *ps, TALLOC_CTX *mem_ctx)
 {
-    TDB_DATA kbuf = string_term_tdb_data(keystr);
-    return tdb_prs_fetch(tdb, kbuf, ps, mem_ctx);
+	TDB_DATA kbuf = string_term_tdb_data(keystr);
+	return tdb_prs_fetch(tdb, kbuf, ps, mem_ctx);
 }
 
 /*******************************************************************

=== modified file 'source/tdb/common/transaction.c'
--- a/source/tdb/common/transaction.c	2007-04-02 23:02:06 +0000
+++ b/source/tdb/common/transaction.c	2007-04-11 11:03:42 +0000
@@ -523,6 +523,8 @@
 				   F_UNLCK,F_SETLKW, 0, 1);
 		}
 		tdb->num_locks = 0;
+		tdb->num_lockrecs = 0;
+		SAFE_FREE(tdb->lockrecs);
 	}
 
 	/* restore the normal io methods */



More information about the samba-cvs mailing list