[SCM] Samba Shared Repository - branch master updated

Andrew Tridgell tridge at samba.org
Fri Jun 17 00:38:02 MDT 2011


The branch, master has been updated
       via  d2bc45e build: only use the git version on install, not in the build tree
       via  0b3b7e3 samba-tool: exit with non-zero status on dbcheck failure
       via  b07e493 talloc: added talloc_stackframe_exists()
       via  e080ae0 s4-auth: quiet down the krb5 warnings when kerberos is not set to 'MUST'
       via  705ed1c samba-tool: show success message on group operations
      from  0c3075c s4-pysamdb: fixed the normalisation of grouptype in group add

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


- Log -----------------------------------------------------------------
commit d2bc45e7ffb4e8d47878a6fc53c5f5c90dfd2114
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jun 17 15:21:39 2011 +1000

    build: only use the git version on install, not in the build tree
    
    having the git version in our version.h in the build tree is annoying
    for developers, as every time you commit or rebase you need to spend
    several minutes re-linking. This changes it to use the git version
    only on install, which is much more useful as when you actually
    install the binaries you may be using them in a way that reporting the
    version is useful
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User: Andrew Tridgell <tridge at samba.org>
    Autobuild-Date: Fri Jun 17 08:37:06 CEST 2011 on sn-devel-104

commit 0b3b7e3797a9aa0dc8f0922c8cd873b0f0b3231e
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jun 17 14:40:48 2011 +1000

    samba-tool: exit with non-zero status on dbcheck failure
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit b07e4933b7ed4b2452cfdd9d223eecb8c0b74fec
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jun 17 14:22:28 2011 +1000

    talloc: added talloc_stackframe_exists()
    
    This can be used to tell if a talloc stackframe is currently
    available. Callers can use this to decide if they will use
    talloc_tos() or instead use an alternative strategy. This gives us a
    way to safely have calls to talloc_tos() in common code that may end
    up in external libraries, as long as all talloc_tos() calls in these
    pieces of common code check first that a stackframe is available.

commit e080ae0faa2556825189f82fa61a7ff5f249dbc5
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jun 17 13:47:14 2011 +1000

    s4-auth: quiet down the krb5 warnings when kerberos is not set to 'MUST'
    
    this prevents spurious error messages on client commands when when we
    will fallback to NTLM authentication
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>

commit 705ed1c4921a1456ebcf80ac352567679ab7dfa9
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Jun 17 13:35:52 2011 +1000

    samba-tool: show success message on group operations

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

Summary of changes:
 buildtools/wafsamba/samba_patterns.py            |    3 ++-
 buildtools/wafsamba/samba_version.py             |   15 +++++++++------
 lib/util/talloc_stack.c                          |   17 +++++++++++++++++
 lib/util/talloc_stack.h                          |    8 ++++++++
 source4/auth/credentials/credentials_krb5.c      |    6 +++++-
 source4/auth/gensec/gensec.c                     |    2 +-
 source4/scripting/python/samba/netcmd/dbcheck.py |    4 +++-
 source4/scripting/python/samba/netcmd/group.py   |    4 ++++
 wscript                                          |    2 +-
 wscript_build                                    |    2 +-
 10 files changed, 51 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_patterns.py b/buildtools/wafsamba/samba_patterns.py
index 37ef419..f064608 100644
--- a/buildtools/wafsamba/samba_patterns.py
+++ b/buildtools/wafsamba/samba_patterns.py
@@ -10,7 +10,7 @@ def write_version_header(task):
     src = task.inputs[0].srcpath(task.env)
     tgt = task.outputs[0].bldpath(task.env)
 
-    version = samba_version_file(src, task.env.srcdir, env=task.env)
+    version = samba_version_file(src, task.env.srcdir, env=task.env, is_install=task.env.is_install)
     string = str(version)
 
     f = open(tgt, 'w')
@@ -26,4 +26,5 @@ def SAMBA_MKVERSION(bld, target):
                             source= 'VERSION',
                             target=target,
                             always=True)
+    t.env.is_install = bld.is_install
 Build.BuildContext.SAMBA_MKVERSION = SAMBA_MKVERSION
diff --git a/buildtools/wafsamba/samba_version.py b/buildtools/wafsamba/samba_version.py
index 0b0c159..0c39ed4 100644
--- a/buildtools/wafsamba/samba_version.py
+++ b/buildtools/wafsamba/samba_version.py
@@ -90,7 +90,7 @@ def git_version_summary(path, env=None):
 
 class SambaVersion(object):
 
-    def __init__(self, version_dict, path, env=None):
+    def __init__(self, version_dict, path, env=None, is_install=True):
         '''Determine the version number of samba
 
 See VERSION for the format.  Entries on that file are 
@@ -152,7 +152,10 @@ also accepted as dictionary entries here
             SAMBA_VERSION_STRING += ("rc%u" % self.RC_RELEASE)
 
         if self.IS_SNAPSHOT:
-            if os.path.exists(os.path.join(path, ".git")):
+            if not is_install:
+                suffix = "DEVELOPERBUILD"
+                self.vcs_fields = {}
+            elif os.path.exists(os.path.join(path, ".git")):
                 suffix, self.vcs_fields = git_version_summary(path, env=env)
             elif os.path.exists(os.path.join(path, ".bzr")):
                 suffix, self.vcs_fields = bzr_version_summary(path)
@@ -234,7 +237,7 @@ also accepted as dictionary entries here
         return string
 
 
-def samba_version_file(version_file, path, env=None):
+def samba_version_file(version_file, path, env=None, is_install=True):
     '''Parse the version information from a VERSION file'''
 
     f = open(version_file, 'r')
@@ -254,16 +257,16 @@ def samba_version_file(version_file, path, env=None):
             print("Failed to parse line %s from %s" % (line, version_file))
             raise
 
-    return SambaVersion(version_dict, path, env=env)
+    return SambaVersion(version_dict, path, env=env, is_install=is_install)
 
 
 
-def load_version(env=None):
+def load_version(env=None, is_install=True):
     '''load samba versions either from ./VERSION or git
     return a version object for detailed breakdown'''
     if not env:
         env = samba_utils.LOAD_ENVIRONMENT()
 
-    version = samba_version_file("./VERSION", ".", env)
+    version = samba_version_file("./VERSION", ".", env, is_install=is_install)
     Utils.g_module.VERSION = version.STRING
     return version
diff --git a/lib/util/talloc_stack.c b/lib/util/talloc_stack.c
index 8e559cc..16e9d74 100644
--- a/lib/util/talloc_stack.c
+++ b/lib/util/talloc_stack.c
@@ -188,3 +188,20 @@ TALLOC_CTX *talloc_tos(void)
 
 	return ts->talloc_stack[ts->talloc_stacksize-1];
 }
+
+/*
+ * return true if a talloc stackframe exists
+ * this can be used to prevent memory leaks for code that can
+ * optionally use a talloc stackframe (eg. nt_errstr())
+ */
+
+bool talloc_stackframe_exists(void)
+{
+	struct talloc_stackframe *ts =
+		(struct talloc_stackframe *)SMB_THREAD_GET_TLS(global_ts);
+
+	if (ts == NULL || ts->talloc_stacksize == 0) {
+		return false;
+	}
+	return true;
+}
diff --git a/lib/util/talloc_stack.h b/lib/util/talloc_stack.h
index 0e8fab3..ec0c1c6 100644
--- a/lib/util/talloc_stack.h
+++ b/lib/util/talloc_stack.h
@@ -53,4 +53,12 @@ TALLOC_CTX *talloc_stackframe_pool(size_t poolsize);
 
 TALLOC_CTX *talloc_tos(void);
 
+/*
+ * return true if a talloc stackframe exists
+ * this can be used to prevent memory leaks for code that can
+ * optionally use a talloc stackframe (eg. nt_errstr())
+ */
+
+bool talloc_stackframe_exists(void);
+
 #endif
diff --git a/source4/auth/credentials/credentials_krb5.c b/source4/auth/credentials/credentials_krb5.c
index 26fa809..6670f43 100644
--- a/source4/auth/credentials/credentials_krb5.c
+++ b/source4/auth/credentials/credentials_krb5.c
@@ -482,7 +482,11 @@ _PUBLIC_ int cli_credentials_get_client_gss_creds(struct cli_credentials *cred,
 	ret = cli_credentials_get_ccache(cred, event_ctx, lp_ctx,
 					 &ccache, error_string);
 	if (ret) {
-		DEBUG(1, ("Failed to get CCACHE for GSSAPI client: %s\n", error_message(ret)));
+		if (cli_credentials_get_kerberos_state(cred) == CRED_MUST_USE_KERBEROS) {
+			DEBUG(1, ("Failed to get kerberos credentials (kerberos required): %s\n", error_message(ret)));
+		} else {
+			DEBUG(4, ("Failed to get kerberos credentials: %s\n", error_message(ret)));
+		}
 		return ret;
 	}
 
diff --git a/source4/auth/gensec/gensec.c b/source4/auth/gensec/gensec.c
index b91e790..7e6a83d 100644
--- a/source4/auth/gensec/gensec.c
+++ b/source4/auth/gensec/gensec.c
@@ -639,7 +639,7 @@ static NTSTATUS gensec_start_mech(struct gensec_security *gensec_security)
 		if (gensec_security->ops->client_start) {
 			status = gensec_security->ops->client_start(gensec_security);
 			if (!NT_STATUS_IS_OK(status)) {
-				DEBUG(2, ("Failed to start GENSEC client mech %s: %s\n",
+				DEBUG(gensec_security->subcontext?4:2, ("Failed to start GENSEC client mech %s: %s\n",
 					  gensec_security->ops->name, nt_errstr(status))); 
 			}
 			return status;
diff --git a/source4/scripting/python/samba/netcmd/dbcheck.py b/source4/scripting/python/samba/netcmd/dbcheck.py
index 9f12136..b0d77f2 100644
--- a/source4/scripting/python/samba/netcmd/dbcheck.py
+++ b/source4/scripting/python/samba/netcmd/dbcheck.py
@@ -18,7 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-import samba, ldb
+import samba, ldb, sys
 import samba.getopt as options
 from samba.auth import system_session
 from samba.samdb import SamDB
@@ -178,3 +178,5 @@ class cmd_dbcheck(Command):
         if error_count != 0 and not self.fix:
             print("Please use --fix to fix these errors")
         print('Checked %u objects (%u errors)' % (len(res), error_count))
+        if error_count != 0:
+            sys.exit(1)
diff --git a/source4/scripting/python/samba/netcmd/group.py b/source4/scripting/python/samba/netcmd/group.py
index 620a7be..95db21a 100644
--- a/source4/scripting/python/samba/netcmd/group.py
+++ b/source4/scripting/python/samba/netcmd/group.py
@@ -85,6 +85,7 @@ class cmd_group_add(Command):
                           description=description, mailaddress=mail_address, notes=notes)
         except Exception, e:
             raise CommandError('Failed to create group "%s"' % groupname, e)
+        print("Added group %s" % groupname)
 
 
 class cmd_group_delete(Command):
@@ -115,6 +116,7 @@ class cmd_group_delete(Command):
             samdb.deletegroup(groupname)
         except Exception, e:
             raise CommandError('Failed to remove group "%s"' % groupname, e)
+        print("Deleted group %s" % groupname)
 
 
 class cmd_group_add_members(Command):
@@ -146,6 +148,7 @@ class cmd_group_add_members(Command):
             samdb.add_remove_group_members(groupname, listofmembers, add_members_operation=True)
         except Exception, e:
             raise CommandError('Failed to add members "%s" to group "%s"' % (listofmembers, groupname), e)
+        print("Added members to group %s" % groupname)
 
 
 class cmd_group_remove_members(Command):
@@ -177,6 +180,7 @@ class cmd_group_remove_members(Command):
             samdb.add_remove_group_members(groupname, listofmembers, add_members_operation=False)
         except Exception, e:
             raise CommandError('Failed to remove members "%s" from group "%s"' % (listofmembers, groupname), e)
+        print("Removed members from group %s" % groupname)
 
 
 class cmd_group(SuperCommand):
diff --git a/wscript b/wscript
index 92c2594..8e1e9a6 100755
--- a/wscript
+++ b/wscript
@@ -157,7 +157,7 @@ def ctags(ctx):
 # of commands in --help
 def build(bld):
     '''build all targets'''
-    samba_version.load_version(env=bld.env)
+    samba_version.load_version(env=bld.env, is_install=bld.is_install)
     pass
 
 
diff --git a/wscript_build b/wscript_build
index 43e69a5..2043757 100644
--- a/wscript_build
+++ b/wscript_build
@@ -27,7 +27,7 @@ bld.env.public_headers_skip = ['param/param_proto.h', 'lib/ldb_compat.h']
 # force headers to use SAMBA4 rules
 bld.env.public_headers_replace = { '#if _SAMBA_BUILD_ == 4' : '#if 1 /* _SAMBA_BUILD_ == 4 */' }
 
-samba_version.load_version(bld.env)
+samba_version.load_version(bld.env, is_install=bld.is_install)
 bld.SAMBA_MKVERSION('version.h')
 
 # bld.ENABLE_MAGIC_ORDERING()


-- 
Samba Shared Repository


More information about the samba-cvs mailing list