From: Andrew Bartlett Date: Sun, 3 Nov 2019 23:15:26 +0000 (+1300) Subject: pidl: Generate compatability wrappers for ndr_print functions X-Git-Tag: talloc-2.3.1~63 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=78521577eb11d2d601768f3c521549793341a450;p=thirdparty%2Fsamba.git pidl: Generate compatability wrappers for ndr_print functions This creates wrappers that are compatible with the functions called by ndrdump which have an extra "int flags" parameter for NDR_IN and NDR_OUT. This will make ndrdump of public structures work again. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14191 Signed-off-by: Andrew Bartlett Signed-off-by: Douglas Bagnall Pair-progammed-with: Douglas Bagnall --- diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index f73d54973bf..222a8b8c7b4 100644 --- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -2768,7 +2768,7 @@ sub StructEntry($$) $self->pidl("\t\t.struct_size = sizeof($type_decl),"); $self->pidl("\t\t.ndr_push = (ndr_push_flags_fn_t) ndr_push_$d->{NAME},"); $self->pidl("\t\t.ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_$d->{NAME},"); - $self->pidl("\t\t.ndr_print = (ndr_print_function_t) ndr_print_$d->{NAME},"); + $self->pidl("\t\t.ndr_print = (ndr_print_function_t) ndr_print_flags_$d->{NAME},"); $self->pidl("\t},"); return 1; } @@ -3023,6 +3023,18 @@ sub ParseTypePrintFunction($$$) $self->pidl_hdr("void ".TypeFunctionName("ndr_print", $e)."(struct ndr_print *ndr, const char *name, $args);"); + if (has_property($e, "public")) { + $self->pidl("static void ".TypeFunctionName("ndr_print_flags", $e). + "(struct ndr_print *$ndr, const char *name, int unused, $args)" + ); + $self->pidl("{"); + $self->indent; + $self->pidl(TypeFunctionName("ndr_print", $e)."($ndr, name, $varname);"); + $self->deindent; + $self->pidl("}"); + $self->pidl(""); + } + return if (has_property($e, "noprint")); $self->pidl("_PUBLIC_ void ".TypeFunctionName("ndr_print", $e)."(struct ndr_print *$ndr, const char *name, $args)");