aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-08-24 22:38:16 -0500
committerTed Gould <ted@gould.cx>2012-08-24 22:38:16 -0500
commit6b495327f20269cc353ec20d424ecd0d68e58541 (patch)
treef68f6d8ce755e83f2054e45a33879cbb3a53c979
parente3a8eb3f68140e51e972fde3e025e6d26157d12f (diff)
downloadlibpam-x2go-6b495327f20269cc353ec20d424ecd0d68e58541.tar.gz
libpam-x2go-6b495327f20269cc353ec20d424ecd0d68e58541.tar.bz2
libpam-x2go-6b495327f20269cc353ec20d424ecd0d68e58541.zip
Crazy cheap URL parser
-rw-r--r--src/pam-freerdp.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/pam-freerdp.c b/src/pam-freerdp.c
index 5295098..2550767 100644
--- a/src/pam-freerdp.c
+++ b/src/pam-freerdp.c
@@ -86,6 +86,23 @@ get_item (pam_handle_t * pamh, int type)
char * retval = responses->resp;
free(responses);
+
+ if (type == PAM_RHOST) {
+ if (strncmp(retval, "http://", strlen("http://")) == 0) {
+ char * original = retval;
+ char * newish = retval + strlen("http://");
+ char * c;
+ for (c = newish; *c != '\0'; c++) {
+ if (*c == '/') {
+ *c = '\0';
+ break;
+ }
+ }
+ retval = strdup(newish);
+ free(original);
+ }
+ }
+
return retval;
}