diff options
author | green <green@FreeBSD.org> | 2001-11-29 21:16:11 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 2001-11-29 21:16:11 +0000 |
commit | 09990be9983e807bd7d1049320397cc1c984483f (patch) | |
tree | 22b830d419472508001a9555a9732720930b5232 | |
parent | 209e871ee026b4e12fd3401b71cc0155fa1b6af9 (diff) | |
download | FreeBSD-src-09990be9983e807bd7d1049320397cc1c984483f.zip FreeBSD-src-09990be9983e807bd7d1049320397cc1c984483f.tar.gz |
Fix pam_ssh by adding an IPv4or6 (evidently, this was broken by my last
OpenSSH import) declaration and strdup(3)ing a value which is later
free(3)d, rather than letting the system try to free it invalidly.
-rw-r--r-- | lib/libpam/modules/pam_ssh/pam_ssh.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libpam/modules/pam_ssh/pam_ssh.c b/lib/libpam/modules/pam_ssh/pam_ssh.c index 56d96c1..e0e1410 100644 --- a/lib/libpam/modules/pam_ssh/pam_ssh.c +++ b/lib/libpam/modules/pam_ssh/pam_ssh.c @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> +#include <sys/socket.h> #include <sys/stat.h> #include <sys/wait.h> @@ -54,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include "log.h" #include "pam_ssh.h" +int IPv4or6 = AF_UNSPEC; + /* * Generic cleanup function for SSH "Key" type. */ @@ -404,6 +407,11 @@ pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv) } else if (strcmp(&env_string[strlen(env_string) - strlen(ENV_PID_SUFFIX)], ENV_PID_SUFFIX) == 0) { + env_value = strdup(env_value); + if (env_value == NULL) { + syslog(LOG_CRIT, "%s: %m", MODULE_NAME); + PAM_RETURN(PAM_SERVICE_ERR); + } retval = pam_set_data(pamh, "ssh_agent_pid", env_value, ssh_cleanup); if (retval != PAM_SUCCESS) |