On Wed, Jun 25, 2003 at 08:15:51AM +0000, [EMAIL PROTECTED] wrote: > Set back 3.0 to use only winbindd_idmap.tdb as idmap database as told on > samba-technical.
It's purely cosmetic, but I don't like nested if-expressions. I always find them hard to follow. What about the attached patch? Completely untested... Volker
Index: sam/idmap_tdb.c =================================================================== RCS file: /data/cvs/samba/source/sam/idmap_tdb.c,v retrieving revision 1.12.2.15 diff -u -r1.12.2.15 idmap_tdb.c --- sam/idmap_tdb.c 25 Jun 2003 08:15:51 -0000 1.12.2.15 +++ sam/idmap_tdb.c 25 Jun 2003 08:24:56 -0000 @@ -427,20 +427,20 @@ SAFE_FREE(tdbfile); + if (tdb_is_new) { + /* the file didn't existed before opening it, let's + * store idmap version as nobody else yet opened and + * stored it. I do not like this method but didn't + * found a way to understand if an opened tdb have + * been just created or not --- SSS */ + tdb_store_int32(idmap_tdb, "IDMAP_VERSION", IDMAP_VERSION); + } + /* check against earlier versions */ version = tdb_fetch_int32(idmap_tdb, "IDMAP_VERSION"); if (version != IDMAP_VERSION) { - if (tdb_is_new) { - /* the file didn't existed before opening it, let's - * store idmap version as nobody else yet opened and - * stored it. I do not like this method but didn't - * found a way to understand if an opened tdb have - * been just created or not --- SSS */ - tdb_store_int32(idmap_tdb, "IDMAP_VERSION", IDMAP_VERSION); - } else { - DEBUG(0, ("idmap_init: Unable to open idmap database, it's in an old format!\n")); - return NT_STATUS_INTERNAL_DB_ERROR; - } + DEBUG(0, ("idmap_init: Unable to open idmap database, it's in an old format!\n")); + return NT_STATUS_INTERNAL_DB_ERROR; } /* Create high water marks for group and user id */
pgp00000.pgp
Description: PGP signature