diff options
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 4aa81a507b74..97f4311b9a8e 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/namei.h> | 35 | #include <linux/namei.h> |
36 | #include <asm/uaccess.h> | 36 | #include <asm/uaccess.h> |
37 | #include <asm/processor.h> | 37 | #include <asm/processor.h> |
38 | #include <linux/inet.h> | ||
38 | #include <net/ipv6.h> | 39 | #include <net/ipv6.h> |
39 | #include "cifspdu.h" | 40 | #include "cifspdu.h" |
40 | #include "cifsglob.h" | 41 | #include "cifsglob.h" |
@@ -61,7 +62,6 @@ struct smb_vol { | |||
61 | char *domainname; | 62 | char *domainname; |
62 | char *UNC; | 63 | char *UNC; |
63 | char *UNCip; | 64 | char *UNCip; |
64 | char *in6_addr; /* ipv6 address as human readable form of in6_addr */ | ||
65 | char *iocharset; /* local code page for mapping to and from Unicode */ | 65 | char *iocharset; /* local code page for mapping to and from Unicode */ |
66 | char source_rfc1001_name[16]; /* netbios name of client */ | 66 | char source_rfc1001_name[16]; /* netbios name of client */ |
67 | char target_rfc1001_name[16]; /* netbios name of server for Win9x/ME */ | 67 | char target_rfc1001_name[16]; /* netbios name of server for Win9x/ME */ |
@@ -827,14 +827,16 @@ cifs_parse_mount_options(char *options, const char *devname, | |||
827 | vol->target_rfc1001_name[0] = 0; | 827 | vol->target_rfc1001_name[0] = 0; |
828 | vol->linux_uid = current_uid(); /* use current_euid() instead? */ | 828 | vol->linux_uid = current_uid(); /* use current_euid() instead? */ |
829 | vol->linux_gid = current_gid(); | 829 | vol->linux_gid = current_gid(); |
830 | vol->dir_mode = S_IRWXUGO; | 830 | |
831 | /* 2767 perms indicate mandatory locking support */ | 831 | /* default to only allowing write access to owner of the mount */ |
832 | vol->file_mode = (S_IRWXUGO | S_ISGID) & (~S_IXGRP); | 832 | vol->dir_mode = vol->file_mode = S_IRUGO | S_IXUGO | S_IWUSR; |
833 | 833 | ||
834 | /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */ | 834 | /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */ |
835 | vol->rw = true; | 835 | vol->rw = true; |
836 | /* default is always to request posix paths. */ | 836 | /* default is always to request posix paths. */ |
837 | vol->posix_paths = 1; | 837 | vol->posix_paths = 1; |
838 | /* default to using server inode numbers where available */ | ||
839 | vol->server_ino = 1; | ||
838 | 840 | ||
839 | if (!options) | 841 | if (!options) |
840 | return 1; | 842 | return 1; |
@@ -955,10 +957,12 @@ cifs_parse_mount_options(char *options, const char *devname, | |||
955 | } | 957 | } |
956 | strcpy(vol->password, value); | 958 | strcpy(vol->password, value); |
957 | } | 959 | } |
958 | } else if (strnicmp(data, "ip", 2) == 0) { | 960 | } else if (!strnicmp(data, "ip", 2) || |
961 | !strnicmp(data, "addr", 4)) { | ||
959 | if (!value || !*value) { | 962 | if (!value || !*value) { |
960 | vol->UNCip = NULL; | 963 | vol->UNCip = NULL; |
961 | } else if (strnlen(value, 35) < 35) { | 964 | } else if (strnlen(value, INET6_ADDRSTRLEN) < |
965 | INET6_ADDRSTRLEN) { | ||
962 | vol->UNCip = value; | 966 | vol->UNCip = value; |
963 | } else { | 967 | } else { |
964 | printk(KERN_WARNING "CIFS: ip address " | 968 | printk(KERN_WARNING "CIFS: ip address " |
@@ -1092,17 +1096,17 @@ cifs_parse_mount_options(char *options, const char *devname, | |||
1092 | return 1; | 1096 | return 1; |
1093 | } | 1097 | } |
1094 | } else if (strnicmp(data, "uid", 3) == 0) { | 1098 | } else if (strnicmp(data, "uid", 3) == 0) { |
1095 | if (value && *value) { | 1099 | if (value && *value) |
1096 | vol->linux_uid = | 1100 | vol->linux_uid = |
1097 | simple_strtoul(value, &value, 0); | 1101 | simple_strtoul(value, &value, 0); |
1102 | } else if (strnicmp(data, "forceuid", 8) == 0) { | ||
1098 | vol->override_uid = 1; | 1103 | vol->override_uid = 1; |
1099 | } | ||
1100 | } else if (strnicmp(data, "gid", 3) == 0) { | 1104 | } else if (strnicmp(data, "gid", 3) == 0) { |
1101 | if (value && *value) { | 1105 | if (value && *value) |
1102 | vol->linux_gid = | 1106 | vol->linux_gid = |
1103 | simple_strtoul(value, &value, 0); | 1107 | simple_strtoul(value, &value, 0); |
1108 | } else if (strnicmp(data, "forcegid", 8) == 0) { | ||
1104 | vol->override_gid = 1; | 1109 | vol->override_gid = 1; |
1105 | } | ||
1106 | } else if (strnicmp(data, "file_mode", 4) == 0) { | 1110 | } else if (strnicmp(data, "file_mode", 4) == 0) { |
1107 | if (value && *value) { | 1111 | if (value && *value) { |
1108 | vol->file_mode = | 1112 | vol->file_mode = |
@@ -1315,16 +1319,6 @@ cifs_parse_mount_options(char *options, const char *devname, | |||
1315 | vol->direct_io = 1; | 1319 | vol->direct_io = 1; |
1316 | } else if (strnicmp(data, "forcedirectio", 13) == 0) { | 1320 | } else if (strnicmp(data, "forcedirectio", 13) == 0) { |
1317 | vol->direct_io = 1; | 1321 | vol->direct_io = 1; |
1318 | } else if (strnicmp(data, "in6_addr", 8) == 0) { | ||
1319 | if (!value || !*value) { | ||
1320 | vol->in6_addr = NULL; | ||
1321 | } else if (strnlen(value, 49) == 48) { | ||
1322 | vol->in6_addr = value; | ||
1323 | } else { | ||
1324 | printk(KERN_WARNING "CIFS: ip v6 address not " | ||
1325 | "48 characters long\n"); | ||
1326 | return 1; | ||
1327 | } | ||
1328 | } else if (strnicmp(data, "noac", 4) == 0) { | 1322 | } else if (strnicmp(data, "noac", 4) == 0) { |
1329 | printk(KERN_WARNING "CIFS: Mount option noac not " | 1323 | printk(KERN_WARNING "CIFS: Mount option noac not " |
1330 | "supported. Instead set " | 1324 | "supported. Instead set " |