summaryrefslogtreecommitdiff
path: root/pidl
Commit message (Collapse)AuthorAgeFilesLines
* pod2man is no longer neededMathieu Parent2019-09-181-1/+0
| | | | | | | | | | Since e24e344d0da58013fd5fa404529fe1d25ef403bf. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14131 Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pidl/ndr/python: avoid memory errors in getsettersDouglas Bagnall2019-08-061-0/+8
| | | | | | | | | | | | | | | | This: $ python3 -c'from samba.dcerpc import lsa; x = lsa.EnumAccounts(); x.in_handle' should not raise a MemoryError, which is very unfriendly given that 'x.in_handle' is just named, not called, as far as the user is concerned. Returning None is the proper thing. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Tue Aug 6 18:17:11 UTC 2019 on sn-devel-184
* pidl: Remove the need to always specify --client with --pythonAndrew Bartlett2019-06-262-2/+9
| | | | | | | | This allows us to avoid generating client code for NDR-only protocols that do not go over DCE/RPC Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* py3: Remove PyStr_FromString() compatability macroAndrew Bartlett2019-06-241-3/+3
| | | | | | | | We no longer need Samba to be py2/py3 compatible so we choose to return to the standard function names. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
* pidl: Allow ndrdump to print public structuresGary Lockyer2019-06-061-1/+40
| | | | | | | | Generate code to allow ndrdump to operate on public structures. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* pidl: Call PY_DISCARD_FUNC_SIG in generated code to avoid ugly warningNoel Power2019-05-161-12/+13
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
* pidl: Call PyLong_FromUnsignedLongLong directly rather than via inline helperAndrew Bartlett2019-05-061-8/+3
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* pidl: Call PyLong_FromLongLong() directly rather than via inline helperAndrew Bartlett2019-05-061-6/+1
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* pidl: Always call PyLong_FromUnsignedLongLong() in ↵Andrew Bartlett2019-05-061-5/+1
| | | | | | | | | ndr_PyLong_FromUnsignedLongLong() The C type is "unsigned long long" so use that always, as the Python type is now always the same. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* pidl: Always call PyLong_FromLongLong() in ndr_PyLong_FromLongLong()Andrew Bartlett2019-05-061-5/+1
| | | | | | | The C type is "long long" so use that always, as the Python type is now always the same. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* pidl: No longer use Python3 compat define: PyInt_FromLong -> PyLong_FromLongAndrew Bartlett2019-05-061-2/+2
| | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* waf: install: Remove installation of PIDL and manpages.Lutz Justen2019-04-232-75/+0
| | | | | | | | | | | | It's not used outside of Samba other than wireshark who have their own vendor fork. Signed-off-by: Lutz Justen <ljusten@google.com> Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Apr 23 02:08:56 UTC 2019 on sn-devel-144
* pidl/s4/python: call export "export" in py exceptionsDouglas Bagnall2019-03-121-1/+1
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pidl/Python: initialise a datablobDouglas Bagnall2019-03-041-1/+1
| | | | | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Mar 4 22:41:01 UTC 2019 on sn-devel-144
* pidl: Use NDR_ZERO_STRUCT(P) macrosAndreas Schneider2019-02-144-8/+8
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13778 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* pidl: Fix Generated ndr python code to DECREF imported modulesNoel Power2019-02-071-7/+11
| | | | | | | | | Generated code calls Py_ImportModule but in all error returns and also successful exit the code fails to decrement reference to loaded modules in MODULE_INIT_FUNC function. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* pidl/Python: use py_dcerpc_ndr_pointer_wrap/deref if multiple pointer levels ↵Stefan Metzmacher2019-01-121-4/+31
| | | | | | | | | | | | are used This will help the raw_protocol test to explore lsa_GetUserName. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: make it possible to specify ncacn_np_secondary_endpointStefan Metzmacher2019-01-121-1/+11
| | | | | | | | | | | Even a connect to \\pipe\lsarpc should return a secondary_address of '\\pipe\\lsass'. But that will be implemented in a following commit. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:rpc_server: only pass context to op_bind() hooksStefan Metzmacher2019-01-121-2/+2
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* pidl: Fix unsigned integer comparison warningAndreas Schneider2018-12-131-1/+1
| | | | | | | | | | | | | | bin/default/librpc/gen_ndr/py_wkssvc.c:27344:33: warning: comparison of integer expressions of different signedness: ‘long int’ and ‘long long unsigned int’ [-Wsign-compare] <--[gcc] if (test_var < 0 || test_var > uint_max) { ^ Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Dec 13 05:00:20 CET 2018 on sn-devel-144
* pidl: Fix function for py_<name>_ndr_print_(in|out)Andreas Schneider2018-12-131-2/+2
| | | | | | | | | | | | | The function takes two PyObject arguments, See: https://docs.python.org/3/c-api/structures.html#c.PyCFunction and https://docs.python.org/2/c-api/structures.html#c.PyCFunction Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pidl: Use C99 initializers for last element in ndr_interface_call(_pipes)Andreas Schneider2018-12-131-2/+2
| | | | | | | | | | | librpc/gen_ndr/ndr_witness.c:1421:2: warning: missing initializer for field ‘in_pipes’ of ‘const struct ndr_interface_call’ [-Wmissing-field-initializers] <--[gcc] { NULL, 0, NULL, NULL, NULL } ^ Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* PY3: fix string.rsplit usage (doens't exist in PY3)Noel Power2018-09-161-1/+1
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* PY3: fix iteritems usage, not supported in python3Noel Power2018-09-161-3/+4
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pidl/wscript: update to handle waf 2.0.4Alexander Bokovoy2018-09-051-2/+3
| | | | | Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* build:wafsamba: Build on waf 1.9Thomas Nagy2018-09-051-1/+1
| | | | | | Signed-off-by: Thomas Nagy <tnagy@waf.io> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pidl/tests: fix ndr_push_init_ctx() usageAlexander Bokovoy2018-08-304-27/+27
| | | | | | | | | | | | | | The code in libndr got rid of the second argument quite some time ago (2010): f9ca9e46ad24036bf00cb361a6cef4b2e7e98d7d However, pidl tests did include a code that passed two arguments. Recently GCC started to fail to compile such code. Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Aug 30 04:48:00 CEST 2018 on sn-devel-144
* Fix pidl manpage sectionsMathieu Parent2018-05-121-2/+3
| | | | | | | | .TH header should match file name (i.e 3pm and not 3 for Parse::Pidl::NDR). Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s4: COM: Remove talloc_autofree_context() from (unused) COM code.Jeremy Allison2017-07-261-3/+3
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12932 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libndr/compression: pass down compressed length in ndr_pull_compression_startGünther Deschner2017-07-191-1/+2
| | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* pidl:NDR/Parser: add missing {start,end}_flags() to ParseElementPrint()Stefan Metzmacher2017-06-271-0/+4
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12782 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* pidl:NDR/Parser: initialize [skip] values in ndr_pull_*Stefan Metzmacher2017-06-261-0/+3
| | | | | | | | It's too dangerous to leave values uninitialzed! [skip_noinit] can be used if required. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* pidl:NDR/Parser: add "skip_noinit" elementStefan Metzmacher2017-06-262-6/+7
| | | | | | | | In future "skip" will be changed to initialize the element with ZERO_STRUCT() on ndr_pull_*. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* pidl:NDR/Parser: fix "skip" for pointersStefan Metzmacher2017-06-261-10/+30
| | | | | | | | We should handle the "skip" at the element level before we traverse trough the element levels. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* pidl: Fix array range checks in python outputVolker Lendecke2017-06-201-3/+6
| | | | | | | | | | | | | | | | | | Without this, we generated code like if (ndr_table_dnsserver.num_calls < 0) { PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_DnssrvOperation_ndr_pack"); return NULL; } call = &ndr_table_dnsserver.calls[0]; This does not really make sense, and Coverity found comparing the unsigned num_calls against <0 a bit pointless. Should fix 138 Coverity findings and make the code a bit more correct. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* python3: Use "y#" instead of "s#" for binary data in PyArg_ParseTuplePetr Viktorin2017-05-191-3/+3
| | | | | | | | | | | | | | | | | The "s#" format code for PyArg_ParseTupleAndKeywords and Py_BuildValue converts a char* and size to/from Python str (with utf-8 encoding under Python 3). In some cases, we want bytes (str on Python 2, bytes on 3) instead. The code for this is "y#" in Python 3, but that is not available in 2. Introduce a PYARG_BYTES_LEN macro that expands to "s#" or "y#", and use that in: - credentials.get_ntlm_response (for input and output) - ndr_unpack argument in PIDL generated code Signed-off-by: Petr Viktorin <pviktori@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pidl: Fix Coverity warnings from duplicate NULL checks.Jeremy Allison2017-05-061-25/+38
| | | | | | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat May 6 16:03:17 CEST 2017 on sn-devel-144
* lib: modules: Change XXX_init interface from XXX_init(void) to ↵Jeremy Allison2017-04-221-2/+2
| | | | | | | | | | | | | | | | | | | | XXX_init(TALLOC_CTX *) Not currently used - no logic changes inside. This will make it possible to pass down a long-lived talloc context from the loading function for modules to use instead of having them internally all use talloc_autofree_context() which is a hidden global. Updated all known module interface numbers, and added a WHATSNEW. Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Apr 22 01:17:00 CEST 2017 on sn-devel-144
* python: pidl: Port Python interface generatorLumir Balhar2017-03-101-23/+34
| | | | | | | | | | | | Port PIDL generator of Python interfaces to generate interfaces in Python 3 compatible form. Python 2.7 is now required, so we can use PyCapsule in both versions. Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Pair-programmed-by: Andrew Bartlett <abartlet@samba.org>
* pidl:Python: use of pytalloc_GenericObject_reference*() for ↵Stefan Metzmacher2017-02-251-78/+7
| | | | | | | | | | | | pyrpc_{ex,im}port_union() wrapping BUG: https://bugzilla.samba.org/show_bug.cgi?id=12601 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Feb 25 06:33:33 CET 2017 on sn-devel-144
* pidl:Python: replace pytalloc_CObject_FromTallocPtr() with ↵Stefan Metzmacher2017-02-251-9/+11
| | | | | | | | | pytalloc_GenericObject_reference_ex() BUG: https://bugzilla.samba.org/show_bug.cgi?id=12601 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pidl:Python: make sure print HASH references for STRUCT typesStefan Metzmacher2017-02-251-1/+7
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12601 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pidl: use ndr_push_charset_to_null() when [to_null] keyword is used in IDLGünther Deschner2017-01-241-1/+5
| | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4-rpc_server: Allow each interface to declare if it uses handlesAndrew Bartlett2016-12-201-8/+13
| | | | | | | | This will allow the NETLOGON server in the AD DC to declare that it does not use handles, and so allow some more flexibility with association groups Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4-rpc_server: Add back support for lsa over \\pipe\\netlogon optionallyAndrew Bartlett2016-12-151-1/+4
| | | | | | | | | | The idea here is that perhaps some real client relies on this (and not just Samba torture commands), so we need a way to support it for the 4.6 release. If no such client emerges, it can be deprecated and removed in the normal way. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* pidl: Make dcesrv\_$name\_interface "static const"Andrew Bartlett2016-12-081-1/+1
| | | | | | | | | | This moves it out of the global namespace Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Dec 8 13:25:57 CET 2016 on sn-devel-144
* pidl: Make static struct api_struct also constAndrew Bartlett2016-12-011-1/+1
| | | | | | | | This moves the table to read-only memory Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* pidl: Change *_get_pipe_fns() to return const struct api_struct *Andrew Bartlett2016-12-011-3/+3
| | | | | | | | This will allow the table to be made static const in the next commit Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* pidl: Use a static const initialised struct in dcerpc_server_$name_init(void)Andrew Bartlett2016-12-011-9/+8
| | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* Fix typoAlexis La Goutte2016-12-011-1/+1
| | | | | | | | Fix (minor) typo found in wireshark with lintian tools https://code.wireshark.org/review/#/c/18485/ Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>