librpc/rpc: let dcesrv_mgmt_inq_if_ids() filter out the mgmt syntax_id
authorStefan Metzmacher <metze@samba.org>
Wed, 9 Aug 2023 15:05:56 +0000 (17:05 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 17 Oct 2023 19:20:38 +0000 (19:20 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
librpc/rpc/dcesrv_mgmt.c

index 5e52a4a1217b3b6e8ec06c680e7643160b9bf61c..ceb55e1507d5faae88287199f2b46a6e650f7c51 100644 (file)
@@ -61,6 +61,16 @@ static WERROR dcesrv_mgmt_inq_if_ids(struct dcesrv_call_state *dce_call, TALLOC_
        vector->if_id = NULL;
 
        for (l = ep->interface_list; l; l = l->next) {
+               bool filter;
+
+               filter = ndr_syntax_id_equal(&l->iface->syntax_id, &ndr_table_mgmt.syntax_id);
+               if (filter) {
+                       /*
+                        * We should not return the mgmt syntax itself here
+                        */
+                       continue;
+               }
+
                vector->count++;
                vector->if_id = talloc_realloc(vector, vector->if_id, struct ndr_syntax_id_p, vector->count);
                if (vector->if_id == NULL) {