[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Thu May 16 19:09:05 UTC 2019


The branch, master has been updated
       via  749f1290ce6 lib:util: Fix tfork return value if sigprocmask fails
       via  0fa490e8476 s3:loadparm: Ensure to truncate FS Volume Label at multibyte boundary
       via  16cf1d1a531 lib/crypto: squash 'cast between incompatible function types' warning
       via  70a140646e8 lib/ldb-samba: squash 'cast between incompatible function types' warning
       via  27d99eefe76 lib/ldb: Fix incorrect return type for (setter) func type
       via  51f146de5ad lib/ldb: squash 'cast between incompatible function types' warning
       via  995e23f1178 lib/talloc: squash 'cast between incompatible function types' warning
       via  d93ec5445b5 lib/tevent: squash 'cast between incompatible function types' warning
       via  5720f20a195 lib/tdb: squash 'cast between incompatible function types' warning
       via  cbdd3d0c26c squash 'cast between incompatible function types' warning
       via  a7d75a1c57b s4: squash 'cast between incompatible function types' warning
       via  cea41645fb4 s3: squash 'cast between incompatible function types' warning
       via  cc608669902 s4/librpc: squash 'cast between incompatible function types' warning
       via  0830485d1cd s3/ntvfs: squash 'cast between incompatible function types' warning
       via  8c8fe323624 s3/smbd: squash 'cast between incompatible function types' warning
       via  3326bba4190 pidl: Call PY_DISCARD_FUNC_SIG in generated code to avoid ugly warning
       via  d6b1c33dd6b python: Create macro to hide ugly function signature cast
      from  82a40271719 smbd: Slightly simplify delay_for_oplock()

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 749f1290ce654d2d47e84ff455212b008de6b54c
Author: Rikard Falkeborn <rikard.falkeborn at gmail.com>
Date:   Thu May 9 21:17:24 2019 +0200

    lib:util: Fix tfork return value if sigprocmask fails
    
    Returning a non-zero value from a function with bool as return value is
    the same as returning true. Change the return value to false if
    sigprocmask or pthread_sigmask fails to indicate failure.
    
    Detected with the help of cppcheck.
    
    Signed-off-by: Rikard Falkeborn <rikard.falkeborn at gmail.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Thu May 16 19:08:29 UTC 2019 on sn-devel-184

commit 0fa490e8476a2a5020ff2c253167b8a9454e8b97
Author: Shyamsunder Rathi <shyam.rathi at nutanix.com>
Date:   Sun May 12 23:06:17 2019 -0700

    s3:loadparm: Ensure to truncate FS Volume Label at multibyte boundary
    
    For FS_VOLUME_INFO/FS_INFO operation, a maximum of 32 characters are
    sent back. However, since Samba chops off any share name with >32
    bytes at 32, it is possible that a multi-byte share name can get chopped
    off between a full character. This causes the string decoding for unicode
    failure which sends back NT_STATUS_ILLEGAL_CHARACTER (EILSEQ) to the client
    applications.
    
    On Windows, Notepad doesn't like it, and refuses to open a file in this
    case and fails with the following error:
    
      Invalid character. For multibyte character sets, only the leading byte is
      included without the trailing byte. For Unicode character sets, include
      the characters 0xFFFF and 0xFFFE.
    
    Proposed fix:
    - Find the last starting point of a multibyte codepoint if the character
      at 32nd byte is a subsequent byte of a MB codepoint.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13947
    
    Signed-off-by: Shyamsunder Rathi <shyam.rathi at nutanix.com>
    Reviewed-by: Hemanth Thummala <hemanth.thummala at nutanix.com>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 16cf1d1a531896c7cd2fb96a72d1e630b13e012f
Author: Noel Power <noel.power at suse.com>
Date:   Thu May 2 19:51:56 2019 +0100

    lib/crypto: squash 'cast between incompatible function types' warning
    
    To avoid warning above produced by using
    -Wcast-function-type we;
    
          + ensure PyCFunctions of type METH_VARARGS do not declare
            unused and problematic kargs param.
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 70a140646e8f98662721f9e4466a6642b6180a93
Author: Noel Power <noel.power at suse.com>
Date:   Thu May 2 19:51:34 2019 +0100

    lib/ldb-samba: squash 'cast between incompatible function types' warning
    
    To avoid warning above produced by using
    -Wcast-function-type we;
    
      + ensure PyCFunctions of type METH_NOARGS defined dummy arg
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 27d99eefe7676669343b9040f550480df6554a6e
Author: Noel Power <noel.power at suse.com>
Date:   Wed May 15 10:30:29 2019 +0100

    lib/ldb: Fix incorrect return type for (setter) func type
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13948
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 51f146de5adbb5a58a528e168e7fe9faa4477880
Author: Noel Power <noel.power at suse.com>
Date:   Thu May 2 19:51:05 2019 +0100

    lib/ldb: squash 'cast between incompatible function types' warning
    
    To avoid warning above produced by using
    -Wcast-function-type we;
    
      + ensure PyCFunctions of type METH_NOARGS defined dummy arg
      + ensure PyCFunctions of type METH_KEYWORDS use PY_DISCARD_FUNC_SIG
        macro
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 995e23f1178d4207b9e13341577f26cd509d0892
Author: Noel Power <noel.power at suse.com>
Date:   Thu May 2 19:49:27 2019 +0100

    lib/talloc: squash 'cast between incompatible function types' warning
    
    To avoid warning above produced by using
    -Wcast-function-type we;
    
      + ensure PyCFunctions of type METH_NOARGS defined dummy arg
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit d93ec5445b58fdc921fe37c722af0966c7efc0de
Author: Noel Power <noel.power at suse.com>
Date:   Thu May 2 19:49:09 2019 +0100

    lib/tevent: squash 'cast between incompatible function types' warning
    
    squash 'cast between incompatible function types' warning
    
    To avoid warning above produced by using
    -Wcast-function-type we;
    
      + ensure PyCFunctions of type METH_NOARGS defined dummy arg
      + ensure PyCFunctions of type METH_KEYWORDS use PY_DISCARD_FUNC_SIG
        macro
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 5720f20a195a5c40288d0ea1e2bf7f8373d8ccb3
Author: Noel Power <noel.power at suse.com>
Date:   Thu May 2 19:48:43 2019 +0100

    lib/tdb: squash 'cast between incompatible function types' warning
    
    squash 'cast between incompatible function types' warning
    
    To avoid warning above produced by using
    -Wcast-function-type we;
    
      + ensure PyCFunctions of type METH_NOARGS defined dummy arg
      + ensure PyCFunctions of type METH_KEYWORDS use PY_DISCARD_FUNC_SIG
        macro
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit cbdd3d0c26c9cefd968a2adaf9892c5c858bf597
Author: Noel Power <noel.power at suse.com>
Date:   Thu May 2 19:47:29 2019 +0100

    squash 'cast between incompatible function types' warning
    
    To avoid warning above produced by using
    -Wcast-function-type we;
    
      + ensure PyCFunctions of type METH_NOARGS defined dummy arg
      + ensure PyCFunctions of type METH_KEYWORDS use PY_DISCARD_FUNC_SIG
        macro
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit a7d75a1c57befee4a178b7061ea218e353a72195
Author: Noel Power <noel.power at suse.com>
Date:   Thu May 2 19:45:14 2019 +0100

    s4: squash 'cast between incompatible function types' warning
    
    To avoid warning above produced by using
     -Wcast-function-type we;
    
      + ensure PyCFunctions of type METH_NOARGS defined dummy arg
      + ensure PyCFunctions of type METH_KEYWORDS use PY_DISCARD_FUNC_SIG
        macro
      + ensure PyCFunctions of type METH_KEYWORDS really actually use the
        problematic kargs param, if not remove it
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit cea41645fb463b026bb7161b524ba732ba0d14e3
Author: Noel Power <noel.power at suse.com>
Date:   Thu May 2 19:40:23 2019 +0100

    s3: squash 'cast between incompatible function types' warning
    
    Some functions (e.g. py_smb_savefile) have an extra unecessary
    *kwargs param in their signatures, these definitions are
    causing 'cast between incompatible function types' warnings when
    compiled with -Wcast-function-type. Some other functions have
    the *kwargs which causes "cast between incompatible function types'
    warnings which need to be squashed with use of the
    PY_DISCARD_FUNC_SIG macro.
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit cc60866990212236c4184dc1dc8ce3194a7e1869
Author: Noel Power <noel.power at suse.com>
Date:   Thu May 2 19:35:56 2019 +0100

    s4/librpc: squash 'cast between incompatible function types' warning
    
    Where possible make PyCFunction definition signature match. Sometimes
    this is not possible (e.g. when the c-function is associated with a
    python method definition with 'METH_VARARGS|METH_KEYWORDS' in this
    case we use the PY_DISCARD_FUNC_SIG macro.
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 0830485d1cddd8567e420e80b60edcf80d26ab24
Author: Noel Power <noel.power at suse.com>
Date:   Thu May 2 19:34:06 2019 +0100

    s3/ntvfs: squash 'cast between incompatible function types' warning
    
    Fix various PyCFunction definitions to avoid
    'cast between incompatible function types' warnings when compiled
    with -Wcast-function-type
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 8c8fe323624946a1fb43e7e569be14c9d6af08c2
Author: Noel Power <noel.power at suse.com>
Date:   Thu May 2 19:31:18 2019 +0100

    s3/smbd: squash 'cast between incompatible function types' warning
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 3326bba4190a5b7b4aa0393cec84d6e9341fa60f
Author: Noel Power <noel.power at suse.com>
Date:   Thu May 2 12:32:56 2019 +0100

    pidl: Call PY_DISCARD_FUNC_SIG in generated code to avoid ugly warning
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit d6b1c33dd6bc15307b0ba5089fc8d99834061004
Author: Noel Power <noel.power at suse.com>
Date:   Thu May 2 12:32:36 2019 +0100

    python: Create macro to hide ugly function signature cast
    
    -Wcast-function-type triggers various warnings related to bad api
    decisions in python source. To avoid these warnings we hide them
    by casting to void first. Macro here is to hide the uglyness and
    provide an easy place to either/or
      + fix better in a single place in the future
      + identify the places involved should python api change in a way
        this can be handled better
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 auth/credentials/pycredentials.c            |   4 +-
 lib/crypto/py_crypto.c                      |   2 +-
 lib/ldb-samba/pyldb.c                       |   6 +-
 lib/ldb/pyldb.c                             | 141 +++++++++++++++++++---------
 lib/talloc/pytalloc.c                       |   3 +-
 lib/talloc/test_pytalloc.c                  |  14 ++-
 lib/tdb/pytdb.c                             |  60 ++++++++----
 lib/tevent/pytevent.c                       |  73 +++++++++-----
 lib/util/tests/tfork.c                      |   2 +-
 libcli/nbt/pynbt.c                          |  16 +++-
 libcli/security/pysecurity.c                |   5 +-
 libgpo/pygpo.c                              |  13 ++-
 pidl/lib/Parse/Pidl/Samba4/Python.pm        |  25 ++---
 python/modules.h                            |   3 +-
 python/pyglue.c                             |  12 ++-
 source3/libsmb/pylibsmb.c                   |  25 +++--
 source3/param/loadparm.c                    |  38 +++++++-
 source3/param/pyparam.c                     |   2 +-
 source3/smbd/pysmbd.c                       |  31 ++++--
 source4/auth/gensec/pygensec.c              |  18 +++-
 source4/auth/pyauth.c                       |   8 +-
 source4/dns_server/pydns.c                  |   3 +-
 source4/lib/messaging/pymessaging.c         |  23 +++--
 source4/lib/registry/pyregistry.c           |  13 ++-
 source4/libnet/py_net.c                     |  82 +++++++++++++---
 source4/libnet/py_net_dckeytab.c            |   5 +-
 source4/librpc/ndr/py_security.c            |  15 ++-
 source4/librpc/rpc/pyrpc.c                  |   6 +-
 source4/librpc/rpc/pyrpc_util.c             |   4 +-
 source4/ntvfs/posix/python/pyposix_eadb.c   |   3 +-
 source4/ntvfs/posix/python/pyxattr_native.c |   3 +-
 source4/ntvfs/posix/python/pyxattr_tdb.c    |   3 +-
 source4/param/pyparam.c                     |  12 +--
 33 files changed, 474 insertions(+), 199 deletions(-)


Changeset truncated at 500 lines:

diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c
index 1b86e001557..966c625a10e 100644
--- a/auth/credentials/pycredentials.c
+++ b/auth/credentials/pycredentials.c
@@ -19,6 +19,7 @@
 #include <Python.h>
 #include "python/py3compat.h"
 #include "includes.h"
+#include "python/modules.h"
 #include "pycredentials.h"
 #include "param/param.h"
 #include "lib/cmdline/credentials.h"
@@ -760,7 +761,8 @@ static PyMethodDef py_creds_methods[] = {
 	},
 	{
 		.ml_name  = "get_ntlm_response",
-		.ml_meth  = (PyCFunction)py_creds_get_ntlm_response,
+		.ml_meth  = PY_DISCARD_FUNC_SIG(PyCFunction,
+						py_creds_get_ntlm_response),
 		.ml_flags = METH_VARARGS | METH_KEYWORDS,
 		.ml_doc   = "S.get_ntlm_response"
 		            "(flags, challenge[, target_info]) -> "
diff --git a/lib/crypto/py_crypto.c b/lib/crypto/py_crypto.c
index bf7f9f4481c..13e2569945d 100644
--- a/lib/crypto/py_crypto.c
+++ b/lib/crypto/py_crypto.c
@@ -23,7 +23,7 @@
 #include "python/py3compat.h"
 #include "lib/crypto/arcfour.h"
 
-static PyObject *py_crypto_arcfour_crypt_blob(PyObject *module, PyObject *args, PyObject *kwargs)
+static PyObject *py_crypto_arcfour_crypt_blob(PyObject *module, PyObject *args)
 {
 	DATA_BLOB data, key;
 	PyObject *py_data, *py_key, *result;
diff --git a/lib/ldb-samba/pyldb.c b/lib/ldb-samba/pyldb.c
index 397e11062b6..b4839785c05 100644
--- a/lib/ldb-samba/pyldb.c
+++ b/lib/ldb-samba/pyldb.c
@@ -156,7 +156,8 @@ static PyObject *py_ldb_set_opaque_integer(PyObject *self, PyObject *args)
 	Py_RETURN_NONE;
 }
 
-static PyObject *py_ldb_set_utf8_casefold(PyObject *self)
+static PyObject *py_ldb_set_utf8_casefold(PyObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_context *ldb;
 
@@ -226,7 +227,8 @@ static PyObject *py_ldb_samba_schema_attribute_add(PyLdbObject *self,
 	Py_RETURN_NONE;
 }
 
-static PyObject *py_ldb_register_samba_handlers(PyObject *self)
+static PyObject *py_ldb_register_samba_handlers(PyObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_context *ldb;
 	int ret;
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index 319840c2ea6..cf7779128d4 100644
--- a/lib/ldb/pyldb.c
+++ b/lib/ldb/pyldb.c
@@ -34,6 +34,9 @@
 #include "pyldb.h"
 #include "dlinklist.h"
 
+/* discard signature of 'func' in favour of 'target_sig' */
+#define PY_DISCARD_FUNC_SIG(target_sig, func) (target_sig)(void(*)(void))func
+
 struct py_ldb_search_iterator_reply;
 
 typedef struct {
@@ -189,17 +192,19 @@ static PyObject *wrap_text(const char *type, PyObject *wrapped)
 	return inst;
 }
 
-static PyObject *py_ldb_control_get_oid(PyLdbControlObject *self)
+static PyObject *py_ldb_control_get_oid(PyLdbControlObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	return PyStr_FromString(self->data->oid);
 }
 
-static PyObject *py_ldb_control_get_critical(PyLdbControlObject *self)
+static PyObject *py_ldb_control_get_critical(PyLdbControlObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	return PyBool_FromLong(self->data->critical);
 }
 
-static PyObject *py_ldb_control_set_critical(PyLdbControlObject *self, PyObject *value, void *closure)
+static int py_ldb_control_set_critical(PyLdbControlObject *self, PyObject *value, void *closure)
 {
 	if (PyObject_IsTrue(value)) {
 		self->data->critical = true;
@@ -487,27 +492,32 @@ static struct ldb_result *PyLdbResult_AsResult(TALLOC_CTX *mem_ctx,
 	return res;
 }
 
-static PyObject *py_ldb_dn_validate(PyLdbDnObject *self)
+static PyObject *py_ldb_dn_validate(PyLdbDnObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	return PyBool_FromLong(ldb_dn_validate(self->dn));
 }
 
-static PyObject *py_ldb_dn_is_valid(PyLdbDnObject *self)
+static PyObject *py_ldb_dn_is_valid(PyLdbDnObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	return PyBool_FromLong(ldb_dn_is_valid(self->dn));
 }
 
-static PyObject *py_ldb_dn_is_special(PyLdbDnObject *self)
+static PyObject *py_ldb_dn_is_special(PyLdbDnObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	return PyBool_FromLong(ldb_dn_is_special(self->dn));
 }
 
-static PyObject *py_ldb_dn_is_null(PyLdbDnObject *self)
+static PyObject *py_ldb_dn_is_null(PyLdbDnObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	return PyBool_FromLong(ldb_dn_is_null(self->dn));
 }
  
-static PyObject *py_ldb_dn_get_casefold(PyLdbDnObject *self)
+static PyObject *py_ldb_dn_get_casefold(PyLdbDnObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	return PyStr_FromString(ldb_dn_get_casefold(self->dn));
 }
@@ -517,12 +527,14 @@ static PyObject *py_ldb_dn_get_linearized(PyLdbDnObject *self)
 	return PyStr_FromString(ldb_dn_get_linearized(self->dn));
 }
 
-static PyObject *py_ldb_dn_canonical_str(PyLdbDnObject *self)
+static PyObject *py_ldb_dn_canonical_str(PyLdbDnObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	return PyStr_FromString(ldb_dn_canonical_string(self->dn, self->dn));
 }
 
-static PyObject *py_ldb_dn_canonical_ex_str(PyLdbDnObject *self)
+static PyObject *py_ldb_dn_canonical_ex_str(PyLdbDnObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	return PyStr_FromString(ldb_dn_canonical_ex_string(self->dn, self->dn));
 }
@@ -618,7 +630,8 @@ static PyObject *py_ldb_dn_richcmp(PyObject *dn1, PyObject *dn2, int op)
 	return richcmp(ret, op);
 }
 
-static PyObject *py_ldb_dn_get_parent(PyLdbDnObject *self)
+static PyObject *py_ldb_dn_get_parent(PyLdbDnObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_dn *dn = pyldb_Dn_AsDn((PyObject *)self);
 	struct ldb_dn *parent;
@@ -760,7 +773,8 @@ static PyObject *py_ldb_dn_set_component(PyLdbDnObject *self, PyObject *args)
 	Py_RETURN_NONE;
 }
 
-static PyObject *py_ldb_dn_get_rdn_name(PyLdbDnObject *self)
+static PyObject *py_ldb_dn_get_rdn_name(PyLdbDnObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_dn *dn;
 	const char *name;
@@ -775,7 +789,8 @@ static PyObject *py_ldb_dn_get_rdn_name(PyLdbDnObject *self)
 	return PyStr_FromString(name);
 }
 
-static PyObject *py_ldb_dn_get_rdn_value(PyLdbDnObject *self)
+static PyObject *py_ldb_dn_get_rdn_value(PyLdbDnObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_dn *dn;
 	const struct ldb_val *val;
@@ -803,7 +818,9 @@ static PyMethodDef py_ldb_dn_methods[] = {
 		"Check whether this is a null DN." },
 	{ "get_casefold", (PyCFunction)py_ldb_dn_get_casefold, METH_NOARGS,
 		NULL },
-	{ "get_linearized", (PyCFunction)py_ldb_dn_get_linearized, METH_NOARGS,
+	{ "get_linearized", PY_DISCARD_FUNC_SIG(PyCFunction,
+						py_ldb_dn_get_linearized),
+		METH_NOARGS,
 		NULL },
 	{ "canonical_str", (PyCFunction)py_ldb_dn_canonical_str, METH_NOARGS,
 		"S.canonical_str() -> string\n"
@@ -813,7 +830,9 @@ static PyMethodDef py_ldb_dn_methods[] = {
 	{ "canonical_ex_str", (PyCFunction)py_ldb_dn_canonical_ex_str, METH_NOARGS,
 		"S.canonical_ex_str() -> string\n"
 		"Canonical version of this DN (like a posix path, with terminating newline)." },
-	{ "extended_str", (PyCFunction)py_ldb_dn_extended_str, METH_VARARGS | METH_KEYWORDS,
+	{ "extended_str", PY_DISCARD_FUNC_SIG(PyCFunction,
+					      py_ldb_dn_extended_str),
+		METH_VARARGS | METH_KEYWORDS,
 		"S.extended_str(mode=1) -> string\n"
 		"Extended version of this DN" },
 	{ "parent", (PyCFunction)py_ldb_dn_get_parent, METH_NOARGS,
@@ -1027,7 +1046,8 @@ static PyObject *py_ldb_set_modules_dir(PyTypeObject *self, PyObject *args)
 	Py_RETURN_NONE;
 }
 
-static PyObject *py_ldb_transaction_start(PyLdbObject *self)
+static PyObject *py_ldb_transaction_start(PyLdbObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_context *ldb_ctx = pyldb_Ldb_AsLdbContext(self);
 	int ldb_err;
@@ -1036,7 +1056,8 @@ static PyObject *py_ldb_transaction_start(PyLdbObject *self)
 	Py_RETURN_NONE;
 }
 
-static PyObject *py_ldb_transaction_commit(PyLdbObject *self)
+static PyObject *py_ldb_transaction_commit(PyLdbObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_context *ldb_ctx = pyldb_Ldb_AsLdbContext(self);
 	int ldb_err;
@@ -1045,7 +1066,8 @@ static PyObject *py_ldb_transaction_commit(PyLdbObject *self)
 	Py_RETURN_NONE;
 }
 
-static PyObject *py_ldb_transaction_prepare_commit(PyLdbObject *self)
+static PyObject *py_ldb_transaction_prepare_commit(PyLdbObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_context *ldb_ctx = pyldb_Ldb_AsLdbContext(self);
 	int ldb_err;
@@ -1054,7 +1076,8 @@ static PyObject *py_ldb_transaction_prepare_commit(PyLdbObject *self)
 	Py_RETURN_NONE;
 }
 
-static PyObject *py_ldb_transaction_cancel(PyLdbObject *self)
+static PyObject *py_ldb_transaction_cancel(PyLdbObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_context *ldb_ctx = pyldb_Ldb_AsLdbContext(self);
 	int ldb_err;
@@ -1063,7 +1086,8 @@ static PyObject *py_ldb_transaction_cancel(PyLdbObject *self)
 	Py_RETURN_NONE;
 }
 
-static PyObject *py_ldb_setup_wellknown_attributes(PyLdbObject *self)
+static PyObject *py_ldb_setup_wellknown_attributes(PyLdbObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_context *ldb_ctx = pyldb_Ldb_AsLdbContext(self);
 	int ldb_err;
@@ -1077,7 +1101,8 @@ static PyObject *py_ldb_repr(PyLdbObject *self)
 	return PyStr_FromString("<ldb connection>");
 }
 
-static PyObject *py_ldb_get_root_basedn(PyLdbObject *self)
+static PyObject *py_ldb_get_root_basedn(PyLdbObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_dn *dn = ldb_get_root_basedn(pyldb_Ldb_AsLdbContext(self));
 	if (dn == NULL)
@@ -1086,7 +1111,8 @@ static PyObject *py_ldb_get_root_basedn(PyLdbObject *self)
 }
 
 
-static PyObject *py_ldb_get_schema_basedn(PyLdbObject *self)
+static PyObject *py_ldb_get_schema_basedn(PyLdbObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_dn *dn = ldb_get_schema_basedn(pyldb_Ldb_AsLdbContext(self));
 	if (dn == NULL)
@@ -1094,7 +1120,8 @@ static PyObject *py_ldb_get_schema_basedn(PyLdbObject *self)
 	return py_ldb_dn_copy(dn);
 }
 
-static PyObject *py_ldb_get_config_basedn(PyLdbObject *self)
+static PyObject *py_ldb_get_config_basedn(PyLdbObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_dn *dn = ldb_get_config_basedn(pyldb_Ldb_AsLdbContext(self));
 	if (dn == NULL)
@@ -1102,7 +1129,8 @@ static PyObject *py_ldb_get_config_basedn(PyLdbObject *self)
 	return py_ldb_dn_copy(dn);
 }
 
-static PyObject *py_ldb_get_default_basedn(PyLdbObject *self)
+static PyObject *py_ldb_get_default_basedn(PyLdbObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_dn *dn = ldb_get_default_basedn(pyldb_Ldb_AsLdbContext(self));
 	if (dn == NULL)
@@ -2211,7 +2239,8 @@ static PyObject *py_ldb_set_opaque(PyLdbObject *self, PyObject *args)
 	Py_RETURN_NONE;
 }
 
-static PyObject *py_ldb_modules(PyLdbObject *self)
+static PyObject *py_ldb_modules(PyLdbObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_context *ldb = pyldb_Ldb_AsLdbContext(self);
 	PyObject *ret = PyList_New(0);
@@ -2266,7 +2295,8 @@ static const struct ldb_dn_extended_syntax test_dn_syntax = {
 	.write_hex_fn     = ldb_handler_copy,
 };
 
-static PyObject *py_ldb_register_test_extensions(PyLdbObject *self)
+static PyObject *py_ldb_register_test_extensions(PyLdbObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_context *ldb = pyldb_Ldb_AsLdbContext(self);
 	int ret;
@@ -2312,22 +2342,28 @@ static PyMethodDef py_ldb_methods[] = {
 		NULL },
 	{ "get_config_basedn", (PyCFunction)py_ldb_get_config_basedn, METH_NOARGS,
 		NULL },
-	{ "connect", (PyCFunction)py_ldb_connect, METH_VARARGS|METH_KEYWORDS, 
+	{ "connect", PY_DISCARD_FUNC_SIG(PyCFunction, py_ldb_connect),
+		METH_VARARGS|METH_KEYWORDS,
 		"S.connect(url, flags=0, options=None) -> None\n"
 		"Connect to a LDB URL." },
-	{ "modify", (PyCFunction)py_ldb_modify, METH_VARARGS|METH_KEYWORDS,
+	{ "modify", PY_DISCARD_FUNC_SIG(PyCFunction, py_ldb_modify),
+		METH_VARARGS|METH_KEYWORDS,
 		"S.modify(message, controls=None, validate=False) -> None\n"
 		"Modify an entry." },
-	{ "add", (PyCFunction)py_ldb_add, METH_VARARGS|METH_KEYWORDS,
+	{ "add", PY_DISCARD_FUNC_SIG(PyCFunction, py_ldb_add),
+		METH_VARARGS|METH_KEYWORDS,
 		"S.add(message, controls=None) -> None\n"
 		"Add an entry." },
-	{ "delete", (PyCFunction)py_ldb_delete, METH_VARARGS|METH_KEYWORDS,
+	{ "delete", PY_DISCARD_FUNC_SIG(PyCFunction, py_ldb_delete),
+		METH_VARARGS|METH_KEYWORDS,
 		"S.delete(dn, controls=None) -> None\n"
 		"Remove an entry." },
-	{ "rename", (PyCFunction)py_ldb_rename, METH_VARARGS|METH_KEYWORDS,
+	{ "rename", PY_DISCARD_FUNC_SIG(PyCFunction, py_ldb_rename),
+		METH_VARARGS|METH_KEYWORDS,
 		"S.rename(old_dn, new_dn, controls=None) -> None\n"
 		"Rename an entry." },
-	{ "search", (PyCFunction)py_ldb_search, METH_VARARGS|METH_KEYWORDS,
+	{ "search", PY_DISCARD_FUNC_SIG(PyCFunction, py_ldb_search),
+		METH_VARARGS|METH_KEYWORDS,
 		"S.search(base=None, scope=None, expression=None, attrs=None, controls=None) -> result\n"
 		"Search in a database.\n"
 		"\n"
@@ -2338,7 +2374,9 @@ static PyMethodDef py_ldb_methods[] = {
 		":param controls: Optional list of controls\n"
 		":return: ldb.Result object\n"
 	},
-	{ "search_iterator", (PyCFunction)py_ldb_search_iterator, METH_VARARGS|METH_KEYWORDS,
+	{ "search_iterator", PY_DISCARD_FUNC_SIG(PyCFunction,
+						 py_ldb_search_iterator),
+		METH_VARARGS|METH_KEYWORDS,
 		"S.search_iterator(base=None, scope=None, expression=None, attrs=None, controls=None, timeout=None) -> iterator\n"
 		"Search in a database.\n"
 		"\n"
@@ -2655,7 +2693,8 @@ static PyObject *py_ldb_search_iterator_next(PyLdbSearchIteratorObject *self)
 	return py_ret;
 }
 
-static PyObject *py_ldb_search_iterator_result(PyLdbSearchIteratorObject *self)
+static PyObject *py_ldb_search_iterator_result(PyLdbSearchIteratorObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	PyObject *py_ret = NULL;
 
@@ -2689,7 +2728,8 @@ static PyObject *py_ldb_search_iterator_result(PyLdbSearchIteratorObject *self)
 	return py_ret;
 }
 
-static PyObject *py_ldb_search_iterator_abandon(PyLdbSearchIteratorObject *self)
+static PyObject *py_ldb_search_iterator_abandon(PyLdbSearchIteratorObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	if (self->state.req == NULL) {
 		PyErr_SetString(PyExc_RuntimeError,
@@ -2739,19 +2779,22 @@ static PyObject *py_ldb_module_str(PyLdbModuleObject *self)
 	return PyStr_FromString(pyldb_Module_AsModule(self)->ops->name);
 }
 
-static PyObject *py_ldb_module_start_transaction(PyLdbModuleObject *self)
+static PyObject *py_ldb_module_start_transaction(PyLdbModuleObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	pyldb_Module_AsModule(self)->ops->start_transaction(pyldb_Module_AsModule(self));
 	Py_RETURN_NONE;
 }
 
-static PyObject *py_ldb_module_end_transaction(PyLdbModuleObject *self)
+static PyObject *py_ldb_module_end_transaction(PyLdbModuleObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	pyldb_Module_AsModule(self)->ops->end_transaction(pyldb_Module_AsModule(self));
 	Py_RETURN_NONE;
 }
 
-static PyObject *py_ldb_module_del_transaction(PyLdbModuleObject *self)
+static PyObject *py_ldb_module_del_transaction(PyLdbModuleObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	pyldb_Module_AsModule(self)->ops->del_transaction(pyldb_Module_AsModule(self));
 	Py_RETURN_NONE;
@@ -2891,7 +2934,8 @@ static PyObject *py_ldb_module_rename(PyLdbModuleObject *self, PyObject *args)
 }
 
 static PyMethodDef py_ldb_module_methods[] = {
-	{ "search", (PyCFunction)py_ldb_module_search, METH_VARARGS|METH_KEYWORDS, NULL },
+	{ "search", PY_DISCARD_FUNC_SIG(PyCFunction, py_ldb_module_search),
+		METH_VARARGS|METH_KEYWORDS, NULL },
 	{ "add", (PyCFunction)py_ldb_module_add, METH_VARARGS, NULL },
 	{ "modify", (PyCFunction)py_ldb_module_modify, METH_VARARGS, NULL },
 	{ "rename", (PyCFunction)py_ldb_module_rename, METH_VARARGS, NULL },
@@ -3377,7 +3421,8 @@ static PyObject *py_ldb_msg_remove_attr(PyLdbMessageObject *self, PyObject *args
 	Py_RETURN_NONE;
 }
 
-static PyObject *py_ldb_msg_keys(PyLdbMessageObject *self)
+static PyObject *py_ldb_msg_keys(PyLdbMessageObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_message *msg = pyldb_Message_AsMessage(self);
 	Py_ssize_t i, j = 0;
@@ -3457,7 +3502,8 @@ static PyObject *py_ldb_msg_get(PyLdbMessageObject *self, PyObject *args, PyObje
 	return PyObject_FromLdbValue(&el->values[idx]);
 }
 
-static PyObject *py_ldb_msg_items(PyLdbMessageObject *self)
+static PyObject *py_ldb_msg_items(PyLdbMessageObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_message *msg = pyldb_Message_AsMessage(self);
 	Py_ssize_t i, j = 0;
@@ -3501,7 +3547,8 @@ static PyObject *py_ldb_msg_items(PyLdbMessageObject *self)
 	return l;
 }
 
-static PyObject *py_ldb_msg_elements(PyLdbMessageObject *self)
+static PyObject *py_ldb_msg_elements(PyLdbMessageObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	struct ldb_message *msg = pyldb_Message_AsMessage(self);
 	Py_ssize_t i = 0;
@@ -3561,13 +3608,14 @@ static PyMethodDef py_ldb_msg_methods[] = {
 		"Message.from_dict(ldb, dict, mod_flag=FLAG_MOD_REPLACE) -> ldb.Message\n"
 		"Class method to create ldb.Message object from Dictionary.\n"
 		"mod_flag is one of FLAG_MOD_ADD, FLAG_MOD_REPLACE or FLAG_MOD_DELETE."},
-	{ "keys", (PyCFunction)py_ldb_msg_keys, METH_NOARGS, 
+	{ "keys", (PyCFunction)py_ldb_msg_keys, METH_NOARGS,
 		"S.keys() -> list\n\n"
 		"Return sequence of all attribute names." },
 	{ "remove", (PyCFunction)py_ldb_msg_remove_attr, METH_VARARGS, 
 		"S.remove(name)\n\n"
 		"Remove all entries for attributes with the specified name."},
-	{ "get", (PyCFunction)py_ldb_msg_get, METH_VARARGS | METH_KEYWORDS,
+	{ "get", PY_DISCARD_FUNC_SIG(PyCFunction, py_ldb_msg_get),
+		METH_VARARGS | METH_KEYWORDS,
 	  "msg.get(name,default=None,idx=None) -> string\n"
 	  "idx is the index into the values array\n"
 	  "if idx is None, then a list is returned\n"
@@ -3585,7 +3633,7 @@ static PyObject *py_ldb_msg_iter(PyLdbMessageObject *self)
 {
 	PyObject *list, *iter;
 
-	list = py_ldb_msg_keys(self);
+	list = py_ldb_msg_keys(self, NULL);
 	iter = PyObject_GetIter(list);
 	Py_DECREF(list);
 	return iter;
@@ -4241,7 +4289,8 @@ static PyMethodDef py_ldb_global_methods[] = {
 	{ "valid_attr_name", py_valid_attr_name, METH_VARARGS,
 		"S.valid_attr_name(name) -> bool\n\nn"
 		"Check whether the supplied name is a valid attribute name." },
-	{ "open", (PyCFunction)py_ldb_new, METH_VARARGS|METH_KEYWORDS,
+	{ "open", PY_DISCARD_FUNC_SIG(PyCFunction,py_ldb_new),
+		METH_VARARGS|METH_KEYWORDS,
 		"S.open() -> Ldb\n\n"
 		"Open a new LDB context." },
 	{ "binary_encode", py_binary_encode, METH_VARARGS,
diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c
index ad3ad969a0f..b305b608f47 100644
--- a/lib/talloc/pytalloc.c
+++ b/lib/talloc/pytalloc.c
@@ -47,7 +47,8 @@ static PyObject *pytalloc_report_full(PyObject *self, PyObject *args)
 }
 
 /* enable null tracking */
-static PyObject *pytalloc_enable_null_tracking(PyObject *self)
+static PyObject *pytalloc_enable_null_tracking(PyObject *self,
+		PyObject *Py_UNUSED(ignored))
 {
 	talloc_enable_null_tracking();
 	return Py_None;
diff --git a/lib/talloc/test_pytalloc.c b/lib/talloc/test_pytalloc.c
index a7c31c1ad5e..6797b98c6b9 100644
--- a/lib/talloc/test_pytalloc.c
+++ b/lib/talloc/test_pytalloc.c
@@ -30,25 +30,31 @@


-- 
Samba Shared Repository



More information about the samba-cvs mailing list