summaryrefslogtreecommitdiff
path: root/src/sss_client/ssh
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2012-02-27 04:43:34 -0500
committerStephen Gallagher <sgallagh@redhat.com>2012-02-27 11:52:34 -0500
commite5359baeac6e2d49769aceddbdbc606833b1ec69 (patch)
treee7d995a0c6c63f3121d99e45557a9034ce2729a7 /src/sss_client/ssh
parent7aaf963f23158789a0f6fe3631608e274dd4238f (diff)
downloadsssd-e5359baeac6e2d49769aceddbdbc606833b1ec69.tar.gz
sssd-e5359baeac6e2d49769aceddbdbc606833b1ec69.tar.bz2
sssd-e5359baeac6e2d49769aceddbdbc606833b1ec69.zip
SSH: Add more debugging messages
Diffstat (limited to 'src/sss_client/ssh')
-rw-r--r--src/sss_client/ssh/sss_ssh_authorizedkeys.c4
-rw-r--r--src/sss_client/ssh/sss_ssh_knownhostsproxy.c18
2 files changed, 18 insertions, 4 deletions
diff --git a/src/sss_client/ssh/sss_ssh_authorizedkeys.c b/src/sss_client/ssh/sss_ssh_authorizedkeys.c
index bc3cdf47..de945422 100644
--- a/src/sss_client/ssh/sss_ssh_authorizedkeys.c
+++ b/src/sss_client/ssh/sss_ssh_authorizedkeys.c
@@ -99,6 +99,8 @@ int main(int argc, const char **argv)
/* look up public keys */
ret = sss_ssh_get_ent(mem_ctx, SSS_SSH_GET_USER_PUBKEYS, user, &ent);
if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("sss_ssh_get_ent() failed (%d): %s\n", ret, strerror(ret)));
ERROR("Error looking up public keys\n");
ret = EXIT_FAILURE;
goto fini;
@@ -109,6 +111,8 @@ int main(int argc, const char **argv)
repr = sss_ssh_format_pubkey(mem_ctx, ent, &ent->pubkeys[i],
SSS_SSH_FORMAT_OPENSSH);
if (!repr) {
+ DEBUG(SSSDBG_OP_FAILURE,
+ ("Out of memory formatting SSH public key\n"));
continue;
}
diff --git a/src/sss_client/ssh/sss_ssh_knownhostsproxy.c b/src/sss_client/ssh/sss_ssh_knownhostsproxy.c
index 544ea719..1cfdf24d 100644
--- a/src/sss_client/ssh/sss_ssh_knownhostsproxy.c
+++ b/src/sss_client/ssh/sss_ssh_knownhostsproxy.c
@@ -136,6 +136,8 @@ connect_socket(const char *host,
if (ret == EINTR || ret == EAGAIN) {
continue;
}
+ DEBUG(SSSDBG_OP_FAILURE,
+ ("poll() failed (%d): %s\n", ret, strerror(ret)));
goto done;
}
@@ -149,25 +151,31 @@ connect_socket(const char *host,
if (ret == EAGAIN || ret == EINTR || ret == EWOULDBLOCK) {
continue;
}
+ DEBUG(SSSDBG_OP_FAILURE,
+ ("read() failed (%d): %s\n", ret, strerror(ret)));
goto done;
} else if (res == 0) {
- ret = EOK;
- goto done;
+ break;
}
res = sss_atomic_write(i == 0 ? sock : 1, buffer, res);
if (res == -1) {
ret = errno;
+ DEBUG(SSSDBG_OP_FAILURE,
+ ("sss_atomic_write() failed (%d): %s\n",
+ ret, strerror(ret)));
goto done;
}
}
if (fds[i].revents & POLLHUP) {
- ret = EOK;
- goto done;
+ break;
}
}
}
+ ret = EOK;
+ DEBUG(SSSDBG_TRACE_FUNC, ("Connection closed\n"));
+
done:
if (ai) freeaddrinfo(ai);
if (sock >= 0) close(sock);
@@ -274,6 +282,8 @@ int main(int argc, const char **argv)
/* look up public keys */
ret = sss_ssh_get_ent(mem_ctx, SSS_SSH_GET_HOST_PUBKEYS, host, &ent);
if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("sss_ssh_get_ent() failed (%d): %s\n", ret, strerror(ret)));
ERROR("Error looking up public keys\n");
}