View | Details | Raw Unified | Return to bug 2408 | Differences between
and this patch

Collapse All | Expand All

(-)openssh-7.6p1/auth-pam.c (-20 / +22 lines)
Lines 665-670 Link Here
665
	return (0);
665
	return (0);
666
}
666
}
667
667
668
static void
669
expose_authinfo(const char *caller)
670
{
671
	char *auth_info;
672
673
	/*
674
	 * Expose authentication information to PAM.
675
	 * The enviornment variable is versioned. Please increment the
676
	 * version suffix if the format of session_info changes.
677
	 */
678
	if (sshpam_authctxt->session_info == NULL)
679
		auth_info = xstrdup("");
680
	else if ((auth_info = sshbuf_dup_string(
681
	    sshpam_authctxt->session_info)) == NULL)
682
		fatal("%s: sshbuf_dup_string failed", __func__);
683
684
	debug2("%s: auth information in SSH_AUTH_INFO_0", caller);
685
	do_pam_putenv("SSH_AUTH_INFO_0", auth_info);
686
	free(auth_info);
687
}
688
668
static void *
689
static void *
669
sshpam_init_ctx(Authctxt *authctxt)
690
sshpam_init_ctx(Authctxt *authctxt)
670
{
691
{
Lines 685-690 Link Here
685
		return (NULL);
706
		return (NULL);
686
	}
707
	}
687
708
709
	expose_authinfo(__func__);
688
	ctxt = xcalloc(1, sizeof *ctxt);
710
	ctxt = xcalloc(1, sizeof *ctxt);
689
711
690
	/* Start the authentication thread */
712
	/* Start the authentication thread */
Lines 926-951 Link Here
926
	sshpam_cleanup();
948
	sshpam_cleanup();
927
}
949
}
928
950
929
static void
930
expose_authinfo(const char *caller)
931
{
932
	char *auth_info;
933
934
	/*
935
	 * Expose authentication information to PAM.
936
	 * The enviornment variable is versioned. Please increment the
937
	 * version suffix if the format of session_info changes.
938
	 */
939
	if (sshpam_authctxt->session_info == NULL)
940
		auth_info = xstrdup("");
941
	else if ((auth_info = sshbuf_dup_string(
942
	    sshpam_authctxt->session_info)) == NULL)
943
		fatal("%s: sshbuf_dup_string failed", __func__);
944
945
	debug2("%s: auth information in SSH_AUTH_INFO_0", caller);
946
	do_pam_putenv("SSH_AUTH_INFO_0", auth_info);
947
	free(auth_info);
948
}

Return to bug 2408