[SCM] Samba Shared Repository - branch master updated

Andrew Tridgell tridge at samba.org
Thu Jul 28 00:36:03 MDT 2011


The branch, master has been updated
       via  427805b samba-tool: ensure prompting of passwords is in the right order
       via  2b6ea79 samba-tool: Added gpo fetch command implementation using python smb module.
       via  d6db661 samba-tool: Change samba-tool gpo semantics (use gpo name instead of dn)
       via  43ff229 s4-libcli: Initialize stack structure variables to zero.
       via  6c1cbfb tests-blackbox: Revert the test to use user-level change password command
       via  fca7062 test-blackbox: use python version of change password command
       via  db151ee test-blackbox: Rearrange arguments for samba-tool user setpassword command
       via  c876993 test-blackbox: Remove 'domain\' from username for samba-tool user setpassword
       via  94976ee test-blackbox: Rearrange the arguments in required order for samba-tool time
       via  9e7d8ed samba-tool: Add user password command to change user's own password
       via  9c37084 s4-libnet: py_net Add change_password() python command
       via  05ff244 s4-libnet: py_net - Remove parsing for credentials argument
       via  d885280 samba-tool: Python routine to find writable/ldap-capable DC
       via  20f8a8e s4-libcli: Added python interface for file I/O using SMB
       via  c2853e0 samba-tool: For samba-tool-c, help lists commands implemented only in C
       via  921424f s4-param: Fix object names for python objects PyLoadparm and PyLoadparmContext
       via  48d905f samba-tool: Catch exceptions at top-level and exit with correct return value
       via  e79040c samba-tool: Display usage for main commands and list them alphabetically
       via  1a44400 samba-tool: Raise exception on errors and report using base class
       via  d4c1149 samba-tool: Display Usage line and list commands alphabetically
       via  02667cb samba-tool: Replace C version of samba-tool with python version
       via  35747fe samba-tool: Added python version of samba-tool
       via  2625199 s4auth: Fix the object name for Py_Security
       via  6a12f7d s4auth: Fix the object names for PyCredentials and PyCredentialCacheContainer
       via  b9e0587 s4auth: Remove duplicate assignment of structure variable
       via  ef5e9ec ldb-samba: Allow --show-binary flag on defaultSecurityDescriptor
       via  197996c ldb: Expose ldb_handler_fold() funcion
       via  e746610 samba-tool: Reimplement GPO functions in python
       via  8de3f98 samba-tool: Removed newuser
       via  901959d samba-tool: updated test suite to account for newuser change
       via  31ade9c samba-tool: Changed "user add" implementation
       via  41f073e samba-tool: add -H or --URL where necessary
       via  2e08285 samba-tool: update test suite to reflect the move from password to "user setpassword"
       via  cdf8926 samba-tool: Remove password as it has been moved to "user setpassword"
       via  356a2cc s3-waf: the passdb subsystem needs to be called pdb
      from  d82256c Use existing ISDOT and ISDOTDOT macros.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 427805b87a0781a4b39594f4efdf4b9d023d2324
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jul 28 15:14:03 2011 +1000

    samba-tool: ensure prompting of passwords is in the right order
    
    ask the creds object for the password before prompting for the new
    password in the user password change code, to ensure the user is asked
    for the old password first
    
    Pair-Programmed-With: Amitay Isaacs <amitay at gmail.com>
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User: Andrew Tridgell <tridge at samba.org>
    Autobuild-Date: Thu Jul 28 08:35:45 CEST 2011 on sn-devel-104

commit 2b6ea7975b5254a90ea183e3a69647920cbf4595
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jul 28 14:17:19 2011 +1000

    samba-tool: Added gpo fetch command implementation using python smb module.
    
    To copy the GPO files, use libcli python interface list() to get directory
    listing and loadfile() to read the contents of the file.
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit d6db6614dd3621ad2a2cff58d1d79d6fdf7345f0
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jul 28 14:07:44 2011 +1000

    samba-tool: Change samba-tool gpo semantics (use gpo name instead of dn)
    
    Instead of using gpo dn as the key to refer to a gpo, use the gpo name
    as the key.
    
    If no URL is specified (-H option), find a writable DC and use that.
    
    Extract a commonly used method as get_gpo_info() to find details of a GPO.
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 43ff229b9a71959c2a583d1ff6bec3de5d873af3
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jul 28 13:22:01 2011 +1000

    s4-libcli: Initialize stack structure variables to zero.
    
    Update do_smb_connect function to return NTSTATUS rather than raise
    python exception on error. Error checking done in py_smb_new().
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 6c1cbfb232dbf20589c2aa8cbe8e3f0564a4a31d
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jul 28 09:23:03 2011 +1000

    tests-blackbox: Revert the test to use user-level change password command
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit fca7062d2a49d38566a19129c817ef1f75931039
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jul 27 18:56:35 2011 +1000

    test-blackbox: use python version of change password command
    
    Replace the "samba-tool user setpassword" command with user level
    "samba-tool user password" command.
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit db151ee3c0738e101ce3e32972e39c82bf91712b
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jul 27 18:54:17 2011 +1000

    test-blackbox: Rearrange arguments for samba-tool user setpassword command
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit c8769939016a8d18846ad1f5595080878e261bdf
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jul 27 18:52:05 2011 +1000

    test-blackbox: Remove 'domain\' from username for samba-tool user setpassword
    
    Python version of samba-tool does not require 'domain\' prefix for username.
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 94976ee2eff973bc9fd296da42ec50ee4008ad7e
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jul 27 18:49:35 2011 +1000

    test-blackbox: Rearrange the arguments in required order for samba-tool time
    
    Python version of samba-tool requires the command and the subcommand to
    be specified before the options.
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 9e7d8edc0646c5e27fc476d17c723661f252ca70
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jul 27 18:41:56 2011 +1000

    samba-tool: Add user password command to change user's own password
    
    This command is a user-level command and differs from setpassword
    command which is administrator command.
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 9c370846ae4a0e52d816e79246a4e2e6ea58129c
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jul 27 18:38:29 2011 +1000

    s4-libnet: py_net Add change_password() python command
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 05ff244cc0fb11e85fc7fa1148edeb7f72f99e84
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jul 27 18:37:14 2011 +1000

    s4-libnet: py_net - Remove parsing for credentials argument
    
    py_creds are not used anywhere in the function.
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit d88528081891b51f6ef69651f7173fc708b59916
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Jul 26 13:46:17 2011 +1000

    samba-tool: Python routine to find writable/ldap-capable DC
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 20f8a8ea305caea2ceef69cb0be08e693ba8f3fb
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Jul 26 13:32:03 2011 +1000

    s4-libcli: Added python interface for file I/O using SMB
    
    This module will support file system access using SMB.
    
    based on smb_composite - loadfile(), savefile()
    based on raw -  getacl(), setacl()
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit c2853e0246beb15a4ae66a2d57763ab509c60d54
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Jul 26 13:19:29 2011 +1000

    samba-tool: For samba-tool-c, help lists commands implemented only in C
    
    The rest of the commands are available in python version of samba-tool.
    C version of samba-tool is for testing only and will be phased out once
    all the commands are ported to python.
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 921424fa38c850ba9e4c246ee21dcc6ef391664f
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Jul 25 11:45:14 2011 +1000

    s4-param: Fix object names for python objects PyLoadparm and PyLoadparmContext
    
    Use the object names <modulename>.<objectname> to correctly generate
    the object hierarchy in pydoc.
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 48d905f281af80e0d0dd0269a72fecdf05aeb1be
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jul 21 12:32:53 2011 +1000

    samba-tool: Catch exceptions at top-level and exit with correct return value
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit e79040cc720c18cce11731f5140411b40d7dad68
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jul 21 12:30:38 2011 +1000

    samba-tool: Display usage for main commands and list them alphabetically
    
    This makes the MainCommand class similar to SuperCommand class in netcmd.
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 1a444004dddbd534a40fb0b1fd6ee72d3c8deea9
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jul 21 12:21:17 2011 +1000

    samba-tool: Raise exception on errors and report using base class
    
    Exceptions are captured at top-level samba-tool and reported using
    the base class (Command) method show_command_error().
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit d4c1149e3ec11a59cb49cd9be71079e503eb9e19
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jul 21 12:15:33 2011 +1000

    samba-tool: Display Usage line and list commands alphabetically
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 02667cbe2627898fb2937f649015373a1d450de3
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jul 21 09:48:30 2011 +1000

    samba-tool: Replace C version of samba-tool with python version
    
    C version of samba-tool is now called samba-tool-c, which will be
    removed as soon as all the samba-tool commands are ported to python.
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 35747fe6f05b0d39c4d768d0e88ed6e23aa7875f
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jul 20 17:07:35 2011 +1000

    samba-tool: Added python version of samba-tool
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 2625199d80bb1280a939ae51a0e835b07d867218
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jul 20 14:50:05 2011 +1000

    s4auth: Fix the object name for Py_Security
    
    Use the object names as <modulename>.<objectname> to correctly generate the
    object hierarchy in pydoc.
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 6a12f7d66e7edeee020483cf3a7eecebb0ea4770
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jul 20 14:48:34 2011 +1000

    s4auth: Fix the object names for PyCredentials and PyCredentialCacheContainer
    
    Use the object names as <modulename>.<objectname> to correctly generate the
    object hierarchy in pydoc.
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit b9e05879600c185dff640c78c240e3cd0ab27e43
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jul 20 14:44:19 2011 +1000

    s4auth: Remove duplicate assignment of structure variable
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit ef5e9ec3e309d033ad3916ca95daa0f2a96d95b7
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Jul 15 11:25:36 2011 +1000

    ldb-samba: Allow --show-binary flag on defaultSecurityDescriptor
    
    This allows users to display defaultSecurityDescriptor in fully expanded form.
    
    Pair-Programmed-With: Andrew Tridgell <tridge at samba.org>
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 197996c3df81cc82bb12ee87118f112de9921813
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Jul 15 11:23:03 2011 +1000

    ldb: Expose ldb_handler_fold() funcion
    
    This allows creation of derived syntax handlers from the base directory string.
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit e74661066b05b0a8fb444b1f2aaa66d95360087a
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jul 14 08:21:19 2011 +1000

    samba-tool: Reimplement GPO functions in python
    
    Implementation of subcommands - show, getlink, setlink, dellink,
    getinheritance, setinheritance
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 8de3f98ef28a5b18a50f113f82d0cae3fb5142b9
Author: Giampaolo Lauria <lauria2 at yahoo.com>
Date:   Wed Jul 27 15:52:25 2011 -0400

    samba-tool: Removed newuser
    
    Removed newuser as its functionality has been moved to "user add"
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 901959d9ca4ba09f03367024c3ab74cc6fb86d78
Author: Giampaolo Lauria <lauria2 at yahoo.com>
Date:   Wed Jul 27 15:44:34 2011 -0400

    samba-tool: updated test suite to account for newuser change
    
    Updated test suite invocations of newuser to "user add" as
    the newuser functionality is now being moved to "user add"
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 31ade9c122f330cfe5a2cd4f9c27e73117f993c4
Author: Giampaolo Lauria <lauria2 at yahoo.com>
Date:   Tue Jul 26 13:25:58 2011 -0400

    samba-tool: Changed "user add" implementation
    
    Changed "user add" to use SamDB instead of Net
    Also, added the set of Options available in newuser
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 41f073eb601f83e89bd1d2eba7905fede869a5ae
Author: Giampaolo Lauria <lauria2 at yahoo.com>
Date:   Mon Jul 25 11:56:10 2011 -0400

    samba-tool: add -H or --URL where necessary
    
    To improve consistency, I've made sure all the commands take either a -H
    or --URL when specifying a URL
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 2e082853fbbec127b99e97ea785b564f6aa774d7
Author: Giampaolo Lauria <lauria2 at yahoo.com>
Date:   Tue Jul 5 13:38:30 2011 -0400

    samba-tool: update test suite to reflect the move from password to "user setpassword"
    
    This is part of the work to reflect the object-action model
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit cdf89266fe92dfe534f1b72fae11054de36b96de
Author: Giampaolo Lauria <lauria2 at yahoo.com>
Date:   Tue Jul 5 09:34:19 2011 -0400

    samba-tool: Remove password as it has been moved to "user setpassword"
    
    The password functionality has been moved to "user setpassword" to fit the object-action model
    
    Signed-off-by: Andrew Tridgell <tridge at samba.org>

commit 356a2cc0b05e557c63ae180c7432351a950078d4
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Jul 28 14:41:56 2011 +1000

    s3-waf: the passdb subsystem needs to be called pdb
    
    the 'pdb' name is builtin to the passdb module loading code as a fixed
    string. We need to call the subsystem pdb so that external passdb
    modules end up in bin/modules/pdb/ where they can be found by the
    Samba3 module loader
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

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

Summary of changes:
 lib/ldb-samba/ldif_handlers.c                     |   30 +
 lib/ldb-samba/ldif_handlers.h                     |    1 +
 lib/ldb/include/ldb_handlers.h                    |   17 +-
 source3/pam_smbpass/wscript_build                 |    2 +-
 source3/passdb/wscript_build                      |   12 +-
 source3/winbindd/wscript_build                    |    2 +-
 source3/wscript_build                             |   44 +-
 source4/auth/credentials/pycredentials.c          |    4 +-
 source4/auth/gensec/pygensec.c                    |    2 +-
 source4/auth/pyauth.c                             |    1 -
 source4/libcli/pysmb.c                            |  418 ++++++++++++++
 source4/libcli/wscript_build                      |    6 +
 source4/libnet/py_net.c                           |   64 ++-
 source4/param/pyparam.c                           |    4 +-
 source4/samba_tool/password.c                     |  174 ------
 source4/samba_tool/samba_tool.c                   |    4 +-
 source4/samba_tool/wscript_build                  |    4 +-
 source4/scripting/bin/samba-tool                  |   77 +++
 source4/scripting/bin/wscript_build               |    1 +
 source4/scripting/python/samba/netcmd/__init__.py |   24 +-
 source4/scripting/python/samba/netcmd/common.py   |   13 +
 source4/scripting/python/samba/netcmd/dbcheck.py  |    3 +-
 source4/scripting/python/samba/netcmd/domain.py   |    6 +-
 source4/scripting/python/samba/netcmd/dsacl.py    |    8 +-
 source4/scripting/python/samba/netcmd/fsmo.py     |    7 +-
 source4/scripting/python/samba/netcmd/gpo.py      |  605 +++++++++++++++++++-
 source4/scripting/python/samba/netcmd/group.py    |   12 +-
 source4/scripting/python/samba/netcmd/newuser.py  |   92 ----
 source4/scripting/python/samba/netcmd/user.py     |  117 ++++-
 source4/scripting/wscript_build                   |    2 +-
 source4/setup/tests/blackbox_group.sh             |    4 +-
 source4/setup/tests/blackbox_newuser.sh           |    4 +-
 source4/setup/tests/blackbox_setpassword.sh       |    2 +-
 testprogs/blackbox/test_export_keytab.sh          |    2 +-
 testprogs/blackbox/test_kinit.sh                  |    6 +-
 testprogs/blackbox/test_ktpass.sh                 |    2 +-
 testprogs/blackbox/test_passwords.sh              |   18 +-
 wintest/test-s4-howto.py                          |   12 +-
 38 files changed, 1387 insertions(+), 419 deletions(-)
 create mode 100644 source4/libcli/pysmb.c
 delete mode 100644 source4/samba_tool/password.c
 create mode 100755 source4/scripting/bin/samba-tool
 delete mode 100644 source4/scripting/python/samba/netcmd/newuser.py


Changeset truncated at 500 lines:

diff --git a/lib/ldb-samba/ldif_handlers.c b/lib/ldb-samba/ldif_handlers.c
index af3c4b4..bb5232a 100644
--- a/lib/ldb-samba/ldif_handlers.c
+++ b/lib/ldb-samba/ldif_handlers.c
@@ -426,6 +426,28 @@ static int ldif_write_ntSecurityDescriptor(struct ldb_context *ldb, void *mem_ct
 	return 0;
 }
 
+/*
+  convert a string formatted SDDL to a ldif formatted ntSecurityDescriptor (SDDL format)
+*/
+static int ldif_write_sddlSecurityDescriptor(struct ldb_context *ldb, void *mem_ctx,
+					   const struct ldb_val *in, struct ldb_val *out)
+{
+	if (ldb_get_flags(ldb) & LDB_FLG_SHOW_BINARY) {
+		struct security_descriptor *sd;
+		const struct dom_sid *sid = samdb_domain_sid(ldb);
+
+		sd = sddl_decode(mem_ctx, (const char *)in->data, sid);
+		out->data = (uint8_t *)ndr_print_struct_string(mem_ctx,
+					(ndr_print_fn_t)ndr_print_security_descriptor,
+					"SDDL", sd);
+		out->length = strlen((const char *)out->data);
+		talloc_free(sd);
+		return 0;
+	}
+
+	return ldb_handler_copy(ldb, mem_ctx, in, out);
+}
+
 /* 
    canonicalise an objectCategory.  We use the short form as the canonical form:
    cn=Person,cn=Schema,cn=Configuration,<basedn> becomes 'person'
@@ -1123,6 +1145,13 @@ static const struct ldb_schema_syntax samba_syntaxes[] = {
 		.comparison_fn	  = ldb_comparison_binary,
 		.operator_fn      = samba_syntax_operator_fn
 	},{
+		.name		  = LDB_SYNTAX_SAMBA_SDDL_SECURITY_DESCRIPTOR,
+		.ldif_read_fn	  = ldb_handler_copy,
+		.ldif_write_fn	  = ldif_write_sddlSecurityDescriptor,
+		.canonicalise_fn  = ldb_handler_fold,
+		.comparison_fn	  = ldb_comparison_fold,
+		.operator_fn      = samba_syntax_operator_fn
+	},{
 		.name		  = LDB_SYNTAX_SAMBA_GUID,
 		.ldif_read_fn	  = ldif_read_objectGUID,
 		.ldif_write_fn	  = ldif_write_objectGUID,
@@ -1297,6 +1326,7 @@ static const struct {
 	{ "rIDAllocationPool",		LDB_SYNTAX_SAMBA_RANGE64 },
 	{ "rIDPreviousAllocationPool",	LDB_SYNTAX_SAMBA_RANGE64 },
 	{ "rIDAvailablePool",		LDB_SYNTAX_SAMBA_RANGE64 },
+	{ "defaultSecurityDescriptor",	LDB_SYNTAX_SAMBA_SDDL_SECURITY_DESCRIPTOR },
 
 	/*
 	 * these are extracted by searching
diff --git a/lib/ldb-samba/ldif_handlers.h b/lib/ldb-samba/ldif_handlers.h
index 62903c4..75ae7bd 100644
--- a/lib/ldb-samba/ldif_handlers.h
+++ b/lib/ldb-samba/ldif_handlers.h
@@ -14,6 +14,7 @@
 #define LDB_SYNTAX_SAMBA_RANGE64		"LDB_SYNTAX_SAMBA_RANGE64"
 #define LDB_SYNTAX_SAMBA_DNSRECORD		"LDB_SYNTAX_SAMBA_DNSRECORD"
 #define LDB_SYNTAX_SAMBA_SUPPLEMENTALCREDENTIALS "LDB_SYNTAX_SAMBA_SUPPLEMENTALCREDENTIALS"
+#define LDB_SYNTAX_SAMBA_SDDL_SECURITY_DESCRIPTOR "LDB_SYNTAX_SAMBA_SDDL"
 #include "lib/ldb-samba/ldif_handlers_proto.h"
 
 #undef _PRINTF_ATTRIBUTE
diff --git a/lib/ldb/include/ldb_handlers.h b/lib/ldb/include/ldb_handlers.h
index 6e71f1f..79d8bb6 100644
--- a/lib/ldb/include/ldb_handlers.h
+++ b/lib/ldb/include/ldb_handlers.h
@@ -30,11 +30,16 @@
  *
  *  Author: Simo Sorce
  */
+#ifndef __LDB_HANDLERS_H__
+#define __LDB_HANDLERS_H__
 
-int ldb_handler_copy(		struct ldb_context *ldb, void *mem_ctx,
-				const struct ldb_val *in, struct ldb_val *out);
-int ldb_comparison_binary(	struct ldb_context *ldb, void *mem_ctx,
-				const struct ldb_val *v1, const struct ldb_val *v2);
-int ldb_comparison_fold(	struct ldb_context *ldb, void *mem_ctx,
-				const struct ldb_val *v1, const struct ldb_val *v2);
+int ldb_handler_copy(struct ldb_context *ldb, void *mem_ctx,
+			const struct ldb_val *in, struct ldb_val *out);
+int ldb_handler_fold(struct ldb_context *ldb, void *mem_ctx,
+			const struct ldb_val *in, struct ldb_val *out);
+int ldb_comparison_binary(struct ldb_context *ldb, void *mem_ctx,
+			const struct ldb_val *v1, const struct ldb_val *v2);
+int ldb_comparison_fold(struct ldb_context *ldb, void *mem_ctx,
+			const struct ldb_val *v1, const struct ldb_val *v2);
 
+#endif /* __LDB_HANDLERS_H__ */
diff --git a/source3/pam_smbpass/wscript_build b/source3/pam_smbpass/wscript_build
index e0a710c..c8010e4 100644
--- a/source3/pam_smbpass/wscript_build
+++ b/source3/pam_smbpass/wscript_build
@@ -6,7 +6,7 @@ if bld.CONFIG_SET('WITH_PAM_MODULES'):
                   pam_smb_passwd.c
                   pam_smb_acct.c
                   support.c''',
-        deps='''tdb talloc pam PAM_ERRORS wbclient cap asn1util param passdb SMBLDAP
+        deps='''tdb talloc pam PAM_ERRORS wbclient cap asn1util param pdb SMBLDAP
                 LIBNTLMSSP LIBTSOCKET''',
         cflags='-DLOCALEDIR=\"%s/locale\"' % bld.env.DATADIR,
         realname='pam_smbpass.so',
diff --git a/source3/passdb/wscript_build b/source3/passdb/wscript_build
index 9451035..6e5dabe 100644
--- a/source3/passdb/wscript_build
+++ b/source3/passdb/wscript_build
@@ -7,7 +7,7 @@ PDB_SMBPASSWD_SRC = 'pdb_smbpasswd.c'
 PDB_WBC_SAM_SRC =   'pdb_wbc_sam.c'
 
 bld.SAMBA3_MODULE('pdb_tdbsam',
-                 subsystem='passdb',
+                 subsystem='pdb',
                  source=PDB_TDBSAM_SRC,
                  deps='samba-util tdb',
                  init_function='',
@@ -15,14 +15,14 @@ bld.SAMBA3_MODULE('pdb_tdbsam',
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('pdb_tdbsam'))
 
 bld.SAMBA3_MODULE('pdb_ldap',
-                 subsystem='passdb',
+                 subsystem='pdb',
                  source=PDB_LDAP_SRC,
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('pdb_ldap'),
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('pdb_ldap') and bld.env.HAVE_LDAP)
 
 bld.SAMBA3_MODULE('pdb_ads',
-                 subsystem='passdb',
+                 subsystem='pdb',
                  source=PDB_ADS_SRC,
                  deps='cli-ldap-common TLDAP',
                  init_function='',
@@ -30,7 +30,7 @@ bld.SAMBA3_MODULE('pdb_ads',
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('pdb_ads'))
 
 bld.SAMBA3_MODULE('pdb_smbpasswd',
-                 subsystem='passdb',
+                 subsystem='pdb',
                  source=PDB_SMBPASSWD_SRC,
                  deps='samba-util',
                  init_function='',
@@ -38,7 +38,7 @@ bld.SAMBA3_MODULE('pdb_smbpasswd',
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('pdb_smbpasswd'))
 
 bld.SAMBA3_MODULE('pdb_wbc_sam',
-                 subsystem='passdb',
+                 subsystem='pdb',
                  source=PDB_WBC_SAM_SRC,
                  deps='samba-util',
                  init_function='',
@@ -46,7 +46,7 @@ bld.SAMBA3_MODULE('pdb_wbc_sam',
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('pdb_wbc_sam'))
 
 bld.SAMBA3_MODULE('pdb_samba4',
-                  subsystem='passdb',
+                  subsystem='pdb',
                   source='pdb_samba4.c',
                   init_function='',
                   deps='IDMAP samdb',
diff --git a/source3/winbindd/wscript_build b/source3/winbindd/wscript_build
index 3bd14ee..3a2e297 100644
--- a/source3/winbindd/wscript_build
+++ b/source3/winbindd/wscript_build
@@ -62,7 +62,7 @@ bld.SAMBA3_MODULE('idmap_rid',
 bld.SAMBA3_MODULE('idmap_passdb',
                  subsystem='idmap',
                  source=IDMAP_PASSDB_SRC,
-                 deps='samba-util passdb',
+                 deps='samba-util pdb',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_passdb'),
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_passdb'))
diff --git a/source3/wscript_build b/source3/wscript_build
index 50b21e9..3fcd605 100755
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -660,7 +660,7 @@ if not bld.env.toplevel_build:
 bld.SAMBA3_LIBRARY('netapi',
                     source=LIBNETAPI_SRC,
                     public_deps='''talloc tdb_compat cap wbclient smbd_shim libsmb KRBCLIENT
-                    passdb SMBLDAP param samba-util
+                    pdb SMBLDAP param samba-util
                     LIBMSRPC_GEN msrpc3 ads LIBNET DCUTIL NDR_LIBNETAPI
                     RPC_CLIENT_SCHANNEL smbconf REG_SMBCONF TOKEN_UTIL
                     LIBCLI_SAMR libcli_lsa3 LIBRPCCLI_NETLOGON
@@ -672,7 +672,7 @@ bld.SAMBA3_LIBRARY('netapi',
 
 bld.SAMBA3_LIBRARY('libsmb/smbclient',
                     source=LIBSMBCLIENT_SRC,
-                    public_deps='''talloc tdb_compat wbclient cap param  smbd_shim libsmb KRBCLIENT passdb SMBLDAP
+                    public_deps='''talloc tdb_compat wbclient cap param  smbd_shim libsmb KRBCLIENT pdb SMBLDAP
                     LIBMSRPC_GEN msrpc3 libcli_lsa3 RPC_NDR_SRVSVC popt_samba3''',
                     public_headers='include/libsmbclient.h',
                     vnum='0',
@@ -725,7 +725,7 @@ bld.SAMBA3_SUBSYSTEM('TLDAP',
                     source=TLDAP_SRC,
                     deps='asn1util LIBTSOCKET')
 
-bld.SAMBA3_LIBRARY('passdb',
+bld.SAMBA3_LIBRARY('pdb',
                    source=PASSDB_SRC,
                    deps='SECRETS3 SMBLDAP GROUPDB wbclient LIBCLI_AUTH flag_mapping',
                    private_library=True,
@@ -810,7 +810,7 @@ bld.SAMBA3_LIBRARY('smbd_shim',
 
 bld.SAMBA3_SUBSYSTEM('LIBSMB_ERR',
                     source='',
-                    deps='errors3 passdb ldap lber MSRPC_PARSE LIBCLI_AUTH rpccommon',
+                    deps='errors3 pdb ldap lber MSRPC_PARSE LIBCLI_AUTH rpccommon',
                     vars=locals())
 
 bld.SAMBA3_SUBSYSTEM('LIBNTLMSSP',
@@ -836,7 +836,7 @@ bld.SAMBA3_SUBSYSTEM('CLDAP',
 
 bld.SAMBA3_SUBSYSTEM('SECRETS3',
                    source=SECRETS_SRC,
-                   deps='NDR_SECRETS param samba3core passdb',
+                   deps='NDR_SECRETS param samba3core pdb',
                    vars=locals())
 
 bld.SAMBA3_SUBSYSTEM('SMBLDAP',
@@ -886,7 +886,7 @@ bld.SAMBA3_LIBRARY('smbd_conn',
 bld.SAMBA3_LIBRARY('smbd_base',
                     source=SMBD_SRC_BASE,
                     deps='''tdb_compat tevent dl krb5 ldap gssapi gssapi_krb5
-                    samba-util wbclient crypt nsl cups cap z passdb
+                    samba-util wbclient crypt nsl cups cap z pdb
                     param samba3core libsmb popt_samba3 KRBCLIENT AVAHI
                     LIBMSRPC_GEN msrpc3 ads LIBADS_SERVER LIBADS_PRINTER
                     vfs vfs_default vfs_posixacl auth rpc LOCKING LIBAFS LIBAFS_SETTOKEN PROFILE
@@ -1110,7 +1110,7 @@ bld.SAMBA3_BINARY('smbd/smbd',
 bld.SAMBA3_BINARY('nmbd/nmbd',
                  source=NMBD_SRC,
                  deps='''talloc tdb_compat tevent z cap wbclient dl
-                 passdb param ldap smbd_shim libsmb
+                 pdb param ldap smbd_shim libsmb
                  popt_samba3 KRBCLIENT NDR_SAMR NDR_LSA PROFILE''',
                  install_path='${SBINDIR}',
                  vars=locals())
@@ -1118,7 +1118,7 @@ bld.SAMBA3_BINARY('nmbd/nmbd',
 bld.SAMBA3_BINARY('winbindd/winbindd',
                  source=WINBINDD_SRC,
                  deps='''talloc tdb_compat tevent cap dl z
-                 wbclient passdb ldap param smbd_shim libsmb
+                 wbclient pdb ldap param smbd_shim libsmb
                  popt_samba3 KRBCLIENT LIBMSRPC_GEN msrpc3 ads LIBADS_SERVER
                  SRV_NDR_WBINT RPC_NDR_WBINT NDR_WBINT LIBAFS
                  LIBAFS_SETTOKEN PROFILE SLCACHE DCUTIL idmap nss_info
@@ -1135,7 +1135,7 @@ bld.SAMBA3_BINARY('winbindd/winbindd',
 bld.SAMBA3_BINARY('web/swat',
                  source=SWAT_SRC,
                  deps='''talloc tevent cap samba3core libsmb wbclient param
-                 smbd_shim passdb popt_samba3 KRBCLIENT cups
+                 smbd_shim pdb popt_samba3 KRBCLIENT cups
                  LIBMSRPC_GEN msrpc3 LOCKING PLAINTEXT_AUTH PRINTBASE PRINTING FNAME_UTIL
                  LIBCLI_SAMR INIT_LSA PASSCHANGE''',
                  enabled=bld.env.build_swat,
@@ -1144,7 +1144,7 @@ bld.SAMBA3_BINARY('web/swat',
 
 bld.SAMBA3_BINARY('rpcclient/rpcclient',
                  source=RPCCLIENT_SRC,
-                 deps='''talloc tdb_compat cap popt_samba3 passdb libsmb smbd_shim
+                 deps='''talloc tdb_compat cap popt_samba3 pdb libsmb smbd_shim
                  param wbclient param KRBCLIENT LIBMSRPC_GEN msrpc3
                  ads SMBREADLINE DCUTIL RPC_NDR_WINREG RPC_NDR_ECHO
                  RPC_CLIENT_SCHANNEL
@@ -1157,7 +1157,7 @@ bld.SAMBA3_BINARY('rpcclient/rpcclient',
 
 bld.SAMBA3_BINARY('client/smbclient' + bld.env.suffix3,
                  source=CLIENT_SRC,
-                 deps='''talloc tdb_compat cap popt_samba3 passdb libsmb smbd_shim
+                 deps='''talloc tdb_compat cap popt_samba3 pdb libsmb smbd_shim
                  param wbclient param KRBCLIENT LIBMSRPC_GEN
                  msrpc3 SMBREADLINE libsmb/smbclient RPC_NDR_SRVSVC INIT_LSA
                  cli_smb_common''',
@@ -1165,7 +1165,7 @@ bld.SAMBA3_BINARY('client/smbclient' + bld.env.suffix3,
 
 bld.SAMBA3_BINARY('net',
                  source=NET_SRC,
-                 deps='''talloc tdb_compat netapi addns cap intl popt_samba3 passdb libsmb smbd_shim
+                 deps='''talloc tdb_compat netapi addns cap intl popt_samba3 pdb libsmb smbd_shim
                  param wbclient param KRBCLIENT LIBMSRPC_GEN msrpc3 LIBGPO ads LIBADS_SERVER LIBADS_PRINTER
                  LIBAFS LIBAFS_SETTOKEN SMBREADLINE PASSWD_UTIL LIBNET
                  LIBNET_DSSYNC LIBNET_SAMSYNC LIBEVENTLOG DCUTIL
@@ -1192,7 +1192,7 @@ bld.SAMBA3_BINARY('smbspool',
 bld.SAMBA3_BINARY('testparm',
                  source=TESTPARM_SRC,
                  deps='''talloc tevent ldap cap 
-                 wbclient asn1util LIBTSOCKET passdb param smbd_shim
+                 wbclient asn1util LIBTSOCKET pdb param smbd_shim
                  LIBSMB_ERR popt_samba3''',
                  vars=locals())
 
@@ -1216,21 +1216,21 @@ bld.SAMBA3_BINARY('smbcontrol',
 bld.SAMBA3_BINARY('smbtree',
                  source=SMBTREE_SRC,
                  deps='''talloc tdb_compat tevent cap wbclient param smbd_shim
-                 libsmb LIBSMB_ERR popt_samba3 KRBCLIENT passdb SMBLDAP LIBMSRPC_GEN msrpc3 PROFILE
+                 libsmb LIBSMB_ERR popt_samba3 KRBCLIENT pdb SMBLDAP LIBMSRPC_GEN msrpc3 PROFILE
                  RPC_NDR_SRVSVC''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('smbpasswd',
                  source=SMBPASSWD_SRC,
                  deps='''talloc tdb_compat tevent cap wbclient param smbd_shim
-                 libsmb LIBSMB_ERR popt_samba3 KRBCLIENT passdb SMBLDAP LIBMSRPC_GEN msrpc3 PASSWD_UTIL
+                 libsmb LIBSMB_ERR popt_samba3 KRBCLIENT pdb SMBLDAP LIBMSRPC_GEN msrpc3 PASSWD_UTIL
                  LIBCLI_SAMR INIT_LSA PASSCHANGE''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('pdbedit',
                  source=PDBEDIT_SRC,
                  deps='''talloc tdb_compat tevent cap wbclient param smbd_shim
-                 LIBNTLMSSP LIBSMB_ERR popt_samba3 passdb SMBLDAP
+                 LIBNTLMSSP LIBSMB_ERR popt_samba3 pdb SMBLDAP
                  PASSWD_UTIL cli-ldap-common''',
                  vars=locals())
 
@@ -1274,21 +1274,21 @@ bld.SAMBA3_BINARY('msgtest',
 bld.SAMBA3_BINARY('smbcacls',
                  source=SMBCACLS_SRC,
                  deps='''talloc tdb_compat cap wbclient param libsmb KRBCLIENT
-                 smbd_shim passdb popt_samba3 SMBLDAP LIBMSRPC_GEN
+                 smbd_shim pdb popt_samba3 SMBLDAP LIBMSRPC_GEN
                  msrpc3 libcli_lsa3''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('smbcquotas',
                  source=SMBCQUOTAS_SRC,
                  deps='''talloc tdb_compat cap wbclient param  smbd_shim libsmb KRBCLIENT
-                 popt_samba3 passdb SMBLDAP LIBMSRPC_GEN msrpc3
+                 popt_samba3 pdb SMBLDAP LIBMSRPC_GEN msrpc3
                  libcli_lsa3''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('eventlogadm',
                  source=EVTLOGADM_SRC,
                  deps='''talloc tevent cap popt_samba3 samba3core param
-                 smbd_shim LIBSMB_ERR passdb wbclient LIBEVENTLOG''',
+                 smbd_shim LIBSMB_ERR pdb wbclient LIBEVENTLOG''',
                  vars=locals())
 
 bld.SAMBA3_BINARY('sharesec',
@@ -1304,7 +1304,7 @@ bld.SAMBA3_BINARY('locktest' + bld.env.suffix3,
 
 bld.SAMBA3_BINARY('pdbtest',
                  source=PDBTEST_SRC,
-                 deps='''talloc tdb_compat cap wbclient param libsmb KRBCLIENT smbd_shim passdb
+                 deps='''talloc tdb_compat cap wbclient param libsmb KRBCLIENT smbd_shim pdb
                  SMBLDAP popt_samba3 NDR_SAMR NDR_LSA''',
                  vars=locals())
 
@@ -1348,7 +1348,7 @@ bld.SAMBA3_BINARY('versiontest',
 bld.SAMBA3_BINARY('wbinfo' + bld.env.suffix3,
                  source=WBINFO_SRC,
                  deps='''talloc wbclient tevent cap
-                 asn1util LIBTSOCKET passdb ldap param smbd_shim
+                 asn1util LIBTSOCKET pdb ldap param smbd_shim
                  LIBNTLMSSP popt_samba3 LIBAFS_SETTOKEN''',
                  vars=locals())
 
@@ -1356,7 +1356,7 @@ bld.SAMBA3_BINARY('ntlm_auth' + bld.env.suffix3,
                  source=NTLM_AUTH_SRC,
                  deps='''tdb_compat talloc cap KRB5_WRAP k5crypto wbclient param smbd_shim
                  samba3core LIBNTLMSSP popt_samba3 asn1util LIBTSOCKET
-                 passdb SMBLDAP winbind-client LIBINIPARSER LIBADS_SERVER
+                 pdb SMBLDAP winbind-client LIBINIPARSER LIBADS_SERVER
                  NDR_SAMR NDR_LSA NDR_NETLOGON cli-ldap-common LIBNMB SLCACHE SPNEGO_PARSE KRBCLIENT''',
                  vars=locals())
 
diff --git a/source4/auth/credentials/pycredentials.c b/source4/auth/credentials/pycredentials.c
index 909d897..5083174 100644
--- a/source4/auth/credentials/pycredentials.c
+++ b/source4/auth/credentials/pycredentials.c
@@ -420,7 +420,7 @@ static PyMethodDef py_creds_methods[] = {
 };
 
 PyTypeObject PyCredentials = {
-	.tp_name = "Credentials",
+	.tp_name = "credentials.Credentials",
 	.tp_basicsize = sizeof(py_talloc_Object),
 	.tp_new = py_creds_new,
 	.tp_flags = Py_TPFLAGS_DEFAULT,
@@ -429,7 +429,7 @@ PyTypeObject PyCredentials = {
 
 
 PyTypeObject PyCredentialCacheContainer = {
-	.tp_name = "CredentialCacheContainer",
+	.tp_name = "credentials.CredentialCacheContainer",
 	.tp_basicsize = sizeof(py_talloc_Object),
 	.tp_flags = Py_TPFLAGS_DEFAULT,
 };
diff --git a/source4/auth/gensec/pygensec.c b/source4/auth/gensec/pygensec.c
index 503974a..1028365 100644
--- a/source4/auth/gensec/pygensec.c
+++ b/source4/auth/gensec/pygensec.c
@@ -498,7 +498,7 @@ static PyMethodDef py_gensec_security_methods[] = {
 };
 
 static PyTypeObject Py_Security = {
-	.tp_name = "Security",
+	.tp_name = "gensec.Security",
 	.tp_flags = Py_TPFLAGS_DEFAULT,
 	.tp_methods = py_gensec_security_methods,
 	.tp_basicsize = sizeof(py_talloc_Object),
diff --git a/source4/auth/pyauth.c b/source4/auth/pyauth.c
index 6b39489..201a830 100644
--- a/source4/auth/pyauth.c
+++ b/source4/auth/pyauth.c
@@ -301,7 +301,6 @@ static PyTypeObject PyAuthContext = {
 	.tp_basicsize = sizeof(py_talloc_Object),
 	.tp_flags = Py_TPFLAGS_DEFAULT,
 	.tp_new = py_auth_context_new,
-	.tp_basicsize = sizeof(py_talloc_Object),
 };
 
 static PyMethodDef py_auth_methods[] = {
diff --git a/source4/libcli/pysmb.c b/source4/libcli/pysmb.c
new file mode 100644
index 0000000..52d0b10
--- /dev/null
+++ b/source4/libcli/pysmb.c
@@ -0,0 +1,418 @@
+/*
+   Unix SMB/CIFS implementation.
+
+   Copyright (C) Amitay Isaacs 2011
+
+   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
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <Python.h>
+#include <tevent.h>
+#include <pytalloc.h>
+#include "includes.h"
+#include "param/param.h"
+#include "param/pyparam.h"
+#include "system/dir.h"
+#include "lib/events/events.h"
+#include "auth/credentials/credentials.h"
+#include "auth/credentials/pycredentials.h"
+#include "auth/gensec/gensec.h"
+#include "libcli/libcli.h"
+#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
+#include "libcli/resolve/resolve.h"
+#include "libcli/util/pyerrors.h"
+#include "libcli/smb_composite/smb_composite.h"
+#include "libcli/security/security_descriptor.h"
+#include "librpc/rpc/pyrpc_util.h"
+
+#ifndef Py_RETURN_NONE
+#define Py_RETURN_NONE	return Py_INCREF(Py_None), Py_None
+#endif
+
+staticforward PyTypeObject PySMB;
+
+void initsmb(void);
+
+struct smb_private_data {
+	struct loadparm_context *lp_ctx;
+	struct cli_credentials *creds;
+	struct tevent_context *ev_ctx;
+	struct smbcli_tree *tree;
+};
+
+
+static void dos_format(char *s)
+{
+	string_replace(s, '/', '\\');
+}
+
+
+/*
+ * Connect to SMB share using smb_composite_connect
+ */
+static NTSTATUS do_smb_connect(TALLOC_CTX *mem_ctx, struct smb_private_data *spdata,
+			const char *hostname, const char *service, struct smbcli_tree **tree)
+{
+	struct smb_composite_connect io;
+	NTSTATUS status;
+
+	gensec_init();
+


-- 
Samba Shared Repository


More information about the samba-cvs mailing list