s3:registry: prevent unnecessary transactions in regdb_init
authorMichael Adam <obnox@samba.org>
Wed, 9 Nov 2011 10:14:38 +0000 (11:14 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 9 Nov 2011 14:06:58 +0000 (15:06 +0100)
Skip the transaction for the upgrade code, if the database
is already at code-level.

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Wed Nov  9 15:06:59 CET 2011 on sn-devel-104

source3/registry/reg_backend_db.c

index 7fa6249cecd070cb524549744171966eb2e4bb84..4d4aaeb4b54a33a2bd01c9300399e99e7cdecaf3 100644 (file)
@@ -687,6 +687,10 @@ WERROR regdb_init(void)
                vers_id = REGDB_VERSION_V1;
        }
 
+       if (vers_id == REGDB_CODE_VERSION) {
+               return WERR_OK;
+       }
+
        if (vers_id > REGDB_CODE_VERSION || vers_id == 0) {
                DEBUG(0, ("regdb_init: unknown registry version %d "
                          "(code version = %d), refusing initialization\n",