torture-krb5: Provide a generic handler to catch and print unexpected KRB_ERROR packets
[kai/samba-autobuild/.git] / lib / ntdb / pyntdb.c
index 791ab93ae7a1f14ee017683cfa01b2aad0d7b619..72e626472a2859d6a992ab64e85d7b2b9c37370d 100644 (file)
 #include "replace.h"
 #include "system/filesys.h"
 
-#ifndef Py_RETURN_NONE
-#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
-#endif
-
 /* Include ntdb headers */
 #include <ntdb.h>
 
@@ -42,7 +38,7 @@ typedef struct {
        bool closed;
 } PyNtdbObject;
 
-staticforward PyTypeObject PyNtdb;
+static PyTypeObject PyNtdb;
 
 static void PyErr_SetTDBError(enum NTDB_ERROR e)
 {
@@ -79,7 +75,6 @@ static PyObject *PyString_FromNtdb_Data(NTDB_DATA data)
                return NULL; \
        }
 
-
 static void stderr_log(struct ntdb_context *ntdb,
                       enum ntdb_log_level level,
                       enum NTDB_ERROR ecode,
@@ -104,6 +99,7 @@ static PyObject *py_ntdb_open(PyTypeObject *type, PyObject *args, PyObject *kwar
 
        if (name == NULL) {
                ntdb_flags |= NTDB_INTERNAL;
+               name = "<internal>";
        }
 
        logattr.log.base.attr = NTDB_ATTRIBUTE_LOG;