aboutsummaryrefslogtreecommitdiff
path: root/src/pam-freerdp.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-08-28 08:11:57 +0000
committerTarmac <Unknown>2012-08-28 08:11:57 +0000
commitd67a26ba2585bd8bc74fed85e3ba0f4bc48f6f35 (patch)
tree4fed2e6f3eab07c70c79ceb82b5f33d93130ca2c /src/pam-freerdp.c
parent5b36f6b97465461ebc87a984c853c81f2c67a4ac (diff)
parent613d854fcdb84ab282e73ec2f51eea805a7cd0cd (diff)
downloadlibpam-freerdp2-d67a26ba2585bd8bc74fed85e3ba0f4bc48f6f35.tar.gz
libpam-freerdp2-d67a26ba2585bd8bc74fed85e3ba0f4bc48f6f35.tar.bz2
libpam-freerdp2-d67a26ba2585bd8bc74fed85e3ba0f4bc48f6f35.zip
Handle URLs as the remote host value. Approved by Albert Astals Cid, jenkins.
Diffstat (limited to 'src/pam-freerdp.c')
-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..d1a6578 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) {
+ char * subloc = strstr(retval, "://");
+ if (subloc != NULL) {
+ char * original = retval;
+ char * newish = subloc + strlen("://");
+ char * endslash = strstr(newish, "/");
+
+ if (endslash != NULL) {
+ endslash[0] = '\0';
+ }
+
+ retval = strdup(newish);
+ free(original);
+ }
+ }
+
return retval;
}