1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
samba-mirror/pidl/lib/Parse/Pidl
Douglas Bagnall eb480df1ba pidl:Typelist: resolveType(): don't mistake a reference for a name
This function is only used by Python.pm, and was assuming any argument
unrecognised by hasType is a name. It sometimes isn't, resulting in
structures like this:

	{
	  'DATA' => {
		      'TYPE' => 'STRUCT'
		    },
	  'NAME' => {
		      'TYPE' => 'STRUCT',
		      'ALIGN' => undef,
		      'SURROUNDING_ELEMENT' => undef,
		      'ORIGINAL' => {
				      'TYPE' => 'STRUCT',
				      'FILE' => 'source3/librpc/idl/smbXsrv.idl',
				      'LINE' => 101,
				      'NAME' => 'tevent_context'
				    },
		      'ELEMENTS' => undef,
		      'NAME' => 'tevent_context',
		      'PROPERTIES' => undef
		    },
	  'TYPE' => 'TYPEDEF'
      };

The problem with that is we end up with the HASH reference as a name
in Python bindings, like this

      PyErr_SetString(PyExc_TypeError, "Can not convert C Type struct HASH(0x5e2dfe5ee278) from Python");

which makes the build nondeterministic (as well as making the message
a little mysterious).

I think all the structures for which this happens are marked
'[ignore]' in IDL, meaning they are not transmitted on the wire. They
should perhaps also not have useless Python getsetters, but let's call
that a different problem.

Thanks to Freexian and the Debian LTS project for sponsoring this work.

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit f3433f60b8)
2024-06-10 13:24:16 +00:00
..
Samba3 pidl: include scompat headers and servers in s3 server template 2023-11-17 00:39:18 +00:00
Samba4 pidl: calculate subcontext_size only once per pull 2024-02-12 10:53:13 +00:00
Wireshark pidl: Use non-existent function dissect_ndr_int64() 2023-08-21 23:37:29 +00:00
Base.pm pidl: optionally annotate output for debug purposes 2019-12-04 05:10:31 +00:00
Compat.pm pidl: use perl warnings 2019-12-10 02:53:34 +00:00
CUtil.pm pidl: use perl warnings 2019-12-10 02:53:34 +00:00
Dump.pm pidl: use perl warnings 2019-12-10 02:53:34 +00:00
Expr.pm pidl: use perl warnings 2019-12-10 02:53:34 +00:00
IDL.pm pidl: use perl warnings 2019-12-10 02:53:34 +00:00
NDR.pm pidl: Add new ‘u16string’ type 2023-11-20 21:50:32 +00:00
ODL.pm pidl: Fix code spelling 2023-06-23 13:44:31 +00:00
Samba4.pm pidl: use perl warnings 2019-12-10 02:53:34 +00:00
Typelist.pm pidl:Typelist: resolveType(): don't mistake a reference for a name 2024-06-10 13:24:16 +00:00
Util.pm pidl s4::NDR::Parser: read hex numbers as numbers for ranges 2019-12-10 02:53:35 +00:00