[SCM] Samba Shared Repository - branch master updated

[email protected] (Stefan Metzmacher)
Newsgroups gmane.network.samba.cvs
Message-ID <[email protected]>
The branch, master has been updated
       via  8989725 s3-rpc_client: Pass NULL as no password
       via  ae5e654 auth/credentials: Add NULL check to free_dccache()
       via  c406bf6 auth/credentials: Add NULL check in free_mccache()
       via  d1ad71e auth/credentials: Move function to free ccaches to the top
       via  59cc352 auth/credentials: Add talloc NULL check in cli_credentials_set_principal()
      from  9b566e7 WHATSNEW: Add some information about ID mapping

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


- Log -----------------------------------------------------------------
commit 8989725b67b4510b05a6819f86fc364293b5a814
Author: Andreas Schneider <[email protected]>
Date:   Mon Sep 19 14:40:42 2016 +0200

    s3-rpc_client: Pass NULL as no password
    
    GENSEC expects NULL as no password.
    
    Signed-off-by: Andreas Schneider <[email protected]>
    Reviewed-by: Stefan Metzmacher <[email protected]>
    
    Autobuild-User(master): Stefan Metzmacher <[email protected]>
    Autobuild-Date(master): Tue Dec 20 17:37:56 CET 2016 on sn-devel-144

commit ae5e654f88539b3b7ab55ae11b048479523138aa
Author: Andreas Schneider <[email protected]>
Date:   Sat Oct 1 11:27:54 2016 +0200

    auth/credentials: Add NULL check to free_dccache()
    
    Signed-off-by: Andreas Schneider <[email protected]>
    Reviewed-by: Stefan Metzmacher <[email protected]>

commit c406bf6cd6907b43301752169054c0d30b1f8544
Author: Andreas Schneider <[email protected]>
Date:   Sat Oct 1 11:25:44 2016 +0200

    auth/credentials: Add NULL check in free_mccache()
    
    Signed-off-by: Andreas Schneider <[email protected]>
    Reviewed-by: Stefan Metzmacher <[email protected]>

commit d1ad71ef9f0fe9379eb396ee38909d28c7797ee9
Author: Andreas Schneider <[email protected]>
Date:   Thu Oct 6 09:22:29 2016 +0200

    auth/credentials: Move function to free ccaches to the top
    
    Signed-off-by: Andreas Schneider <[email protected]>
    Reviewed-by: Stefan Metzmacher <[email protected]>

commit 59cc352ac6c5b763ae9cbf81fe367dd8769863d2
Author: Andreas Schneider <[email protected]>
Date:   Thu Oct 6 08:16:57 2016 +0200

    auth/credentials: Add talloc NULL check in cli_credentials_set_principal()
    
    Signed-off-by: Andreas Schneider <[email protected]>
    Reviewed-by: Stefan Metzmacher <[email protected]>

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

Summary of changes:
 auth/credentials/credentials.c      |  4 ++++
 auth/credentials/credentials_krb5.c | 39 +++++++++++++++++++++++--------------
 source3/rpc_client/cli_pipe.c       |  2 +-
 3 files changed, 29 insertions(+), 16 deletions(-)


Changeset truncated at 500 lines:

diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c
index 9a935c6..06648c7 100644
--- a/auth/credentials/credentials.c
+++ b/auth/credentials/credentials.c
@@ -268,7 +268,11 @@ _PUBLIC_ bool cli_credentials_set_principal(struct cli_credentials *cred,
 {
 	if (obtained >= cred->principal_obtained) {
 		cred->principal = talloc_strdup(cred, val);
+		if (cred->principal == NULL) {
+			return false;
+		}
 		cred->principal_obtained = obtained;
+
 		cli_credentials_invalidate_ccache(cred, cred->principal_obtained);
 		return true;
 	}
diff --git a/auth/credentials/credentials_krb5.c b/auth/credentials/credentials_krb5.c
index 4c903f2..ca62e30 100644
--- a/auth/credentials/credentials_krb5.c
+++ b/auth/credentials/credentials_krb5.c
@@ -39,6 +39,30 @@ static void cli_credentials_invalidate_client_gss_creds(
 					struct cli_credentials *cred,
 					enum credentials_obtained obtained);
 
+/* Free a memory ccache */
+static int free_mccache(struct ccache_container *ccc)
+{
+	if (ccc->ccache != NULL) {
+		krb5_cc_destroy(ccc->smb_krb5_context->krb5_context,
+				ccc->ccache);
+		ccc->ccache = NULL;
+	}
+
+	return 0;
+}
+
+/* Free a disk-based ccache */
+static int free_dccache(struct ccache_container *ccc)
+{
+	if (ccc->ccache != NULL) {
+		krb5_cc_close(ccc->smb_krb5_context->krb5_context,
+			      ccc->ccache);
+		ccc->ccache = NULL;
+	}
+
+	return 0;
+}
+
 _PUBLIC_ int cli_credentials_get_krb5_context(struct cli_credentials *cred, 
 				     struct loadparm_context *lp_ctx,
 				     struct smb_krb5_context **smb_krb5_context) 
@@ -122,21 +146,6 @@ static int cli_credentials_set_from_ccache(struct cli_credentials *cred,
 	return 0;
 }
 
-/* Free a memory ccache */
-static int free_mccache(struct ccache_container *ccc)
-{
-	krb5_cc_destroy(ccc->smb_krb5_context->krb5_context, ccc->ccache);
-
-	return 0;
-}
-
-/* Free a disk-based ccache */
-static int free_dccache(struct ccache_container *ccc) {
-	krb5_cc_close(ccc->smb_krb5_context->krb5_context, ccc->ccache);
-
-	return 0;
-}
-
 _PUBLIC_ int cli_credentials_set_ccache(struct cli_credentials *cred, 
 					struct loadparm_context *lp_ctx,
 					const char *name,
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 5418fbe..14f7fbc 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -2629,7 +2629,7 @@ NTSTATUS rpccli_ncalrpc_bind_data(TALLOC_CTX *mem_ctx,
 					"host", /* target_service */
 					NAME_NT_AUTHORITY, /* domain */
 					"SYSTEM",
-					"", /* password */
+					NULL, /* password */
 					CRED_DONT_USE_KERBEROS,
 					NULL, /* netlogon_creds_CredentialState */
 					presult);


-- 
Samba Shared Repository
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.