]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
regdb: use db_open_trans()
authorStefan Metzmacher <metze@samba.org>
Thu, 27 Mar 2008 15:57:51 +0000 (16:57 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 27 Mar 2008 17:14:56 +0000 (18:14 +0100)
metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>
source/registry/reg_backend_db.c

index 3e2502e4f86cd67bcd04f0a1c220f5458195903e..3234e7447ecf8031c652944256208e6ce7ad238f 100644 (file)
@@ -330,11 +330,11 @@ bool regdb_init(void)
                return true;
        }
 
-       regdb = db_open(NULL, state_path("registry.tdb"), 0, REG_TDB_FLAGS,
-                       O_RDWR, 0600);
+       regdb = db_open_trans(NULL, state_path("registry.tdb"), 0,
+                             REG_TDB_FLAGS, O_RDWR, 0600);
        if (!regdb) {
-               regdb = db_open(NULL, state_path("registry.tdb"), 0,
-                               REG_TDB_FLAGS, O_RDWR|O_CREAT, 0600);
+               regdb = db_open_trans(NULL, state_path("registry.tdb"), 0,
+                                     REG_TDB_FLAGS, O_RDWR|O_CREAT, 0600);
                if (!regdb) {
                        DEBUG(0,("regdb_init: Failed to open registry %s (%s)\n",
                                state_path("registry.tdb"), strerror(errno) ));
@@ -381,7 +381,8 @@ WERROR regdb_open( void )
        
        become_root();
 
-       regdb = db_open(NULL, state_path("registry.tdb"), 0, REG_TDB_FLAGS, O_RDWR, 0600);
+       regdb = db_open_trans(NULL, state_path("registry.tdb"), 0,
+                             REG_TDB_FLAGS, O_RDWR, 0600);
        if ( !regdb ) {
                result = ntstatus_to_werror( map_nt_error_from_unix( errno ) );
                DEBUG(0,("regdb_open: Failed to open %s! (%s)\n",