diff options
author | Ted Gould <ted@gould.cx> | 2012-09-20 08:09:55 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2012-09-20 08:09:55 +0000 |
commit | aa87c8fac598ef6e79a65d6f2eec93d8a4693063 (patch) | |
tree | 5ae9c9e90d8fda96ceeec4f7792849cf9895e9da | |
parent | b7d9fbfb09f346f8d597b00daca797b2812de5ac (diff) | |
parent | e6057a3d8492702fb5aeffd286f1b6cde1e04f6b (diff) | |
download | libpam-freerdp2-aa87c8fac598ef6e79a65d6f2eec93d8a4693063.tar.gz libpam-freerdp2-aa87c8fac598ef6e79a65d6f2eec93d8a4693063.tar.bz2 libpam-freerdp2-aa87c8fac598ef6e79a65d6f2eec93d8a4693063.zip |
Block usernames with spaces. Approved by Albert Astals Cid, jenkins.
-rw-r--r-- | src/pam-freerdp.c | 12 |
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) { |