summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2016-02-07 11:38:54 +0000
committerdes <des@FreeBSD.org>2016-02-07 11:38:54 +0000
commit5a18868b2d506b9e2254047d8d9fb9df5b2a8ae0 (patch)
tree4db6899304517c45f13302b0b11d3144c257dada /lib
parentc76cb9755e8e722ba04e0c26cf28ecc0adeb52de (diff)
downloadFreeBSD-src-5a18868b2d506b9e2254047d8d9fb9df5b2a8ae0.zip
FreeBSD-src-5a18868b2d506b9e2254047d8d9fb9df5b2a8ae0.tar.gz
MFH (r265214, r294333, r294407, r294467): misc prop fixes
MFH (r285975, r287143): register mergeinfo for security fixes MFH (r294497, r294498, r295139): internal documentation MFH (r294328): upgrade to openssh 6.7p1, re-add libwrap MFH (r294332): upgrade to openssh 6.8p1 MFH (r294367): update pam_ssh for api changes MFH (r294909): switch usedns back on MFH (r294336): upgrade to openssh 6.9p1 MFH (r294495): re-enable dsa keys MFH (r294464): upgrade to openssh 7.0p1 MFH (r294496): upgrade to openssh 7.1p2 Approved by: re (gjb) Relnotes: yes
Diffstat (limited to 'lib')
-rw-r--r--lib/libpam/modules/pam_ssh/pam_ssh.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/libpam/modules/pam_ssh/pam_ssh.c b/lib/libpam/modules/pam_ssh/pam_ssh.c
index 405dd6b..8fc68fd 100644
--- a/lib/libpam/modules/pam_ssh/pam_ssh.c
+++ b/lib/libpam/modules/pam_ssh/pam_ssh.c
@@ -321,12 +321,11 @@ pam_ssh_start_agent(pam_handle_t *pamh)
static int
pam_ssh_add_keys_to_agent(pam_handle_t *pamh)
{
- AuthenticationConnection *ac;
const struct pam_ssh_key *psk;
const char **kfn;
const void *item;
char **envlist, **env;
- int pam_err;
+ int fd, pam_err;
/* switch to PAM environment */
envlist = environ;
@@ -336,7 +335,7 @@ pam_ssh_add_keys_to_agent(pam_handle_t *pamh)
}
/* get a connection to the agent */
- if ((ac = ssh_get_authentication_connection()) == NULL) {
+ if (ssh_get_authentication_socket(&fd) != 0) {
openpam_log(PAM_LOG_DEBUG, "failed to connect to the agent");
pam_err = PAM_SYSTEM_ERR;
goto end;
@@ -347,7 +346,7 @@ pam_ssh_add_keys_to_agent(pam_handle_t *pamh)
pam_err = pam_get_data(pamh, *kfn, &item);
if (pam_err == PAM_SUCCESS && item != NULL) {
psk = item;
- if (ssh_add_identity(ac, psk->key, psk->comment))
+ if (ssh_add_identity(fd, psk->key, psk->comment) == 0)
openpam_log(PAM_LOG_DEBUG,
"added %s to ssh agent", psk->comment);
else
@@ -358,11 +357,11 @@ pam_ssh_add_keys_to_agent(pam_handle_t *pamh)
}
}
pam_err = PAM_SUCCESS;
- end:
+
/* disconnect from agent */
- if (ac != NULL)
- ssh_close_authentication_connection(ac);
+ ssh_close_authentication_socket(fd);
+ end:
/* switch back to original environment */
for (env = environ; *env != NULL; ++env)
free(*env);
OpenPOWER on IntegriCloud