[PATCH] Fix kerberos authentication with Vista
Jeremy Allison
jra at samba.org
Tue Dec 11 17:24:13 GMT 2007
On Tue, Dec 11, 2007 at 06:19:28PM +0100, Stefan (metze) Metzmacher wrote:
> Hi Andreas,
>
> > DEBUG(3,("got principal=%s\n", principal ? principal : "<null>"));
> >
> > + /* If we get a bad principal, try to guess it */
> > + if (strcmp(principal, CLI_IGNORE_PRINCIPAL) == 0) {
> > + char *realm = NULL;
> > + DEBUG(3,("got a bad principal, trying to guess ...\n"));
> > + realm = lp_realm();
> > + if (realm && *realm) {
> > + asprintf(&principal, "%s$@%s", cli->called.name, realm);
> > + DEBUG(3,("guessed principal=%s\n", principal ? principal : "<null>"));
> > + } else {
> > + DEBUG(0,("please specify 'realm =' in smb.conf\n"));
> > + }
> > + }
> > +
> > if (got_kerberos_mechanism && (principal == NULL)) {
> > /*
> > * It is WRONG to depend on the principal sent in the negprot
>
> when is the principal from asprintf() free'ed?
Or even a check that principal is not null ? :-).
The idiom should be :
if (asprintf(&text, "..." ...) < 0) {
/* deal with error... */
}
More information about the samba-technical
mailing list