[SCM] Samba Shared Repository - branch master updated
Andrew Tridgell
tridge at samba.org
Tue Jan 18 18:22:02 MST 2011
The branch, master has been updated
via 7d8e970 waf: change private libraries to use the same soname as public libraries
via bc0230b pygensec: remove special case handling for None for buffers
from f8f1711 Fix "net usersidlist" not to skip every other user
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 7d8e9706f7829feaef928424e76bd7df6e223762
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Jan 19 11:04:05 2011 +1100
waf: change private libraries to use the same soname as public libraries
See
http://lists.samba.org/archive/samba-technical/2011-January/075816.html
for a description of the reason behind this change
Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
Autobuild-User: Andrew Tridgell <tridge at samba.org>
Autobuild-Date: Wed Jan 19 02:21:06 CET 2011 on sn-devel-104
commit bc0230be1d3d439fd5219a2123d4195b178870bc
Author: Andrew Tridgell <tridge at samba.org>
Date: Wed Jan 19 10:31:28 2011 +1100
pygensec: remove special case handling for None for buffers
always returning a buffer makes life easier for callers
Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
-----------------------------------------------------------------------
Summary of changes:
buildtools/wafsamba/samba_bundled.py | 12 ++---
source4/auth/gensec/pygensec.c | 63 +++++++++++-------------
source4/scripting/python/samba/tests/gensec.py | 2 +-
3 files changed, 34 insertions(+), 43 deletions(-)
Changeset truncated at 500 lines:
diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py
index 27234fb..2e3e130 100644
--- a/buildtools/wafsamba/samba_bundled.py
+++ b/buildtools/wafsamba/samba_bundled.py
@@ -6,13 +6,11 @@ from samba_utils import *
def PRIVATE_NAME(bld, name, private_extension, private_library):
'''possibly rename a library to include a bundled extension'''
- if bld.env.DISABLE_SHARED or not private_extension:
- return name
- if name in bld.env.PRIVATE_EXTENSION_EXCEPTION and not private_library:
- return name
- extension = getattr(bld.env, 'PRIVATE_EXTENSION', '')
- if extension:
- return name + '-' + extension
+
+ # we now use the same private name for libraries as the public name.
+ # see http://git.samba.org/?p=tridge/junkcode.git;a=tree;f=shlib for a
+ # demonstration that this is the right thing to do
+ # also see http://lists.samba.org/archive/samba-technical/2011-January/075816.html
return name
diff --git a/source4/auth/gensec/pygensec.c b/source4/auth/gensec/pygensec.c
index da62018..cd05bd7 100644
--- a/source4/auth/gensec/pygensec.c
+++ b/source4/auth/gensec/pygensec.c
@@ -349,24 +349,25 @@ static PyObject *py_gensec_have_feature(PyObject *self, PyObject *args)
static PyObject *py_gensec_update(PyObject *self, PyObject *args)
{
NTSTATUS status;
-
TALLOC_CTX *mem_ctx;
DATA_BLOB in, out;
PyObject *ret, *py_in;
struct gensec_security *security = py_talloc_get_type(self, struct gensec_security);
+ PyObject *finished_processing;
if (!PyArg_ParseTuple(args, "O", &py_in))
return NULL;
mem_ctx = talloc_new(NULL);
- if (py_in == Py_None) {
- in = data_blob_null;
- } else {
- in.data = (uint8_t *)PyString_AsString(py_in);
- in.length = PyString_Size(py_in);
+ if (!PyString_Check(py_in)) {
+ PyErr_Format(PyExc_TypeError, "expected a string");
+ return NULL;
}
+ in.data = (uint8_t *)PyString_AsString(py_in);
+ in.length = PyString_Size(py_in);
+
status = gensec_update(security, mem_ctx, in, &out);
if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)
@@ -375,18 +376,16 @@ static PyObject *py_gensec_update(PyObject *self, PyObject *args)
talloc_free(mem_ctx);
return NULL;
}
- if (out.length != 0) {
- ret = PyString_FromStringAndSize((const char *)out.data, out.length);
- } else {
- ret = Py_None;
- }
+ ret = PyString_FromStringAndSize((const char *)out.data, out.length);
talloc_free(mem_ctx);
- if (NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED))
- {
- return PyTuple_Pack(2, Py_False, ret);
+
+ if (NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
+ finished_processing = Py_False;
} else {
- return PyTuple_Pack(2, Py_True, ret);
+ finished_processing = Py_True;
}
+
+ return PyTuple_Pack(2, finished_processing, ret);
}
static PyObject *py_gensec_wrap(PyObject *self, PyObject *args)
@@ -403,12 +402,12 @@ static PyObject *py_gensec_wrap(PyObject *self, PyObject *args)
mem_ctx = talloc_new(NULL);
- if (py_in == Py_None) {
- in = data_blob_null;
- } else {
- in.data = (uint8_t *)PyString_AsString(py_in);
- in.length = PyString_Size(py_in);
+ if (!PyString_Check(py_in)) {
+ PyErr_Format(PyExc_TypeError, "expected a string");
+ return NULL;
}
+ in.data = (uint8_t *)PyString_AsString(py_in);
+ in.length = PyString_Size(py_in);
status = gensec_wrap(security, mem_ctx, &in, &out);
@@ -418,11 +417,7 @@ static PyObject *py_gensec_wrap(PyObject *self, PyObject *args)
return NULL;
}
- if (out.length != 0) {
- ret = PyString_FromStringAndSize((const char *)out.data, out.length);
- } else {
- ret = Py_None;
- }
+ ret = PyString_FromStringAndSize((const char *)out.data, out.length);
talloc_free(mem_ctx);
return ret;
}
@@ -441,13 +436,14 @@ static PyObject *py_gensec_unwrap(PyObject *self, PyObject *args)
mem_ctx = talloc_new(NULL);
- if (py_in == Py_None) {
- in = data_blob_null;
- } else {
- in.data = (uint8_t *)PyString_AsString(py_in);
- in.length = PyString_Size(py_in);
+ if (!PyString_Check(py_in)) {
+ PyErr_Format(PyExc_TypeError, "expected a string");
+ return NULL;
}
+ in.data = (uint8_t *)PyString_AsString(py_in);
+ in.length = PyString_Size(py_in);
+
status = gensec_unwrap(security, mem_ctx, &in, &out);
if (!NT_STATUS_IS_OK(status)) {
@@ -456,11 +452,7 @@ static PyObject *py_gensec_unwrap(PyObject *self, PyObject *args)
return NULL;
}
- if (out.length != 0) {
- ret = PyString_FromStringAndSize((const char *)out.data, out.length);
- } else {
- ret = Py_None;
- }
+ ret = PyString_FromStringAndSize((const char *)out.data, out.length);
talloc_free(mem_ctx);
return ret;
}
@@ -502,6 +494,7 @@ static PyTypeObject Py_Security = {
.tp_basicsize = sizeof(py_talloc_Object),
};
+void initgensec(void);
void initgensec(void)
{
PyObject *m;
diff --git a/source4/scripting/python/samba/tests/gensec.py b/source4/scripting/python/samba/tests/gensec.py
index f1cc44b..ddca0df 100644
--- a/source4/scripting/python/samba/tests/gensec.py
+++ b/source4/scripting/python/samba/tests/gensec.py
@@ -67,7 +67,7 @@ class GensecTests(samba.tests.TestCase):
client_finished = False
server_finished = False
- server_to_client = None
+ server_to_client = ""
"""Run the actual call loop"""
while client_finished == False and server_finished == False:
--
Samba Shared Repository
More information about the samba-cvs
mailing list