[SCM] Samba Shared Repository - branch master updated

Kamen Mazdrashki kamenim at samba.org
Tue Jul 8 08:52:05 MDT 2014


The branch, master has been updated
       via  caa42ed s4-auth-krb: Fix talloc access after free in smb_krb5_update_keytab
      from  bf7f2b0 ctdb-tests: Do not run ip command if running against local daemons

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


- Log -----------------------------------------------------------------
commit caa42ed385dc174d9529407d128424c37cff8e9c
Author: Samuel Cabrero <scabrero at zentyal.com>
Date:   Thu Jun 12 10:39:02 2014 +0200

    s4-auth-krb: Fix talloc access after free in smb_krb5_update_keytab
    
    Change-Id: Iaa168d520f124e0c43c7edd649318f0b8ee25020
    Signed-off-by: Samuel Cabrero <scabrero at zentyal.com>
    Reviewed-by: Kamen Mazdrashki <kamenim at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Kamen Mazdrashki <kamenim at samba.org>
    Autobuild-Date(master): Tue Jul  8 16:51:09 CEST 2014 on sn-devel-104

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

Summary of changes:
 source4/auth/kerberos/srv_keytab.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/auth/kerberos/srv_keytab.c b/source4/auth/kerberos/srv_keytab.c
index 1fc8b4c..bd42316 100644
--- a/source4/auth/kerberos/srv_keytab.c
+++ b/source4/auth/kerberos/srv_keytab.c
@@ -277,7 +277,8 @@ static krb5_error_code create_keytab(TALLOC_CTX *parent_ctx,
 
 	mem_ctx = talloc_new(parent_ctx);
 	if (!mem_ctx) {
-		*error_string = "unable to allocate tmp_ctx for create_keytab";
+		*error_string = talloc_strdup(parent_ctx,
+			"unable to allocate tmp_ctx for create_keytab");
 		return ENOMEM;
 	}
 
@@ -304,6 +305,7 @@ static krb5_error_code create_keytab(TALLOC_CTX *parent_ctx,
 			      salt_princ, kvno, new_secret,
 			      context, enctypes, keytab, error_string);
 	if (ret) {
+		talloc_steal(parent_ctx, *error_string);
 		goto done;
 	}
 
@@ -311,6 +313,9 @@ static krb5_error_code create_keytab(TALLOC_CTX *parent_ctx,
 		ret = keytab_add_keys(mem_ctx, principals,
 				      salt_princ, kvno - 1, old_secret,
 				      context, enctypes, keytab, error_string);
+		if (ret) {
+			talloc_steal(parent_ctx, *error_string);
+		}
 	}
 
 done:


-- 
Samba Shared Repository


More information about the samba-cvs mailing list