diff options
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 99eeaa17ee00..e3bc39bb9d12 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -1061,6 +1061,7 @@ static int cifs_parse_security_flavors(char *value, | |||
1061 | #endif | 1061 | #endif |
1062 | case Opt_sec_none: | 1062 | case Opt_sec_none: |
1063 | vol->nullauth = 1; | 1063 | vol->nullauth = 1; |
1064 | vol->secFlg |= CIFSSEC_MAY_NTLM; | ||
1064 | break; | 1065 | break; |
1065 | default: | 1066 | default: |
1066 | cifs_dbg(VFS, "bad security option: %s\n", value); | 1067 | cifs_dbg(VFS, "bad security option: %s\n", value); |
@@ -1257,14 +1258,18 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, | |||
1257 | vol->backupuid_specified = false; /* no backup intent for a user */ | 1258 | vol->backupuid_specified = false; /* no backup intent for a user */ |
1258 | vol->backupgid_specified = false; /* no backup intent for a group */ | 1259 | vol->backupgid_specified = false; /* no backup intent for a group */ |
1259 | 1260 | ||
1260 | /* | 1261 | switch (cifs_parse_devname(devname, vol)) { |
1261 | * For now, we ignore -EINVAL errors under the assumption that the | 1262 | case 0: |
1262 | * unc= and prefixpath= options will be usable. | 1263 | break; |
1263 | */ | 1264 | case -ENOMEM: |
1264 | if (cifs_parse_devname(devname, vol) == -ENOMEM) { | 1265 | cifs_dbg(VFS, "Unable to allocate memory for devname.\n"); |
1265 | printk(KERN_ERR "CIFS: Unable to allocate memory to parse " | 1266 | goto cifs_parse_mount_err; |
1266 | "device string.\n"); | 1267 | case -EINVAL: |
1267 | goto out_nomem; | 1268 | cifs_dbg(VFS, "Malformed UNC in devname.\n"); |
1269 | goto cifs_parse_mount_err; | ||
1270 | default: | ||
1271 | cifs_dbg(VFS, "Unknown error parsing devname.\n"); | ||
1272 | goto cifs_parse_mount_err; | ||
1268 | } | 1273 | } |
1269 | 1274 | ||
1270 | while ((data = strsep(&options, separator)) != NULL) { | 1275 | while ((data = strsep(&options, separator)) != NULL) { |
@@ -1826,7 +1831,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, | |||
1826 | } | 1831 | } |
1827 | #endif | 1832 | #endif |
1828 | if (!vol->UNC) { | 1833 | if (!vol->UNC) { |
1829 | cifs_dbg(VFS, "CIFS mount error: No usable UNC path provided in device string or in unc= option!\n"); | 1834 | cifs_dbg(VFS, "CIFS mount error: No usable UNC path provided in device string!\n"); |
1830 | goto cifs_parse_mount_err; | 1835 | goto cifs_parse_mount_err; |
1831 | } | 1836 | } |
1832 | 1837 | ||
@@ -3274,8 +3279,8 @@ build_unc_path_to_root(const struct smb_vol *vol, | |||
3274 | pos = full_path + unc_len; | 3279 | pos = full_path + unc_len; |
3275 | 3280 | ||
3276 | if (pplen) { | 3281 | if (pplen) { |
3277 | *pos++ = CIFS_DIR_SEP(cifs_sb); | 3282 | *pos = CIFS_DIR_SEP(cifs_sb); |
3278 | strncpy(pos, vol->prepath, pplen); | 3283 | strncpy(pos + 1, vol->prepath, pplen); |
3279 | pos += pplen; | 3284 | pos += pplen; |
3280 | } | 3285 | } |
3281 | 3286 | ||