]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dbwrap_ctdb: Fix ENOENT->NT_STATUS_NOT_FOUND
authorVolker Lendecke <vl@samba.org>
Wed, 20 Apr 2016 11:27:07 +0000 (13:27 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 26 Apr 2016 12:34:14 +0000 (14:34 +0200)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11844
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Apr 26 14:34:14 CEST 2016 on sn-devel-144

source3/lib/dbwrap/dbwrap_ctdb.c

index 1e4df09a21967e7a1fa58fe3bd19e5d2cd3f7d9d..532240d156581f3aea3257c8d8c6d1c6405dd8a7 100644 (file)
@@ -1298,6 +1298,16 @@ static NTSTATUS db_ctdb_parse_record(struct db_context *db, TDB_DATA key,
        ret = ctdbd_parse(messaging_ctdbd_connection(), ctx->db_id, key,
                          state.ask_for_readonly_copy, parser, private_data);
        if (ret != 0) {
+               if (ret == ENOENT) {
+                       /*
+                        * This maps to
+                        * NT_STATUS_OBJECT_NAME_NOT_FOUND. Our upper
+                        * layers expect NT_STATUS_NOT_FOUND for "no
+                        * record around". We need to convert dbwrap
+                        * to 0/errno away from NTSTATUS ... :-)
+                        */
+                       return NT_STATUS_NOT_FOUND;
+               }
                return map_nt_error_from_unix(ret);
        }
        return NT_STATUS_OK;