s4:samr RPC - Use more LDB constants
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Sat, 21 Nov 2009 18:25:42 +0000 (19:25 +0100)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Sat, 21 Nov 2009 18:53:37 +0000 (19:53 +0100)
source4/rpc_server/samr/dcesrv_samr.c
source4/rpc_server/samr/samr_password.c

index 0b102b5..725ecba 100644 (file)
@@ -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);
index faf95b1..1ed1dd1 100644 (file)
@@ -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)));