aboutsummaryrefslogtreecommitdiff
path: root/lib/libpam/modules/pam_ssh/pam_ssh.c
diff options
context:
space:
mode:
authorBrian Feldman <green@FreeBSD.org>2001-11-29 21:16:11 +0000
committerBrian Feldman <green@FreeBSD.org>2001-11-29 21:16:11 +0000
commit7d8cee925b818d3b0b6514494db1d2e80566f277 (patch)
tree22b830d419472508001a9555a9732720930b5232 /lib/libpam/modules/pam_ssh/pam_ssh.c
parent57d484c8cc0c8dbb34384b12b12d5b449b074d6e (diff)
downloadsrc-7d8cee925b818d3b0b6514494db1d2e80566f277.tar.gz
src-7d8cee925b818d3b0b6514494db1d2e80566f277.zip
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.
Notes
Notes: svn path=/head/; revision=87098
Diffstat (limited to 'lib/libpam/modules/pam_ssh/pam_ssh.c')
-rw-r--r--lib/libpam/modules/pam_ssh/pam_ssh.c8
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 56d96c10f00b..e0e1410db367 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)