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

Collapse All | Expand All

(-)auth-pam.c (-7 / +17 lines)
Lines 56-61 RCSID("$Id: auth-pam.c,v 1.121 2005/01/2 Link Here
56
#include <pam/pam_appl.h>
56
#include <pam/pam_appl.h>
57
#endif
57
#endif
58
58
59
/* OpenGroup RFC86.0 and XSSO specify no "const" on arguments */
60
#ifdef PAM_SUN_CODEBASE
61
# define sshpam_const		/* Solaris, HP-UX, AIX */
62
#else
63
# define sshpam_const	const	/* LinuxPAM, OpenPAM */
64
#endif
65
59
#include "auth.h"
66
#include "auth.h"
60
#include "auth-pam.h"
67
#include "auth-pam.h"
61
#include "buffer.h"
68
#include "buffer.h"
Lines 290-296 import_environments(Buffer *b) Link Here
290
 * Conversation function for authentication thread.
297
 * Conversation function for authentication thread.
291
 */
298
 */
292
static int
299
static int
293
sshpam_thread_conv(int n, struct pam_message **msg,
300
sshpam_thread_conv(int n, sshpam_const struct pam_message **msg,
294
    struct pam_response **resp, void *data)
301
    struct pam_response **resp, void *data)
295
{
302
{
296
	Buffer buffer;
303
	Buffer buffer;
Lines 389-396 sshpam_thread(void *ctxtp) Link Here
389
	char **env_from_pam;
396
	char **env_from_pam;
390
	u_int i;
397
	u_int i;
391
	const char *pam_user;
398
	const char *pam_user;
399
	const char **ptr_pam_user = &pam_user;
392
400
393
	pam_get_item(sshpam_handle, PAM_USER, (void **)&pam_user);
401
	pam_get_item(sshpam_handle, PAM_USER,
402
	    (sshpam_const void **)ptr_pam_user);
394
	environ[0] = NULL;
403
	environ[0] = NULL;
395
404
396
	if (sshpam_authctxt != NULL) {
405
	if (sshpam_authctxt != NULL) {
Lines 482-488 sshpam_thread_cleanup(void) Link Here
482
}
491
}
483
492
484
static int
493
static int
485
sshpam_null_conv(int n, struct pam_message **msg,
494
sshpam_null_conv(int n, sshpam_const struct pam_message **msg,
486
    struct pam_response **resp, void *data)
495
    struct pam_response **resp, void *data)
487
{
496
{
488
	debug3("PAM: %s entering, %d messages", __func__, n);
497
	debug3("PAM: %s entering, %d messages", __func__, n);
Lines 492-498 sshpam_null_conv(int n, struct pam_messa Link Here
492
static struct pam_conv null_conv = { sshpam_null_conv, NULL };
501
static struct pam_conv null_conv = { sshpam_null_conv, NULL };
493
502
494
static int
503
static int
495
sshpam_store_conv(int n, struct pam_message **msg,
504
sshpam_store_conv(int n, sshpam_const struct pam_message **msg,
496
    struct pam_response **resp, void *data)
505
    struct pam_response **resp, void *data)
497
{
506
{
498
	struct pam_response *reply;
507
	struct pam_response *reply;
Lines 561-571 sshpam_init(Authctxt *authctxt) Link Here
561
{
570
{
562
	extern char *__progname;
571
	extern char *__progname;
563
	const char *pam_rhost, *pam_user, *user = authctxt->user;
572
	const char *pam_rhost, *pam_user, *user = authctxt->user;
573
	const char **ptr_pam_user = &pam_user;
564
574
565
	if (sshpam_handle != NULL) {
575
	if (sshpam_handle != NULL) {
566
		/* We already have a PAM context; check if the user matches */
576
		/* We already have a PAM context; check if the user matches */
567
		sshpam_err = pam_get_item(sshpam_handle,
577
		sshpam_err = pam_get_item(sshpam_handle,
568
		    PAM_USER, (void **)&pam_user);
578
		    PAM_USER, (sshpam_const void **)ptr_pam_user);
569
		if (sshpam_err == PAM_SUCCESS && strcmp(user, pam_user) == 0)
579
		if (sshpam_err == PAM_SUCCESS && strcmp(user, pam_user) == 0)
570
			return (0);
580
			return (0);
571
		pam_end(sshpam_handle, sshpam_err);
581
		pam_end(sshpam_handle, sshpam_err);
Lines 881-887 do_pam_setcred(int init) Link Here
881
}
891
}
882
892
883
static int
893
static int
884
sshpam_tty_conv(int n, struct pam_message **msg,
894
sshpam_tty_conv(int n, sshpam_const struct pam_message **msg,
885
    struct pam_response **resp, void *data)
895
    struct pam_response **resp, void *data)
886
{
896
{
887
	char input[PAM_MAX_MSG_SIZE];
897
	char input[PAM_MAX_MSG_SIZE];
Lines 1040-1046 free_pam_environment(char **env) Link Here
1040
 * display.
1050
 * display.
1041
 */
1051
 */
1042
static int
1052
static int
1043
sshpam_passwd_conv(int n, struct pam_message **msg,
1053
sshpam_passwd_conv(int n, sshpam_const struct pam_message **msg,
1044
    struct pam_response **resp, void *data)
1054
    struct pam_response **resp, void *data)
1045
{
1055
{
1046
	struct pam_response *reply;
1056
	struct pam_response *reply;

Return to bug 1033