s3:net registry import: implement dry-run with "--test"
authorMichael Adam <obnox@samba.org>
Tue, 26 Jun 2012 13:35:32 +0000 (15:35 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 26 Jun 2012 19:43:49 +0000 (21:43 +0200)
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Jun 26 21:43:49 CEST 2012 on sn-devel-104

source3/utils/net_registry.c

index 44ebef5bf27860a6cda4b2dc3b5274e312dbd264..0993b958b18284bb0fd9b289c32aa0106639e98d 100644 (file)
@@ -1303,6 +1303,12 @@ static int net_registry_import(struct net_context *c, int argc,
 
        SMB_ASSERT(ret == 0);
 
+       if (c->opt_testmode) {
+               d_printf("Testmode: not committing changes.\n");
+               regdb_transaction_cancel();
+               goto done;
+       }
+
        werr = regdb_transaction_commit();
        if (!W_ERROR_IS_OK(werr)) {
                d_printf("Failed to commit transaction on regdb: %s\n",