diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2012-11-09 13:47:28 +0100 |
---|---|---|
committer | Mike Gabriel <mike@quantal.(none)> | 2012-11-09 13:49:12 +0100 |
commit | 25d86806c68b6eaaf0b84c7ffd1150bbc24d2967 (patch) | |
tree | 144570f592bbe1e3a3de0d53996971bc70c3aea5 | |
parent | 1459c8b3b7b4079b222af372faa10f360d5b23b4 (diff) | |
download | libpam-x2go-25d86806c68b6eaaf0b84c7ffd1150bbc24d2967.tar.gz libpam-x2go-25d86806c68b6eaaf0b84c7ffd1150bbc24d2967.tar.bz2 libpam-x2go-25d86806c68b6eaaf0b84c7ffd1150bbc24d2967.zip |
fixing up x2go-auth-check.c
-rw-r--r-- | src/x2go-auth-check.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/x2go-auth-check.c b/src/x2go-auth-check.c index 8dfc38f..60ca16b 100644 --- a/src/x2go-auth-check.c +++ b/src/x2go-auth-check.c @@ -36,12 +36,12 @@ main (int argc, char * argv[]) return -1; } - auth_check_ssh_session = ssh_new(); + ssh_session auth_check_ssh_session = ssh_new(); ssh_options_set ( auth_check_ssh_session, SSH_OPTIONS_HOST, argv[1] ); ssh_options_set ( auth_check_ssh_session, SSH_OPTIONS_USER, argv[2] ); - int rc = ssh_connect (ssh_session); + ssh_connect ( auth_check_ssh_session ); char * colonloc = strstr(argv[1], ":"); if (colonloc != NULL) { @@ -52,10 +52,12 @@ main (int argc, char * argv[]) ssh_options_set ( auth_check_ssh_session, SSH_OPTIONS_PORT, strtoul(colonloc, NULL, 10) ); } - if (ssh_connect (ssh_session)) { - int rc = ssh_userauth_password ( auth_check_ssh_session, NULL, password ); - ssh_disconnect(ssh_session); + int rc = -1; + if (ssh_connect (auth_check_ssh_session)) { + rc = ssh_userauth_password ( auth_check_ssh_session, NULL, password ); + ssh_disconnect(auth_check_ssh_session); } + ssh_free(auth_check_ssh_session); int retval = -1; if ( rc == SSH_AUTH_SUCCESS ) |