When upgrading from an old idmap tdb, remember to overwrite the reverse
authorJeremy Allison <jra@samba.org>
Thu, 21 Mar 2002 23:19:17 +0000 (23:19 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 21 Mar 2002 23:19:17 +0000 (23:19 +0000)
mapping as well as the forward one. Found this in doing the backport to
2.2.x. This is *essential* to upgrade an old idmap file to a new one.
Jeremy.
(This used to be commit 980355de0c9d0d1116b29b0a5be98d0b277f24dc)

source3/nsswitch/winbindd_idmap.c

index c94b2b6053d1efe301b727c741b179ec8a4cfa7e..6361cbc70a71c7ce0f38076c9be15b6233d4b415 100644 (file)
@@ -276,6 +276,11 @@ static int convert_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA data, void *ignor
                return 0;
        }
 
+       if (tdb_store(idmap_tdb, data, key2, TDB_REPLACE) != 0) {
+               /* not good! */
+               return 0;
+       }
+
        tdb_delete(idmap_tdb, key);
 
        return 0;