svn commit: samba r21175 - in branches/SAMBA_4_0/source: auth/kerberos libnet

abartlet at samba.org abartlet at samba.org
Tue Feb 6 05:41:07 GMT 2007


Author: abartlet
Date: 2007-02-06 05:41:04 +0000 (Tue, 06 Feb 2007)
New Revision: 21175

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21175

Log:
Fix the kerberos keytab update code to handle deletes.

Fix the join code to know that the ldb layer handles the keytab update.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/auth/kerberos/kerberos_util.c
   branches/SAMBA_4_0/source/libnet/libnet_join.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/kerberos/kerberos_util.c
===================================================================
--- branches/SAMBA_4_0/source/auth/kerberos/kerberos_util.c	2007-02-06 05:26:25 UTC (rev 21174)
+++ branches/SAMBA_4_0/source/auth/kerberos/kerberos_util.c	2007-02-06 05:41:04 UTC (rev 21175)
@@ -417,10 +417,9 @@
 		const struct samr_Password *mach_pwd;
 		mach_pwd = cli_credentials_get_nt_hash(machine_account, mem_ctx);
 		if (!mach_pwd) {
-			DEBUG(1, ("create_keytab: Domain trust informaton for account %s not available\n",
-				  cli_credentials_get_principal(machine_account, mem_ctx)));
+			/* OK, nothing to do here */
 			talloc_free(mem_ctx);
-			return EINVAL;
+			return 0;
 		}
 		ret = krb5_keyblock_init(smb_krb5_context->krb5_context,
 					 ETYPE_ARCFOUR_HMAC_MD5,

Modified: branches/SAMBA_4_0/source/libnet/libnet_join.c
===================================================================
--- branches/SAMBA_4_0/source/libnet/libnet_join.c	2007-02-06 05:26:25 UTC (rev 21174)
+++ branches/SAMBA_4_0/source/libnet/libnet_join.c	2007-02-06 05:41:04 UTC (rev 21175)
@@ -860,7 +860,6 @@
 	uint32_t acct_type = 0;
 	const char *account_name;
 	const char *netbios_name;
-	char *filter;
 	
 	r->out.error_string = NULL;
 
@@ -1143,33 +1142,6 @@
 		return NT_STATUS_INTERNAL_DB_CORRUPTION;
 	}
 
-	if (r2->out.realm) {
-		struct cli_credentials *creds;
-		/* Make a credentials structure from it */
-		creds = cli_credentials_init(mem_ctx);
-		if (!creds) {
-			r->out.error_string = NULL;
-			talloc_free(tmp_mem);
-			return NT_STATUS_NO_MEMORY;
-		}
-		cli_credentials_set_conf(creds);
-		filter = talloc_asprintf(mem_ctx, "dn=%s", ldb_dn_get_linearized(msg->dn));
-		status = cli_credentials_set_secrets(creds, NULL, NULL, filter);
-		if (!NT_STATUS_IS_OK(status)) {
-			r->out.error_string = talloc_asprintf(mem_ctx, "Failed to read secrets for keytab update for %s", 
-							      filter);
-			talloc_free(tmp_mem);
-			return status;
-		} 
-		ret = cli_credentials_update_keytab(creds);
-		if (ret != 0) {
-			r->out.error_string = talloc_asprintf(mem_ctx, "Failed to update keytab for %s", 
-							      filter);
-			talloc_free(tmp_mem);
-			return NT_STATUS_UNSUCCESSFUL;
-		}
-	}
-
 	/* move all out parameter to the callers TALLOC_CTX */
 	r->out.error_string	= NULL;
 	r->out.join_password	= r2->out.join_password;



More information about the samba-cvs mailing list