From e6057a3d8492702fb5aeffd286f1b6cde1e04f6b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 19 Sep 2012 15:52:24 -0500 Subject: Check for spaces in the username, block them --- src/pam-freerdp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) { -- cgit v1.2.3