66 |
|
#include <pam/pam_appl.h> |
67 |
|
#endif |
68 |
|
|
69 |
+ |
#if !defined(SSHD_PAM_SERVICE) |
70 |
+ |
extern char *__progname; |
71 |
+ |
# define SSHD_PAM_SERVICE __progname |
72 |
+ |
#endif |
73 |
+ |
|
74 |
|
/* OpenGroup RFC86.0 and XSSO specify no "const" on arguments */ |
75 |
|
#ifdef PAM_SUN_CODEBASE |
76 |
|
# define sshpam_const /* Solaris, HP-UX, SunOS */ |
620 |
|
static int |
621 |
|
sshpam_init(Authctxt *authctxt) |
622 |
|
{ |
618 |
– |
extern char *__progname; |
623 |
|
const char *pam_rhost, *pam_user, *user = authctxt->user; |
624 |
|
const char **ptr_pam_user = &pam_user; |
625 |
|
struct ssh *ssh = active_state; /* XXX */ |
830 |
|
fatal("%s: password length too long: %zu", __func__, l); |
831 |
|
|
832 |
|
ret = malloc(l + 1); |
833 |
+ |
if (ret == NULL) |
834 |
+ |
return NULL; |
835 |
|
for (i = 0; i < l; i++) |
836 |
|
ret[i] = junk[i % (sizeof(junk) - 1)]; |
837 |
|
ret[i] = '\0'; |
950 |
|
|
951 |
|
sshpam_account_status = 1; |
952 |
|
return (sshpam_account_status); |
947 |
– |
} |
948 |
– |
|
949 |
– |
void |
950 |
– |
do_pam_set_tty(const char *tty) |
951 |
– |
{ |
952 |
– |
if (tty != NULL) { |
953 |
– |
debug("PAM: setting PAM_TTY to \"%s\"", tty); |
954 |
– |
sshpam_err = pam_set_item(sshpam_handle, PAM_TTY, tty); |
955 |
– |
if (sshpam_err != PAM_SUCCESS) |
956 |
– |
fatal("PAM: failed to set PAM_TTY: %s", |
957 |
– |
pam_strerror(sshpam_handle, sshpam_err)); |
958 |
– |
} |
953 |
|
} |
954 |
|
|
955 |
|
void |