Skip to content

Commit

Permalink
Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
Browse files Browse the repository at this point in the history
Pull CIFS fix from Steve French:
 "Fixes a regression in cifs in which a password which begins with a
  comma is parsed incorrectly as a blank password"

* 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: Allow passwords which begin with a delimitor
  • Loading branch information
torvalds committed Apr 12, 2013
2 parents 6074fff + c369c9a commit 0b1fd26
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -1575,14 +1575,24 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
}
break;
case Opt_blank_pass:
vol->password = NULL;
break;
case Opt_pass:
/* passwords have to be handled differently
* to allow the character used for deliminator
* to be passed within them
*/

/*
* Check if this is a case where the password
* starts with a delimiter
*/
tmp_end = strchr(data, '=');
tmp_end++;
if (!(tmp_end < end && tmp_end[1] == delim)) {
/* No it is not. Set the password to NULL */
vol->password = NULL;
break;
}
/* Yes it is. Drop down to Opt_pass below.*/
case Opt_pass:
/* Obtain the value string */
value = strchr(data, '=');
value++;
Expand Down

0 comments on commit 0b1fd26

Please sign in to comment.