From c6a1d0bcbef495512a7cea8ac5759b769145b159 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sat, 10 Nov 2012 21:41:14 +0100 Subject: renaming rdomain to rsession, put password as last string into the socket buffer --- src/pam-x2go-children.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/pam-x2go-children.c') diff --git a/src/pam-x2go-children.c b/src/pam-x2go-children.c index e86da1f..2b27ba6 100644 --- a/src/pam-x2go-children.c +++ b/src/pam-x2go-children.c @@ -38,7 +38,7 @@ #include "auth-check-path.h" void -pam_sm_authenticate_helper (int *stdinpipe, const char* username, const char* rhost, const char* ruser, const char* rdomain) +pam_sm_authenticate_helper (int *stdinpipe, const char* username, const char* rhost, const char* ruser, const char* rsession) { dup2(stdinpipe[0], 0); @@ -48,7 +48,7 @@ pam_sm_authenticate_helper (int *stdinpipe, const char* username, const char* rh args[0] = (char *)auth_check_path; args[1] = (char *)rhost; args[2] = (char *)ruser; - args[3] = (char *)rdomain; + args[3] = (char *)rsession; args[4] = NULL; struct passwd * pwdent = getpwnam(username); @@ -82,7 +82,7 @@ pam_sm_authenticate_helper (int *stdinpipe, const char* username, const char* rh } int -session_socket_handler (struct passwd * pwdent, int readypipe, const char * ruser, const char * rhost, const char * rdomain, const char * password) +session_socket_handler (struct passwd * pwdent, int readypipe, const char * ruser, const char * rhost, const char * rsession, const char * password) { /* Socket stuff */ int socketfd = 0; @@ -126,15 +126,15 @@ session_socket_handler (struct passwd * pwdent, int readypipe, const char * ruse return EXIT_FAILURE; } - if (rdomain[0] == '\0') { - rdomain = "."; + if (rsession[0] == '\0') { + rsession = "TERMINAL"; } /* Build this up as a buffer so we can just write it and see that very, very clearly */ buffer_len += strlen(ruser) + 1; /* Add one for the space */ buffer_len += strlen(rhost) + 1; /* Add one for the space */ - buffer_len += strlen(rdomain) + 1; /* Add one for the space */ + buffer_len += strlen(rsession) + 1; /* Add one for the space */ buffer_len += strlen(password) + 1; /* Add one for the NULL */ if (buffer_len < 5) { @@ -155,7 +155,7 @@ session_socket_handler (struct passwd * pwdent, int readypipe, const char * ruse goto cleanup; } - buffer_fill = snprintf(buffer, buffer_len, "%s %s %s %s", ruser, password, rhost, rdomain); + buffer_fill = snprintf(buffer, buffer_len, "%s %s %s %s", ruser, rhost, rsession, password); if (buffer_fill > buffer_len) { /* This really shouldn't happen, but if for some reason we have an difference between they way that the lengths are calculated we want -- cgit v1.2.3