1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

s4:auth Remove system_session_anon() from python bindings

This commit is contained in:
Andrew Bartlett 2010-08-14 17:45:57 +10:00
parent a68a5592c5
commit ba52834dd9
5 changed files with 4 additions and 58 deletions

View File

@ -56,24 +56,6 @@ static PyObject *py_system_session(PyObject *module, PyObject *args)
}
static PyObject *py_system_session_anon(PyObject *module, PyObject *args)
{
PyObject *py_lp_ctx = Py_None;
struct loadparm_context *lp_ctx;
struct auth_session_info *session;
if (!PyArg_ParseTuple(args, "|O", &py_lp_ctx))
return NULL;
lp_ctx = lpcfg_from_py_object(NULL, py_lp_ctx); /* FIXME: leaks memory */
if (lp_ctx == NULL)
return NULL;
session = system_session_anon(NULL, lp_ctx);
return PyAuthSession_FromSession(session);
}
static PyObject *py_admin_session(PyObject *module, PyObject *args)
{
PyObject *py_lp_ctx;
@ -96,7 +78,6 @@ static PyObject *py_admin_session(PyObject *module, PyObject *args)
static PyMethodDef py_auth_methods[] = {
{ "system_session", (PyCFunction)py_system_session, METH_VARARGS, NULL },
{ "system_session_anonymous", (PyCFunction)py_system_session_anon, METH_VARARGS, NULL },
{ "admin_session", (PyCFunction)py_admin_session, METH_VARARGS, NULL },
{ NULL },
};

View File

@ -37,13 +37,6 @@ struct auth_context;
* the off-host credentials */
struct auth_session_info *system_session(struct loadparm_context *lp_ctx) ;
/*
* Create a system session, but with anonymous credentials (so we do
* not need to open secrets.ldb)
*/
struct auth_session_info *system_session_anon(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx);
NTSTATUS auth_anonymous_server_info(TALLOC_CTX *mem_ctx,
const char *netbios_name,
struct auth_serversupplied_info **_server_info) ;

View File

@ -173,9 +173,9 @@ _PUBLIC_ struct auth_session_info *system_session(struct loadparm_context *lp_ct
return static_session;
}
static NTSTATUS _auth_system_session_info(TALLOC_CTX *parent_ctx,
struct loadparm_context *lp_ctx,
struct auth_session_info **_session_info)
NTSTATUS auth_system_session_info(TALLOC_CTX *parent_ctx,
struct loadparm_context *lp_ctx,
struct auth_session_info **_session_info)
{
NTSTATUS nt_status;
struct auth_serversupplied_info *server_info = NULL;
@ -208,31 +208,6 @@ static NTSTATUS _auth_system_session_info(TALLOC_CTX *parent_ctx,
return NT_STATUS_OK;
}
/*
Create a system session, but with anonymous credentials (so we do not need to open secrets.ldb)
*/
_PUBLIC_ struct auth_session_info *system_session_anon(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
{
NTSTATUS nt_status;
struct auth_session_info *session_info = NULL;
nt_status = _auth_system_session_info(mem_ctx, lp_ctx, &session_info);
if (!NT_STATUS_IS_OK(nt_status)) {
return NULL;
}
return session_info;
}
_PUBLIC_ NTSTATUS auth_system_session_info(TALLOC_CTX *parent_ctx,
struct loadparm_context *lp_ctx,
struct auth_session_info **_session_info)
{
return _auth_system_session_info(parent_ctx,
lp_ctx,
_session_info);
}
NTSTATUS auth_system_server_info(TALLOC_CTX *mem_ctx, const char *netbios_name,
struct auth_serversupplied_info **_server_info)
{

View File

@ -31,5 +31,3 @@ class AuthTests(samba.tests.TestCase):
def test_system_session(self):
auth.system_session()
def test_system_session_anon(self):
auth.system_session_anonymous()

View File

@ -25,7 +25,6 @@ from samba.ndr import ndr_pack, ndr_unpack
from samba.dcerpc import security
from samba.auth import system_session
from samba.auth import system_session_anonymous
from samba import gensec
from samba.samdb import SamDB
from samba.credentials import Credentials
@ -717,7 +716,7 @@ class AclSearchTests(AclTests):
self.u2 = "search_u2"
self.u3 = "search_u3"
self.group1 = "group1"
self.anonymous = SamDB(url=host, session_info=system_session_anonymous(),
self.anonymous = SamDB(url=host, session_info=system_session(),
lp=lp)
res = self.ldb_admin.search("CN=Directory Service, CN=Windows NT, CN=Services, "
+ self.configuration_dn, scope=SCOPE_BASE, attrs=["dSHeuristics"])