summaryrefslogtreecommitdiffstats
path: root/libssh/auth.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-04-30 14:00:07 +0000
committerAndreas Schneider <mail@cynapses.org>2009-04-30 14:00:07 +0000
commit2317a589968d7d906840dd2b1330174c6b1d7d0d (patch)
tree1b673c12536b78f370ba70a692b27265f412cf68 /libssh/auth.c
parent567cc5984abc6b1380f8a807a0a8f197bb8a3b93 (diff)
downloadlibssh-2317a589968d7d906840dd2b1330174c6b1d7d0d.tar.gz
libssh-2317a589968d7d906840dd2b1330174c6b1d7d0d.tar.xz
libssh-2317a589968d7d906840dd2b1330174c6b1d7d0d.zip
Improve ask_userauth().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@659 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/auth.c')
-rw-r--r--libssh/auth.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/libssh/auth.c b/libssh/auth.c
index 235ec23..fbb073f 100644
--- a/libssh/auth.c
+++ b/libssh/auth.c
@@ -36,17 +36,21 @@
/** \addtogroup ssh_auth
* @{ */
-static int ask_userauth(SSH_SESSION *session){
- int ret=0;
- enter_function();
- if(session->auth_service_asked)
- ret = 0;
- else if(ssh_service_request(session,"ssh-userauth"))
- ret = -1;
- else
- session->auth_service_asked++;
- leave_function();
- return ret;
+static int ask_userauth(SSH_SESSION *session) {
+ int rc = 0;
+
+ enter_function();
+
+ if (session->auth_service_asked) {
+ rc = 0;
+ } else if (ssh_service_request(session,"ssh-userauth")) {
+ rc = -1;
+ } else {
+ session->auth_service_asked++;
+ }
+
+ leave_function();
+ return rc;
}
static void burn(char *ptr){