[SCM] Samba Shared Repository - branch master updated

Amitay Isaacs amitay at samba.org
Sun Feb 12 19:03:02 MST 2012


The branch, master has been updated
       via  bee55a2 s4-dsdb: Check if metadata.tdb exists, before trying to open it
      from  caf485a auth: Pass in the SMB username (for %U) into generate_session_info

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


- Log -----------------------------------------------------------------
commit bee55a29578e8eab66c36de9b2526769b05b8dba
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Feb 13 11:07:06 2012 +1100

    s4-dsdb: Check if metadata.tdb exists, before trying to open it
    
    This fixes the error output from tdb2 when metadata module tries
    to create metadata.tdb first time. This error is reported since
    metadata module tries to check if tdb exists by trying to open
    tdb file.
    
    Autobuild-User: Amitay Isaacs <amitay at samba.org>
    Autobuild-Date: Mon Feb 13 03:02:09 CET 2012 on sn-devel-104

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

Summary of changes:
 .../dsdb/samdb/ldb_modules/partition_metadata.c    |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/partition_metadata.c b/source4/dsdb/samdb/ldb_modules/partition_metadata.c
index acf414b..e3f0fb5 100644
--- a/source4/dsdb/samdb/ldb_modules/partition_metadata.c
+++ b/source4/dsdb/samdb/ldb_modules/partition_metadata.c
@@ -152,6 +152,7 @@ static int partition_metadata_open(struct ldb_module *module, bool create)
 	const char *sam_name;
 	char *filename, *dirname;
 	int open_flags;
+	struct stat statbuf;
 
 	data = talloc_get_type_abort(ldb_module_get_private(module),
 				     struct partition_private_data);
@@ -193,6 +194,11 @@ static int partition_metadata_open(struct ldb_module *module, bool create)
 
 		mkdir(dirname, 0700);
 		talloc_free(dirname);
+	} else {
+		if (stat(filename, &statbuf) != 0) {
+			talloc_free(tmp_ctx);
+			return LDB_ERR_OPERATIONS_ERROR;
+		}
 	}
 
 	lp_ctx = talloc_get_type_abort(ldb_get_opaque(ldb, "loadparm"),


-- 
Samba Shared Repository


More information about the samba-cvs mailing list