コード例 #1
0
ファイル: kerberos.c プロジェクト: prashanthpai/PyKerberos
static PyObject *authGSSServerInit(PyObject *self, PyObject *args)
{
    const char *service = NULL;
    gss_server_state *state;
    PyObject *pystate;
    int result = 0;

    if (!PyArg_ParseTuple(args, "s", &service))
        return NULL;

    state = (gss_server_state *) malloc(sizeof(gss_server_state));
    pystate = PyCObject_FromVoidPtr(state, NULL);

    result = authenticate_gss_server_init(service, state);
    if (result == AUTH_GSS_ERROR)
        return NULL;

    return Py_BuildValue("(iO)", result, pystate);
}
コード例 #2
0
ファイル: kerberos.c プロジェクト: 02strich/pykerberos
static PyObject *authGSSServerInit(PyObject *self, PyObject *args) {
    const char *service = NULL;
    gss_server_state *state;
    PyObject *pystate;
    int result = 0;

    if (!PyArg_ParseTuple(args, "s", &service)) {
        return NULL;
    }

    state = (gss_server_state *) malloc(sizeof(gss_server_state));
    pystate = PyNew(state, &destruct_server);

    result = authenticate_gss_server_init(service, state);
    if (result == AUTH_GSS_ERROR) {
        return NULL;
    }

    return Py_BuildValue("(iN)", result, pystate);
}