]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r22313: as discussed with simo:
authorStefan Metzmacher <metze@samba.org>
Tue, 17 Apr 2007 16:06:20 +0000 (16:06 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:19:25 +0000 (12:19 -0500)
remove the only usage of backup_tdb() in samba3.
As backup_tdb() will go completely soon.

metze

source/nsswitch/idmap_tdb.c

index 6aff7549467266c7215ce2d437d1b7141bf3d9ae..73db1def0ce844571cd053ed43bda002c55cd98e 100644 (file)
@@ -115,13 +115,15 @@ static int convert_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA data, void *state
  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 @@ static BOOL idmap_tdb_convert(const char *idmap_name)
        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 @@ static NTSTATUS idmap_tdb_open_db(TALLOC_CTX *memctx, TDB_CONTEXT **tdbctx)
                /* 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;