svn commit: samba r22313 - in branches/SAMBA_3_0/source/nsswitch: .

metze at samba.org metze at samba.org
Tue Apr 17 16:06:21 GMT 2007


Author: metze
Date: 2007-04-17 16:06:20 +0000 (Tue, 17 Apr 2007)
New Revision: 22313

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22313

Log:
as discussed with simo:

remove the only usage of backup_tdb() in samba3.
As backup_tdb() will go completely soon.

metze
Modified:
   branches/SAMBA_3_0/source/nsswitch/idmap_tdb.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/idmap_tdb.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/idmap_tdb.c	2007-04-17 15:55:08 UTC (rev 22312)
+++ branches/SAMBA_3_0/source/nsswitch/idmap_tdb.c	2007-04-17 16:06:20 UTC (rev 22313)
@@ -115,13 +115,15 @@
  Convert the idmap database from an older version.
 *****************************************************************************/
 
-static BOOL idmap_tdb_convert(const char *idmap_name)
+static BOOL idmap_tdb_upgrade(const char *idmap_name)
 {
 	int32 vers;
 	BOOL bigendianheader;
 	BOOL failed = False;
 	TDB_CONTEXT *idmap_tdb;
 
+	DEBUG(0, ("Upgrading winbindd_idmap.tdb from an old version\n"));
+
 	if (!(idmap_tdb = tdb_open_log(idmap_name, 0,
 					TDB_DEFAULT, O_RDWR,
 					0600))) {
@@ -189,32 +191,6 @@
 	return True;
 }
 
-/*****************************************************************************
- Convert the idmap database from an older version if necessary
-*****************************************************************************/
-
-BOOL idmap_tdb_upgrade(TALLOC_CTX *ctx, const char *tdbfile)
-{
-	char *backup_name;
-
-	DEBUG(0, ("Upgrading winbindd_idmap.tdb from an old version\n"));
-
-	backup_name = talloc_asprintf(ctx, "%s.bak", tdbfile);
-	if ( ! backup_name) {
-		DEBUG(0, ("Out of memory!\n"));
-		return False;
-	}
-
-	if (backup_tdb(tdbfile, backup_name, 0) != 0) {
-		DEBUG(0, ("Could not backup idmap database\n"));
-		talloc_free(backup_name);
-		return False;
-	}
-
-	talloc_free(backup_name);
-	return idmap_tdb_convert(tdbfile);
-}
-
 /* WARNING: We can't open a tdb twice inthe same process, for that reason
  * I'm going to use a hack with open ref counts to open the winbindd_idmap.tdb
  * only once. We will later decide whether to split the db in multiple files
@@ -282,7 +258,7 @@
 		/* backup_tdb expects the tdb not to be open */
 		tdb_close(idmap_tdb_common_ctx);
 
-		if ( ! idmap_tdb_upgrade(ctx, tdbfile)) {
+		if ( ! idmap_tdb_upgrade(tdbfile)) {
 		
 			DEBUG(0, ("Unable to open idmap database, it's in an old formati, and upgrade failed!\n"));
 			ret = NT_STATUS_INTERNAL_DB_ERROR;



More information about the samba-cvs mailing list