s3:dbwrap: If "-n" is given to dbwrap_torture, open db with CLEAR_IF_FIRST
authorVolker Lendecke <vl@samba.org>
Fri, 11 Dec 2009 15:51:40 +0000 (16:51 +0100)
committerMichael Adam <obnox@samba.org>
Fri, 12 Feb 2010 22:12:10 +0000 (23:12 +0100)
source3/utils/dbwrap_torture.c

index 3cffd467874daaebc40fb929ee77fce3a0038020..f96b8f176c5ec0e76b60475e125a94bf1d3f3dcf 100644 (file)
@@ -299,6 +299,10 @@ int main(int argc, const char *argv[])
                tdb_flags = TDB_DEFAULT;
        }
 
+       if (no_trans) {
+               tdb_flags |= TDB_CLEAR_IF_FIRST;
+       }
+
        db = db_open(mem_ctx, db_name, 0, tdb_flags,  O_RDWR | O_CREAT, 0644);
 
        if (db == NULL) {