[X2Go-Commits] libpam-x2go.git - x2gosession (branch) updated: b7b4222822ed6b54160104312ba02eb3ab01313f
X2Go dev team
git-admin at x2go.org
Wed Apr 24 18:47:33 CEST 2013
The branch, x2gosession has been updated
via b7b4222822ed6b54160104312ba02eb3ab01313f (commit)
from d36560b73e98fd3e0cba03fb8c43b8e105ccbb84 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
src/x2go-auth-check.c | 39 ++++++++++-----------------------------
1 file changed, 10 insertions(+), 29 deletions(-)
The diff of changes is:
diff --git a/src/x2go-auth-check.c b/src/x2go-auth-check.c
index 505f040..54ad333 100644
--- a/src/x2go-auth-check.c
+++ b/src/x2go-auth-check.c
@@ -26,7 +26,7 @@
int
main (int argc, char * argv[])
{
- int verbosity = SSH_LOG_PROTOCOL;
+ int verbosity = SSH_LOG_NOLOG;
char password[512];
if (argc != 4) {
@@ -34,62 +34,45 @@ main (int argc, char * argv[])
return -1;
}
- printf ("1\n");
-
if (scanf("%511s", password) != 1) {
return -1;
}
- printf ("2\n");
-
if (mlock(password, sizeof(password)) != 0) {
return -1;
}
- printf ("3\n");
-
ssh_session auth_check_ssh_session = ssh_new();
ssh_options_set ( auth_check_ssh_session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity );
- ssh_options_set ( auth_check_ssh_session, SSH_OPTIONS_HOST, &argv[1] );
- ssh_options_set ( auth_check_ssh_session, SSH_OPTIONS_USER, &argv[2] );
-
- printf ("host: %s\n", argv[1]);
- printf ("user: %s\n", argv[2]);
+ ssh_options_set ( auth_check_ssh_session, SSH_OPTIONS_USER, argv[2] );
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], ":" ));
+ char *array[2];
+ array[0] = strtok( argv[1], ":" );
+ char *hostname = array[0];
+
+ ssh_options_set ( auth_check_ssh_session, SSH_OPTIONS_HOST, hostname );
- // 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] );
+ ssh_options_set ( auth_check_ssh_session, SSH_OPTIONS_HOST, argv[1] );
}
- printf ("4\n");
-
int rc;
rc = ssh_connect ( auth_check_ssh_session );
- printf ("%i\n", rc);
if ( rc != SSH_OK ) {
fprintf ( stderr, "Error connecting to via SSH: %s\n", ssh_get_error ( auth_check_ssh_session ) );
ssh_free(auth_check_ssh_session);
return -1;
}
- printf ("5\n");
-
rc = ssh_userauth_password ( auth_check_ssh_session, NULL, password );
if ( rc != SSH_AUTH_SUCCESS ) {
fprintf ( stderr, "Error connecting to via SSH: %s\n", ssh_get_error ( auth_check_ssh_session ) );
@@ -98,8 +81,6 @@ main (int argc, char * argv[])
return -1;
}
- printf ("6\n");
-
memset(password, 0, sizeof(password));
munlock(password, sizeof(password));
hooks/post-receive
--
libpam-x2go.git (Remote login session via X2Go (PAM module))
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "libpam-x2go.git" (Remote login session via X2Go (PAM module)).
More information about the x2go-commits
mailing list