diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2012-11-09 16:19:33 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2012-11-09 16:19:33 +0100 |
commit | d36560b73e98fd3e0cba03fb8c43b8e105ccbb84 (patch) | |
tree | 1ef0bb5d4f3a28e996dc630a9cd0eea14b966b30 /src | |
parent | 62d207adea95518ae3db31cd2938cca32bd4e61b (diff) | |
download | libpam-x2go-d36560b73e98fd3e0cba03fb8c43b8e105ccbb84.tar.gz libpam-x2go-d36560b73e98fd3e0cba03fb8c43b8e105ccbb84.tar.bz2 libpam-x2go-d36560b73e98fd3e0cba03fb8c43b8e105ccbb84.zip |
split up hostname and port properly
Diffstat (limited to 'src')
-rw-r--r-- | src/x2go-auth-check.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/x2go-auth-check.c b/src/x2go-auth-check.c index 9e1aba3..505f040 100644 --- a/src/x2go-auth-check.c +++ b/src/x2go-auth-check.c @@ -59,13 +59,22 @@ main (int argc, char * argv[]) char * colonloc = strstr(argv[1], ":"); if (colonloc != NULL) { - /* We've got a port to deal with */ + /* We've got a port to deal with colonloc[0] = '\0'; colonloc++; + */ - long port = strtoul(colonloc, NULL, 10); + char *hostname = strtok( argv[1], ":" ); + long port = strtoul(strtok( argv[1], ":" )); + + // long port = strtoul(colonloc, NULL, 10); + ssh_options_set ( auth_check_ssh_session, SSH_OPTIONS_HOST, &hostname ); ssh_options_set ( auth_check_ssh_session, SSH_OPTIONS_PORT, &port ); + printf ("host: %s\n", hostname); printf ("port: %li\n", port); + } else { + printf ("host: %s\n", argv[1]); + ssh_options_set ( auth_check_ssh_session, SSH_OPTIONS_HOST, &argv[1] ); } printf ("4\n"); |