lkml.org 
[lkml]   [2013]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 57/72] cifs: Allow passwords which begin with a delimitor
    Date
    3.5.7.11 -stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Sachin Prabhu <sprabhu@redhat.com>

    commit c369c9a4a7c82d33329d869cbaf93304cc7a0c40 upstream.

    Fixes a regression in cifs_parse_mount_options where a password
    which begins with a delimitor is parsed incorrectly as being a blank
    password.

    Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
    Acked-by: Jeff Layton <jlayton@redhat.com>
    Signed-off-by: Steve French <sfrench@us.ibm.com>
    Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
    ---
    fs/cifs/connect.c | 16 +++++++++++++---
    1 file changed, 13 insertions(+), 3 deletions(-)

    diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
    index f027c2b..9169ae3 100644
    --- a/fs/cifs/connect.c
    +++ b/fs/cifs/connect.c
    @@ -1644,14 +1644,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++;
    --
    1.8.1.2


    \
     
     \ /
      Last update: 2013-04-18 12:01    [W:3.212 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site