[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha2-445-g7a00d48

Jelmer Vernooij jelmer at samba.org
Mon Jan 14 19:25:44 GMT 2008


The branch, v4-0-test has been updated
       via  7a00d48a478be84e9f38c5e6cb57739063d0d613 (commit)
       via  cb2700094fc1fc3887d5254e5d42e035deefa5b9 (commit)
       via  567099b66d0369715f8e0a083a5ce160faaf4da2 (commit)
      from  9c21773737ea941b623105352b4625dcb8437706 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit 7a00d48a478be84e9f38c5e6cb57739063d0d613
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 20:14:53 2008 +0100

    python: Enable building of the wkssvc python bindings.

commit cb2700094fc1fc3887d5254e5d42e035deefa5b9
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 20:09:18 2008 +0100

    python: Fix handling of pointer-less strings in function arguments.

commit 567099b66d0369715f8e0a083a5ce160faaf4da2
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Mon Jan 14 20:08:04 2008 +0100

    python: Compile in svcctl Python bindings.

-----------------------------------------------------------------------

Summary of changes:
 source/librpc/config.mk                            |    8 ++++++++
 source/librpc/idl/svcctl.idl                       |    1 +
 source/pidl/lib/Parse/Pidl/Samba4/Python.pm        |   16 ++++++++--------
 .../samba/tests/upgrade.py => bin/epdump.py}       |    8 +++++---
 source/scripting/python/modules.c                  |    2 ++
 5 files changed, 24 insertions(+), 11 deletions(-)
 copy source/scripting/{python/samba/tests/upgrade.py => bin/epdump.py} (81%)


Changeset truncated at 500 lines:

diff --git a/source/librpc/config.mk b/source/librpc/config.mk
index ddb07dc..8774f2f 100644
--- a/source/librpc/config.mk
+++ b/source/librpc/config.mk
@@ -625,9 +625,17 @@ PRIVATE_DEPENDENCIES = dcerpc_atsvc
 OBJ_FILES = gen_ndr/py_samr.o
 PRIVATE_DEPENDENCIES = dcerpc_samr
 
+[PYTHON::python_svcctl]
+OBJ_FILES = gen_ndr/py_svcctl.o
+PRIVATE_DEPENDENCIES = RPC_NDR_SVCCTL
+
 [PYTHON::python_lsa]
 OBJ_FILES = gen_ndr/py_lsa.o
 PRIVATE_DEPENDENCIES = RPC_NDR_LSA
 
+[PYTHON::python_wkssvc]
+OBJ_FILES = gen_ndr/py_wkssvc.o
+PRIVATE_DEPENDENCIES = RPC_NDR_WKSSVC
+
 [PYTHON::python_dcerpc_security]
 OBJ_FILES = gen_ndr/py_security.o
diff --git a/source/librpc/idl/svcctl.idl b/source/librpc/idl/svcctl.idl
index 2fbdb71..d9f8233 100644
--- a/source/librpc/idl/svcctl.idl
+++ b/source/librpc/idl/svcctl.idl
@@ -4,6 +4,7 @@
   svcctl interface definitions
 */
 
+import "misc.idl";
 [ uuid("367abb81-9844-35f1-ad32-98f038001003"),
   version(2.0),
   pointer_default(unique),
diff --git a/source/pidl/lib/Parse/Pidl/Samba4/Python.pm b/source/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 31b06d1..2475925 100644
--- a/source/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/source/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -642,12 +642,12 @@ sub ConvertObjectFromPythonData($$$$$$)
 
 
 	if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "NTSTATUS") {
-		$self->pidl("$target = PyInt_AsLong($cvar);");
+		$self->pidl("$target = NT_STATUS(PyInt_AsLong($cvar));");
 		return;
 	}
 
 	if ($actual_ctype->{TYPE} eq "SCALAR" and $actual_ctype->{NAME} eq "WERROR") {
-		$self->pidl("$target = PyInt_AsLong($cvar);");
+		$self->pidl("$target = W_ERROR(PyInt_AsLong($cvar));");
 		return;
 	}
 
@@ -690,16 +690,16 @@ sub ConvertObjectFromPythonLevel($$$$$$$$)
 			$self->pidl("}");
 		}
 	} elsif ($l->{TYPE} eq "ARRAY") {
+		my $pl = GetPrevLevel($e, $l);
+		if ($pl && $pl->{TYPE} eq "POINTER") {
+			$var_name = get_pointer_to($var_name);
+		}
+
 		if (is_charset_array($e, $l)) {
 			$self->pidl("PY_CHECK_TYPE(PyUnicode, $py_var, $fail);");
 			# FIXME: Use Unix charset setting rather than utf-8
-			$self->pidl(get_pointer_to($var_name) . " = PyString_AsString(PyUnicode_AsEncodedString($py_var, \"utf-8\", \"ignore\"));");
+			$self->pidl($var_name . " = PyString_AsString(PyUnicode_AsEncodedString($py_var, \"utf-8\", \"ignore\"));");
 		} else {
-			my $pl = GetPrevLevel($e, $l);
-			if ($pl && $pl->{TYPE} eq "POINTER") {
-				$var_name = get_pointer_to($var_name);
-			}
-
 			my $counter = "$e->{NAME}_cntr_$l->{LEVEL_INDEX}";
 			$self->pidl("PY_CHECK_TYPE(PyList, $py_var, $fail);");
 			$self->pidl("{");
diff --git a/source/scripting/python/samba/tests/upgrade.py b/source/scripting/bin/epdump.py
similarity index 81%
copy from source/scripting/python/samba/tests/upgrade.py
copy to source/scripting/bin/epdump.py
index ddafa00..15dee33 100644
--- a/source/scripting/python/samba/tests/upgrade.py
+++ b/source/scripting/bin/epdump.py
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 
 # Unix SMB/CIFS implementation.
-# Copyright (C) Jelmer Vernooij <jelmer at samba.org> 2007
+# Copyright (C) Jelmer Vernooij <jelmer at samba.org> 2008
 #   
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -17,6 +17,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-import samba.upgrade
-from unittest import TestCase
+import sys
 
+if len(sys.argv) < 2:
+    print "Usage: %s <binding-string>" % sys.argv[0]
+    sys.exit(1)
diff --git a/source/scripting/python/modules.c b/source/scripting/python/modules.c
index c953e98..b2dd50b 100644
--- a/source/scripting/python/modules.c
+++ b/source/scripting/python/modules.c
@@ -44,6 +44,8 @@ extern void initatsvc(void);
 extern void initsamr(void);
 static void initdcerpc_security(void) {}
 extern void initlsa(void);
+extern void initsvcctl(void);
+extern void initwkssvc(void);
 
 static struct _inittab py_modules[] = { STATIC_LIBPYTHON_MODULES };
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list