SQ ... Reviewed-by: Stefan Metzmacher <metze@samba.org>
authorStefan Metzmacher <metze@samba.org>
Tue, 26 Aug 2014 07:24:19 +0000 (09:24 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 26 Aug 2014 16:18:52 +0000 (18:18 +0200)
source4/auth/sam.c

index 063c47b6539bedd5e09976ce39189868e19478b1..6e9e63b4d461a92081b198187e0cc7a5e4c99946 100644 (file)
@@ -619,14 +619,14 @@ NTSTATUS sam_get_results_trust(struct ldb_context *sam_ctx,
                           LDB_SCOPE_ONELEVEL, attrs,
                           DSDB_SEARCH_NO_GLOBAL_CATALOG|DSDB_SEARCH_ONE_ONLY,
                           "%s", filter);
-       if (lret != LDB_SUCCESS && lret != LDB_ERR_NO_SUCH_OBJECT) {
-               DEBUG(3, ("Failed to search for %s: %s\n", filter, ldb_errstring(sam_ctx)));
-               TALLOC_FREE(frame);
-               return NT_STATUS_INTERNAL_DB_CORRUPTION;
-       } else if (lret == LDB_ERR_NO_SUCH_OBJECT) {
+       if (lret == LDB_ERR_NO_SUCH_OBJECT) {
                DEBUG(3, ("Failed to find result for %s: %s\n", filter, ldb_errstring(sam_ctx)));
                TALLOC_FREE(frame);
                return NT_STATUS_NOT_FOUND;
+       } else if (lret != LDB_SUCCESS) {
+               DEBUG(3, ("Failed to search for %s: %s\n", filter, ldb_errstring(sam_ctx)));
+               TALLOC_FREE(frame);
+               return NT_STATUS_INTERNAL_DB_CORRUPTION;
        }
        talloc_steal(mem_ctx, res->msgs);
        *msg = res->msgs[0];