[PATCH] Fix kerberos authentication with Vista

Andreas Schneider anschneider at suse.de
Mon Dec 17 09:31:58 GMT 2007


Jeremy Allison wrote:
> On Fri, Dec 14, 2007 at 11:52:11PM -0800, Jeremy Allison wrote:
>> Here's a fixed version that fixes the memory leak and
>> tidies up a few more things. It correctly uses configure
>> to test for the new krb5 calls you are using. Should apply
>> to the 3.0.28 code.

Hi Jeremy,

> 
> Slightly cleaner version - apply to 3.0.28.
> 

thanks for the improved patch. I've tested it and it works just fine.

> +	if (krb5_cc_get_principal(ctx, cc, &princ)) {
> +		DEBUG(0,("kerberos_get_default_realm_from_ccache: "
> +			"failed to get default principal\n"));
> +		goto done;

Shouldn't we jump to 'out' here to close the ccache and free 'ctx'?

> +	}
> +
> +#if defined(HAVE_KRB5_PRINCIPAL_GET_REALM)
> +	realm = SMB_STRDUP(krb5_principal_get_realm(ctx, princ));
> +#elif defined(HAVE_KRB5_PRINC_REALM)
> +	realm = SMB_STRDUP(krb5_princ_realm(ctx, princ)->data);
> +#endif
> +
> +  out:
> +
> +	if (princ) {
> +		krb5_free_principal(ctx, princ);
> +	}
> +	if (cc) {
> +		krb5_cc_close(ctx, cc);
> +	}
> +	if (ctx) {
> +		krb5_free_context(ctx);
> +	}
> +done:
> +	return realm;
> +}


	-- andreas


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : http://lists.samba.org/archive/samba-technical/attachments/20071217/16ecf09c/signature.bin


More information about the samba-technical mailing list