/* ** smbvalidmodule.c ** ** Copyright 1998 Mark Nottingham ** Distributed under the GPL (see COPYING) ** ** version 0.5 */ #include "Python.h" #include "valid.h" static PyObject * smbvalid_check(self, args) PyObject *self; PyObject *args; { char *username; char *password; char *pdc; char *bdc; char *domain; int retval; if (!PyArg_ParseTuple(args, "sssss", &username, &password, &pdc, &bdc, &domain)) return NULL; if (Valid_User(username, password, pdc, bdc, domain) == NTV_NO_ERROR) { retval = 1; } else { retval = 0; } return Py_BuildValue("i", retval); } static PyMethodDef SmbMethods[] = { {"check", smbvalid_check, METH_VARARGS}, {NULL, NULL} }; void initsmbvalid() { (void) Py_InitModule("smbvalid", SmbMethods); }