From edd14a06a92de3b1275f4aeb377d8fa3852f823e Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 9 Nov 2012 12:04:48 +0100 Subject: Adaptations of the forked original to work with X2Go: Check the authentication token via libssh (ssh login to the remote server). --- src/pam-x2go.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'src/pam-x2go.c') diff --git a/src/pam-x2go.c b/src/pam-x2go.c index 8979e6e..8ca5147 100644 --- a/src/pam-x2go.c +++ b/src/pam-x2go.c @@ -34,7 +34,7 @@ #include #include -#include "pam-freerdp-children.h" +#include "pam-x2go-children.h" #include "auth-check-path.h" static int unpriveleged_kill (struct passwd * pwdent); @@ -126,18 +126,6 @@ get_item (pam_handle_t * pamh, int type) } } - /* The way that xfreerdp does parsing means that we can't handle - spaces in the username. Let's block them as early as possible. - Though, if the xfreerdp part gets fixed, we want this to disappear - http://launchpad.net/bugs/1053102 - */ - if (type == PAM_RUSER) { - if (strstr(promptval, " ") != NULL) { - free(promptval); - return NULL; - } - } - if (type == PAM_RHOST) { char * subloc = strstr(promptval, "://"); if (subloc != NULL) { @@ -205,7 +193,7 @@ get_item (pam_handle_t * pamh, int type) } /* Authenticate. We need to make sure we have a user account, that - there are remote accounts and then verify them with FreeRDP */ + there are remote accounts and then verify them with X2Go */ PAM_EXTERN int pam_sm_authenticate (pam_handle_t *pamh, int flags, int argc, const char **argv) { @@ -270,7 +258,7 @@ done: pid_t session_pid = 0; /* Open Session. Here we need to fork a little process so that we can give the credentials to the session itself so that it can startup the - xfreerdp viewer for the login */ + PyHoca (X2Go) client for the login */ PAM_EXTERN int pam_sm_open_session (pam_handle_t *pamh, int flags, int argc, const char ** argv) { @@ -426,8 +414,8 @@ pam_sm_setcred (pam_handle_t *pamh, int flags, int argc, const char ** argv) #ifdef PAM_STATIC -struct pam_module _pam_freerdp_modstruct = { - "pam_freerdp", +struct pam_module _pam_x2go_modstruct = { + "pam_x2go", pam_sm_authenticate, pam_sm_setcred, NULL, -- cgit v1.2.3