diff options
author | Gregor Beck <gbeck@sernet.de> | 2012-04-19 13:32:26 +0200 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2012-04-25 14:23:03 +0200 |
commit | 4eb4f75371aa16bf19474090b1dbef042e9a0446 (patch) | |
tree | 705426e787e7a417bf01346c47a9e2084ea9eaeb /source3/utils | |
parent | c6224e46aa0bd25f81b6f75b5cfc3d54d07261d9 (diff) | |
download | samba-4eb4f75371aa16bf19474090b1dbef042e9a0446.tar.gz samba-4eb4f75371aa16bf19474090b1dbef042e9a0446.tar.bz2 samba-4eb4f75371aa16bf19474090b1dbef042e9a0446.zip |
s3:eventlogadm make a transaction for addsource
Signed-off-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/eventlogadm.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source3/utils/eventlogadm.c b/source3/utils/eventlogadm.c index 745e0ce383..8d8fa4a4d7 100644 --- a/source3/utils/eventlogadm.c +++ b/source3/utils/eventlogadm.c @@ -28,6 +28,7 @@ #include "registry/reg_api.h" #include "registry/reg_init_basic.h" #include "registry/reg_util_token.h" +#include "registry/reg_backend_db.h" #include "../libcli/registry/util_reg.h" extern int optind; @@ -265,9 +266,21 @@ static int DoAddSourceCommand( int argc, char **argv, bool debugflag, char *exen printf("Can't open the registry: %s.\n", win_errstr(werr)); return -1; } + werr = regdb_transaction_start(); + if (!W_ERROR_IS_OK(werr)) { + printf("Can't start transaction on registry: %s.\n", win_errstr(werr)); + return -1; + } - if ( !eventlog_add_source( argv[0], argv[1], argv[2] ) ) + if ( !eventlog_add_source( argv[0], argv[1], argv[2] ) ) { + regdb_transaction_cancel(); return -2; + } + werr = regdb_transaction_commit(); + if (!W_ERROR_IS_OK(werr)) { + printf("Failed to commit transaction on registry: %s.\n", win_errstr(werr)); + return -1; + } return 0; } |