[X2Go-Commits] libpam-x2go.git - build-main (branch) updated: debd3a94955e7a64ec3430340ea20efdaa927636

X2Go dev team git-admin at x2go.org
Sat Apr 27 13:45:29 CEST 2013


The branch, build-main has been updated
       via  debd3a94955e7a64ec3430340ea20efdaa927636 (commit)
      from  fcf1e8bdf126996d1b24c60f07fa817c30b2af90 (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/freerdp-auth-check.c |   64 +++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 63 insertions(+), 1 deletion(-)

The diff of changes is:
diff --git a/src/freerdp-auth-check.c b/src/freerdp-auth-check.c
index 309be4c..5b29cf1 100644
--- a/src/freerdp-auth-check.c
+++ b/src/freerdp-auth-check.c
@@ -1,8 +1,70 @@
+#include <freerdp/freerdp.h>
+#include <freerdp/channels/channels.h>
+#include <string.h>
+
+void
+auth_context_new (freerdp * instance, rdpContext * context)
+{
+	context->channels = freerdp_channels_new();
+	return;
+}
+
+void
+auth_context_free (freerdp * instance, rdpContext * context)
+{
+	return;
+}
+
+boolean
+auth_pre_connect (freerdp * instance)
+{
+	freerdp_channels_pre_connect(instance->context->channels, instance);
+	return true;
+}
+
+boolean
+auth_post_connect (freerdp * instance)
+{
+	freerdp_channels_post_connect(instance->context->channels, instance);
+	return true;
+}
 
 int
 main (int argc, char * argv[])
 {
+	char password[512];
+	if (argc != 4) {
+		printf("Not enough params");
+		return -1;
+	}
+
+	if (scanf("%511s", password) != 1) {
+		return -1;
+	}
+
+	freerdp_channels_global_init();
+
+	freerdp * instance = freerdp_new();
+
+	instance->PreConnect = auth_pre_connect;
+	instance->PostConnect = auth_post_connect;
+
+	instance->context_size = sizeof(rdpContext);
+	instance->ContextNew = auth_context_new;
+	instance->ContextFree = auth_context_free;
+
+	freerdp_context_new(instance);
 
+	instance->settings->hostname = argv[1];
+	instance->settings->username = argv[2];
+	instance->settings->domain = argv[3];
+	instance->settings->password = password;
+	instance->settings->ignore_certificate = true;
 
-	return -1;
+	if (freerdp_connect(instance)) {
+		freerdp_disconnect(instance);
+		return 0;
+	} else {
+		return -1;
+	}
 }


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