s4:dsdb/extended_dn_out: use dsdb_dn_val_rmd_flags() instead of dsdb_dn_is_deleted_val()
authorStefan Metzmacher <metze@samba.org>
Thu, 9 Feb 2023 14:04:26 +0000 (15:04 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 23 Mar 2023 07:16:34 +0000 (07:16 +0000)
We now check for DSDB_RMD_FLAG_DELETED, as we'll check for
DSDB_RMD_FLAG_HIDDEN_BL in the next step and it's better to
call dsdb_dn_val_rmd_flags() just once.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12967

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/extended_dn_out.c

index 1664b4466b5aa127027969d5889c061cc20a83c1..300c926992bd36f70345be17e31c39abbd8ac0c8 100644 (file)
@@ -344,11 +344,13 @@ static int extended_callback(struct ldb_request *req, struct ldb_reply *ares)
                        struct dsdb_dn *dsdb_dn = NULL;
                        struct ldb_val *plain_dn = &msg->elements[i].values[j];
                        bool is_deleted_objects = false;
+                       uint32_t rmd_flags;
 
                        /* this is a fast method for detecting deleted
                           linked attributes, working on the unparsed
                           ldb_val */
-                       if (dsdb_dn_is_deleted_val(plain_dn) && !have_reveal_control) {
+                       rmd_flags = dsdb_dn_val_rmd_flags(plain_dn);
+                       if (rmd_flags & DSDB_RMD_FLAG_DELETED && !have_reveal_control) {
                                /* it's a deleted linked attribute,
                                  and we don't have the reveal control */
                                /* we won't keep this one, so not incrementing k */