]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python: export fault_setup() to python bindings
authorStefan Metzmacher <metze@samba.org>
Fri, 25 May 2018 05:52:02 +0000 (07:52 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 12 Jun 2018 06:13:21 +0000 (08:13 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13469

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
python/pyglue.c
python/samba/__init__.py

index 68b14a072e45d9d31795dd4eb7db2a295f21a222..1b111866f223652a6a6796cc7e8a0a01a3f6986d 100644 (file)
@@ -170,6 +170,16 @@ static PyObject *py_get_debug_level(PyObject *self)
        return PyInt_FromLong(DEBUGLEVEL);
 }
 
+static PyObject *py_fault_setup(PyObject *self)
+{
+       static bool done;
+       if (!done) {
+               fault_setup();
+               done = true;
+       }
+       Py_RETURN_NONE;
+}
+
 static PyObject *py_is_ntvfs_fileserver_built(PyObject *self)
 {
 #ifdef WITH_NTVFS_FILESERVER
@@ -339,6 +349,8 @@ static PyMethodDef py_misc_methods[] = {
                "set debug level" },
        { "get_debug_level", (PyCFunction)py_get_debug_level, METH_NOARGS,
                "get debug level" },
+       { "fault_setup", (PyCFunction)py_fault_setup, METH_NOARGS,
+               "setup the default samba panic handler" },
        { "interface_ips", (PyCFunction)py_interface_ips, METH_VARARGS,
                "interface_ips(lp_ctx[, all_interfaces) -> list_of_ifaces\n"
                "\n"
index 7b3c6538771dfc75953bc7e35df3eef31456c862..1a3b24bca580b401b6c2cf8cb6d8887c2a238d98 100644 (file)
@@ -381,6 +381,7 @@ def arcfour_encrypt(key, data):
 
 version = _glue.version
 interface_ips = _glue.interface_ips
+fault_setup = _glue.fault_setup
 set_debug_level = _glue.set_debug_level
 get_debug_level = _glue.get_debug_level
 unix2nttime = _glue.unix2nttime