aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-09-19 15:52:24 -0500
committerTed Gould <ted@gould.cx>2012-09-19 15:52:24 -0500
commit7bcc0a5ff26e00089a7821efd55d241de9a3a985 (patch)
tree5ae9c9e90d8fda96ceeec4f7792849cf9895e9da /src
parent0be6edb877829f491d491e8b0fb7d06916bef499 (diff)
downloadlibpam-x2go-7bcc0a5ff26e00089a7821efd55d241de9a3a985.tar.gz
libpam-x2go-7bcc0a5ff26e00089a7821efd55d241de9a3a985.tar.bz2
libpam-x2go-7bcc0a5ff26e00089a7821efd55d241de9a3a985.zip
Check for spaces in the username, block them
Diffstat (limited to 'src')
-rw-r--r--src/pam-freerdp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/pam-freerdp.c b/src/pam-freerdp.c
index ebc98af..607e215 100644
--- a/src/pam-freerdp.c
+++ b/src/pam-freerdp.c
@@ -126,6 +126,18 @@ 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) {