[SCM] Samba Shared Repository - branch master updated

Andrew Tridgell tridge at samba.org
Tue Apr 20 05:22:17 MDT 2010


The branch, master has been updated
       via  ac11b61... s4-net: don't show a full python exception when you can't open sam.ldb
       via  9b66b7a... s4-net: show a list of commands when someone runs "net" with no arguments
       via  1f7da85... s4-python: added PYTHONDIR to python search path
       via  6072ab0... s4-dynconfig: added dyn_PYTHONDIR
      from  58549ab... s3-spoolss: fix winreg spoolss helper call documentation.

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


- Log -----------------------------------------------------------------
commit ac11b616dd67847be4f54f6fc08b64bacc0802f4
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Apr 20 20:30:41 2010 +1000

    s4-net: don't show a full python exception when you can't open sam.ldb

commit 9b66b7abcc828d864d2049133f2f0a5b41994ddd
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Apr 20 20:27:41 2010 +1000

    s4-net: show a list of commands when someone runs "net" with no arguments

commit 1f7da85c77f47b28a971374f42a1668a92398eb4
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Apr 20 20:24:08 2010 +1000

    s4-python: added PYTHONDIR to python search path
    
    we put it after the scripting/python dir, so we look in the build
    directory (if applicable) first.

commit 6072ab0d57487fcb9b00706b37898be003ff211b
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Apr 20 20:23:04 2010 +1000

    s4-dynconfig: added dyn_PYTHONDIR

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

Summary of changes:
 source4/dynconfig/dynconfig.c                    |    4 ++++
 source4/dynconfig/dynconfig.h                    |    1 +
 source4/dynconfig/wscript                        |    1 +
 source4/scripting/python/modules.c               |    5 +++++
 source4/scripting/python/samba/netcmd/newuser.py |    4 ++--
 source4/utils/net/net.c                          |    2 +-
 6 files changed, 14 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dynconfig/dynconfig.c b/source4/dynconfig/dynconfig.c
index 3edf2bb..d515bf7 100644
--- a/source4/dynconfig/dynconfig.c
+++ b/source4/dynconfig/dynconfig.c
@@ -90,3 +90,7 @@ _PUBLIC_ const char *dyn_WINBINDD_PRIVILEGED_SOCKET_DIR = WINBINDD_PRIVILEGED_SO
 
 /** Where to find the NTP signing daemon socket */
 _PUBLIC_ const char *dyn_NTP_SIGND_SOCKET_DIR = NTP_SIGND_SOCKET_DIR;
+
+/** Where to find python modules */
+_PUBLIC_ const char *dyn_PYTHONDIR = PYTHONDIR;
+
diff --git a/source4/dynconfig/dynconfig.h b/source4/dynconfig/dynconfig.h
index c8d2766..48f8ab6 100644
--- a/source4/dynconfig/dynconfig.h
+++ b/source4/dynconfig/dynconfig.h
@@ -41,3 +41,4 @@ extern const char *dyn_SETUPDIR;
 extern const char *dyn_WINBINDD_SOCKET_DIR;
 extern const char *dyn_WINBINDD_PRIVILEGED_SOCKET_DIR;
 extern const char *dyn_NTP_SIGND_SOCKET_DIR;
+extern const char *dyn_PYTHONDIR;
diff --git a/source4/dynconfig/wscript b/source4/dynconfig/wscript
index cd80647..e87ada1 100644
--- a/source4/dynconfig/wscript
+++ b/source4/dynconfig/wscript
@@ -34,6 +34,7 @@ dyn_cflags = {
     'WINBINDD_SOCKET_DIR'            : '${WINBINDD_SOCKET_DIR}',
     'NTP_SIGND_SOCKET_DIR'           : '${NTP_SIGND_SOCKET_DIR}',
     'PKGCONFIGDIR'                   : '${LIBDIR}/pkgconfig',
+    'PYTHONDIR'                      : '${PYTHONDIR}',
     }
 
 # changes for when FHS is enabled
diff --git a/source4/scripting/python/modules.c b/source4/scripting/python/modules.c
index 198b3cc..788df91 100644
--- a/source4/scripting/python/modules.c
+++ b/source4/scripting/python/modules.c
@@ -20,6 +20,7 @@
 #include <Python.h>
 #include "includes.h"
 #include "scripting/python/modules.h"
+#include "dynconfig/dynconfig.h"
 
 extern void init_ldb(void);
 extern void init_security(void);
@@ -89,6 +90,10 @@ bool py_update_path(const char *bindir)
 		return false;
 	}
 
+	if (!PySys_PathPrepend(py_path, dyn_PYTHONDIR)) {
+		return false;
+	}
+
 	asprintf(&newpath, "%s/../scripting/python", bindir);
 	if (!PySys_PathPrepend(py_path, newpath)) {
 		free(newpath);
diff --git a/source4/scripting/python/samba/netcmd/newuser.py b/source4/scripting/python/samba/netcmd/newuser.py
index f3babfe..64b6d17 100644
--- a/source4/scripting/python/samba/netcmd/newuser.py
+++ b/source4/scripting/python/samba/netcmd/newuser.py
@@ -60,9 +60,9 @@ class cmd_newuser(Command):
         lp = sambaopts.get_loadparm()
         creds = credopts.get_credentials(lp)
 
-        samdb = SamDB(url=H, session_info=system_session(), credentials=creds,
-            lp=lp)
         try:
+            samdb = SamDB(url=H, session_info=system_session(), credentials=creds,
+                          lp=lp)
             samdb.newuser(username, unixname, password,
                           force_password_change_at_next_login_req=must_change_at_next_login)
         except ldb.LdbError, (num, msg):
diff --git a/source4/utils/net/net.c b/source4/utils/net/net.c
index 56f7c77..0354131 100644
--- a/source4/utils/net/net.c
+++ b/source4/utils/net/net.c
@@ -273,7 +273,7 @@ static int net_usage(struct net_context *ctx, int argc, const char **argv)
 {
 	d_printf("Usage:\n");
 	d_printf("net <command> [options]\n");
-	d_printf("Type 'net help' for all available commands\n");
+	net_help(ctx, net_functable);
 	return 0;
 }
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list