summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-02-26 01:22:03 +0100
committerMichael Adam <obnox@samba.org>2009-02-26 13:22:55 +0100
commit13ceeeedbc188f4c68f1c733f0d2ffe1f5978b42 (patch)
tree070ad947ec5c0f1ee923f85321a0d60a981e6709 /source3
parent2fb944bde1b16179b4d7dd9aafa66d18d742b4e4 (diff)
downloadsamba-13ceeeedbc188f4c68f1c733f0d2ffe1f5978b42.tar.gz
samba-13ceeeedbc188f4c68f1c733f0d2ffe1f5978b42.tar.bz2
samba-13ceeeedbc188f4c68f1c733f0d2ffe1f5978b42.zip
s3:registry: streamline and cleanup regdb_set_secdesc() somewhat.
Michael
Diffstat (limited to 'source3')
-rw-r--r--source3/registry/reg_backend_db.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index ee0e81f680..8d483063c4 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -1551,7 +1551,6 @@ static WERROR regdb_set_secdesc(const char *key,
{
TALLOC_CTX *mem_ctx = talloc_stackframe();
char *tdbkey;
- NTSTATUS status;
WERROR err = WERR_NOMEM;
TDB_DATA tdbdata;
@@ -1568,27 +1567,18 @@ static WERROR regdb_set_secdesc(const char *key,
if (secdesc == NULL) {
/* assuming a delete */
- status = dbwrap_trans_delete_bystring(regdb, tdbkey);
- if (NT_STATUS_IS_OK(status)) {
- err = WERR_OK;
- } else {
- err = ntstatus_to_werror(status);
- }
+ err = ntstatus_to_werror(dbwrap_trans_delete_bystring(regdb,
+ tdbkey));
goto done;
}
err = ntstatus_to_werror(marshall_sec_desc(mem_ctx, secdesc,
&tdbdata.dptr,
&tdbdata.dsize));
- if (!W_ERROR_IS_OK(err)) {
- goto done;
- }
+ W_ERROR_NOT_OK_GOTO_DONE(err);
- status = dbwrap_trans_store_bystring(regdb, tdbkey, tdbdata, 0);
- if (!NT_STATUS_IS_OK(status)) {
- err = ntstatus_to_werror(status);
- goto done;
- }
+ err = ntstatus_to_werror(dbwrap_trans_store_bystring(regdb, tdbkey,
+ tdbdata, 0));
done:
TALLOC_FREE(mem_ctx);