summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-04-04 02:01:47 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-04-06 13:12:43 +0200
commite9c3f2ef13f62eb583bd7c5dfb6b94a0a8a0fc4f (patch)
tree98fa5618f4983c8ffb2ec39a585c305ce1af70fe /source4/lib
parentae9761349904ac9c4c2745018903d8c2fcc2abf1 (diff)
downloadsamba-e9c3f2ef13f62eb583bd7c5dfb6b94a0a8a0fc4f.tar.gz
samba-e9c3f2ef13f62eb583bd7c5dfb6b94a0a8a0fc4f.tar.bz2
samba-e9c3f2ef13f62eb583bd7c5dfb6b94a0a8a0fc4f.zip
s4-python: Move ldb_set_utf8_casefold to pyldb-samba.
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb-samba/pyldb.c19
-rwxr-xr-xsource4/lib/ldb/tests/python/deletetest.py1
2 files changed, 18 insertions, 2 deletions
diff --git a/source4/lib/ldb-samba/pyldb.c b/source4/lib/ldb-samba/pyldb.c
index 54907d9ff8..bb066ed711 100644
--- a/source4/lib/ldb-samba/pyldb.c
+++ b/source4/lib/ldb-samba/pyldb.c
@@ -25,6 +25,8 @@
#include "lib/ldb/pyldb.h"
#include "param/pyparam.h"
#include "auth/credentials/pycredentials.h"
+#include "ldb_wrap.h"
+#include "lib/ldb-samba/ldif_handlers.h"
static PyObject *pyldb_module;
staticforward PyTypeObject PySambaLdb;
@@ -136,15 +138,30 @@ static PyObject *py_ldb_set_opaque_integer(PyObject *self, PyObject *args)
Py_RETURN_NONE;
}
+static PyObject *py_ldb_set_utf8_casefold(PyObject *self, PyObject *args)
+{
+ struct ldb_context *ldb;
+
+ ldb = PyLdb_AsLdbContext(self);
+
+ ldb_set_utf8_fns(ldb, NULL, wrap_casefold);
+
+ Py_RETURN_NONE;
+}
+
static PyMethodDef py_samba_ldb_methods[] = {
{ "set_loadparm", (PyCFunction)py_ldb_set_loadparm, METH_VARARGS,
"ldb_set_loadparm(ldb, session_info)\n"
"Set loadparm context to use when connecting." },
- { "ldb_set_credentials", (PyCFunction)py_ldb_set_credentials, METH_VARARGS,
+ { "set_credentials", (PyCFunction)py_ldb_set_credentials, METH_VARARGS,
"ldb_set_credentials(ldb, credentials)\n"
"Set credentials to use when connecting." },
{ "set_opaque_integer", (PyCFunction)py_ldb_set_opaque_integer,
METH_VARARGS, NULL },
+ { "set_utf8_casefold", (PyCFunction)py_ldb_set_utf8_casefold,
+ METH_NOARGS,
+ "ldb_set_utf8_casefold(ldb)\n"
+ "Set the right Samba casefolding function for UTF8 charset." },
{ NULL },
};
diff --git a/source4/lib/ldb/tests/python/deletetest.py b/source4/lib/ldb/tests/python/deletetest.py
index eff92c5f33..55f34fac14 100755
--- a/source4/lib/ldb/tests/python/deletetest.py
+++ b/source4/lib/ldb/tests/python/deletetest.py
@@ -1,7 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-import getopt
import optparse
import sys
import os