diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-11-21 19:25:42 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-11-21 19:53:37 +0100 |
commit | 7d5367fc99a559b19efed11c9c7a0f24c593606d (patch) | |
tree | d162df97ce2250c6cfebfa40a9d0e7b3527e587a /source4/rpc_server | |
parent | e8e76eb83acaf3095d6acb9c930fc2d10396efd4 (diff) | |
download | samba-7d5367fc99a559b19efed11c9c7a0f24c593606d.tar.gz samba-7d5367fc99a559b19efed11c9c7a0f24c593606d.tar.bz2 samba-7d5367fc99a559b19efed11c9c7a0f24c593606d.zip |
s4:samr RPC - Use more LDB constants
Diffstat (limited to 'source4/rpc_server')
-rw-r--r-- | source4/rpc_server/samr/dcesrv_samr.c | 6 | ||||
-rw-r--r-- | source4/rpc_server/samr/samr_password.c | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c index 0b102b5e79..725ecba21f 100644 --- a/source4/rpc_server/samr/dcesrv_samr.c +++ b/source4/rpc_server/samr/dcesrv_samr.c @@ -2679,7 +2679,7 @@ static NTSTATUS dcesrv_samr_DeleteDomAlias(struct dcesrv_call_state *dce_call, T a_state = h->data; ret = ldb_delete(a_state->sam_ctx, a_state->account_dn); - if (ret != 0) { + if (ret != LDB_SUCCESS) { return NT_STATUS_UNSUCCESSFUL; } @@ -4048,10 +4048,10 @@ static NTSTATUS dcesrv_samr_RemoveMemberFromForeignDomain(struct dcesrv_call_sta } if (samdb_msg_add_delval(d_state->sam_ctx, mem_ctx, mod, - "member", memberdn) != 0) + "member", memberdn) != LDB_SUCCESS) return NT_STATUS_NO_MEMORY; - if (ldb_modify(d_state->sam_ctx, mod) != 0) + if (ldb_modify(d_state->sam_ctx, mod) != LDB_SUCCESS) return NT_STATUS_UNSUCCESSFUL; talloc_free(mod); diff --git a/source4/rpc_server/samr/samr_password.c b/source4/rpc_server/samr/samr_password.c index faf95b1190..1ed1dd1b69 100644 --- a/source4/rpc_server/samr/samr_password.c +++ b/source4/rpc_server/samr/samr_password.c @@ -67,7 +67,7 @@ NTSTATUS dcesrv_samr_ChangePasswordUser(struct dcesrv_call_state *dce_call, } ret = ldb_transaction_start(sam_ctx); - if (ret) { + if (ret != LDB_SUCCESS) { DEBUG(1, ("Failed to start transaction: %s\n", ldb_errstring(sam_ctx))); return NT_STATUS_TRANSACTION_ABORTED; } @@ -154,7 +154,7 @@ NTSTATUS dcesrv_samr_ChangePasswordUser(struct dcesrv_call_state *dce_call, /* The above call only setup the modifications, this actually * makes the write to the database. */ ret = samdb_replace(sam_ctx, mem_ctx, msg); - if (ret != 0) { + if (ret != LDB_SUCCESS) { DEBUG(2,("Failed to modify record to change password on %s: %s\n", ldb_dn_get_linearized(a_state->account_dn), ldb_errstring(sam_ctx))); @@ -164,7 +164,7 @@ NTSTATUS dcesrv_samr_ChangePasswordUser(struct dcesrv_call_state *dce_call, /* And this confirms it in a transaction commit */ ret = ldb_transaction_commit(sam_ctx); - if (ret != 0) { + if (ret != LDB_SUCCESS) { DEBUG(1,("Failed to commit transaction to change password on %s: %s\n", ldb_dn_get_linearized(a_state->account_dn), ldb_errstring(sam_ctx))); @@ -216,7 +216,7 @@ NTSTATUS dcesrv_samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call, } ret = ldb_transaction_start(sam_ctx); - if (ret) { + if (ret != LDB_SUCCESS) { DEBUG(1, ("Failed to start transaction: %s\n", ldb_errstring(sam_ctx))); return NT_STATUS_TRANSACTION_ABORTED; } @@ -311,7 +311,7 @@ NTSTATUS dcesrv_samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call, /* The above call only setup the modifications, this actually * makes the write to the database. */ ret = samdb_replace(sam_ctx, mem_ctx, mod); - if (ret != 0) { + if (ret != LDB_SUCCESS) { DEBUG(2,("Failed to modify record to change password on %s: %s\n", ldb_dn_get_linearized(user_dn), ldb_errstring(sam_ctx))); @@ -321,7 +321,7 @@ NTSTATUS dcesrv_samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call, /* And this confirms it in a transaction commit */ ret = ldb_transaction_commit(sam_ctx); - if (ret != 0) { + if (ret != LDB_SUCCESS) { DEBUG(1,("Failed to commit transaction to change password on %s: %s\n", ldb_dn_get_linearized(user_dn), ldb_errstring(sam_ctx))); @@ -369,7 +369,7 @@ NTSTATUS dcesrv_samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call, } ret = ldb_transaction_start(sam_ctx); - if (ret) { + if (ret != LDB_SUCCESS) { talloc_free(sam_ctx); DEBUG(1, ("Failed to start transaction: %s\n", ldb_errstring(sam_ctx))); return NT_STATUS_TRANSACTION_ABORTED; @@ -474,7 +474,7 @@ NTSTATUS dcesrv_samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call, /* The above call only setup the modifications, this actually * makes the write to the database. */ ret = samdb_replace(sam_ctx, mem_ctx, mod); - if (ret != 0) { + if (ret != LDB_SUCCESS) { DEBUG(2,("samdb_replace failed to change password for %s: %s\n", ldb_dn_get_linearized(user_dn), ldb_errstring(sam_ctx))); @@ -484,7 +484,7 @@ NTSTATUS dcesrv_samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call, /* And this confirms it in a transaction commit */ ret = ldb_transaction_commit(sam_ctx); - if (ret != 0) { + if (ret != LDB_SUCCESS) { DEBUG(1,("Failed to commit transaction to change password on %s: %s\n", ldb_dn_get_linearized(user_dn), ldb_errstring(sam_ctx))); |