@@ -109,6 +109,8 @@ enum {
109
109
110
110
/* Options which could be blank */
111
111
Opt_blank_pass ,
112
+ Opt_blank_user ,
113
+ Opt_blank_ip ,
112
114
113
115
Opt_err
114
116
};
@@ -183,11 +185,15 @@ static const match_table_t cifs_mount_option_tokens = {
183
185
{ Opt_wsize , "wsize=%s" },
184
186
{ Opt_actimeo , "actimeo=%s" },
185
187
188
+ { Opt_blank_user , "user=" },
189
+ { Opt_blank_user , "username=" },
186
190
{ Opt_user , "user=%s" },
187
191
{ Opt_user , "username=%s" },
188
192
{ Opt_blank_pass , "pass=" },
189
193
{ Opt_pass , "pass=%s" },
190
194
{ Opt_pass , "password=%s" },
195
+ { Opt_blank_ip , "ip=" },
196
+ { Opt_blank_ip , "addr=" },
191
197
{ Opt_ip , "ip=%s" },
192
198
{ Opt_ip , "addr=%s" },
193
199
{ Opt_unc , "unc=%s" },
@@ -1117,7 +1123,7 @@ static int get_option_ul(substring_t args[], unsigned long *option)
1117
1123
string = match_strdup (args );
1118
1124
if (string == NULL )
1119
1125
return - ENOMEM ;
1120
- rc = kstrtoul (string , 10 , option );
1126
+ rc = kstrtoul (string , 0 , option );
1121
1127
kfree (string );
1122
1128
1123
1129
return rc ;
@@ -1534,15 +1540,17 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1534
1540
1535
1541
/* String Arguments */
1536
1542
1543
+ case Opt_blank_user :
1544
+ /* null user, ie. anonymous authentication */
1545
+ vol -> nullauth = 1 ;
1546
+ vol -> username = NULL ;
1547
+ break ;
1537
1548
case Opt_user :
1538
1549
string = match_strdup (args );
1539
1550
if (string == NULL )
1540
1551
goto out_nomem ;
1541
1552
1542
- if (!* string ) {
1543
- /* null user, ie. anonymous authentication */
1544
- vol -> nullauth = 1 ;
1545
- } else if (strnlen (string , MAX_USERNAME_SIZE ) >
1553
+ if (strnlen (string , MAX_USERNAME_SIZE ) >
1546
1554
MAX_USERNAME_SIZE ) {
1547
1555
printk (KERN_WARNING "CIFS: username too long\n" );
1548
1556
goto cifs_parse_mount_err ;
@@ -1611,14 +1619,15 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1611
1619
}
1612
1620
vol -> password [j ] = '\0' ;
1613
1621
break ;
1622
+ case Opt_blank_ip :
1623
+ vol -> UNCip = NULL ;
1624
+ break ;
1614
1625
case Opt_ip :
1615
1626
string = match_strdup (args );
1616
1627
if (string == NULL )
1617
1628
goto out_nomem ;
1618
1629
1619
- if (!* string ) {
1620
- vol -> UNCip = NULL ;
1621
- } else if (strnlen (string , INET6_ADDRSTRLEN ) >
1630
+ if (strnlen (string , INET6_ADDRSTRLEN ) >
1622
1631
INET6_ADDRSTRLEN ) {
1623
1632
printk (KERN_WARNING "CIFS: ip address "
1624
1633
"too long\n" );
@@ -1636,12 +1645,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1636
1645
if (string == NULL )
1637
1646
goto out_nomem ;
1638
1647
1639
- if (!* string ) {
1640
- printk (KERN_WARNING "CIFS: invalid path to "
1641
- "network resource\n" );
1642
- goto cifs_parse_mount_err ;
1643
- }
1644
-
1645
1648
temp_len = strnlen (string , 300 );
1646
1649
if (temp_len == 300 ) {
1647
1650
printk (KERN_WARNING "CIFS: UNC name too long\n" );
@@ -1670,11 +1673,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1670
1673
if (string == NULL )
1671
1674
goto out_nomem ;
1672
1675
1673
- if (!* string ) {
1674
- printk (KERN_WARNING "CIFS: invalid domain"
1675
- " name\n" );
1676
- goto cifs_parse_mount_err ;
1677
- } else if (strnlen (string , 256 ) == 256 ) {
1676
+ if (strnlen (string , 256 ) == 256 ) {
1678
1677
printk (KERN_WARNING "CIFS: domain name too"
1679
1678
" long\n" );
1680
1679
goto cifs_parse_mount_err ;
@@ -1693,11 +1692,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1693
1692
if (string == NULL )
1694
1693
goto out_nomem ;
1695
1694
1696
- if (!* string ) {
1697
- printk (KERN_WARNING "CIFS: srcaddr value not"
1698
- " specified\n" );
1699
- goto cifs_parse_mount_err ;
1700
- } else if (!cifs_convert_address (
1695
+ if (!cifs_convert_address (
1701
1696
(struct sockaddr * )& vol -> srcaddr ,
1702
1697
string , strlen (string ))) {
1703
1698
printk (KERN_WARNING "CIFS: Could not parse"
@@ -1710,11 +1705,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1710
1705
if (string == NULL )
1711
1706
goto out_nomem ;
1712
1707
1713
- if (!* string ) {
1714
- printk (KERN_WARNING "CIFS: Invalid path"
1715
- " prefix\n" );
1716
- goto cifs_parse_mount_err ;
1717
- }
1718
1708
temp_len = strnlen (string , 1024 );
1719
1709
if (string [0 ] != '/' )
1720
1710
temp_len ++ ; /* missing leading slash */
@@ -1742,11 +1732,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1742
1732
if (string == NULL )
1743
1733
goto out_nomem ;
1744
1734
1745
- if (!* string ) {
1746
- printk (KERN_WARNING "CIFS: Invalid iocharset"
1747
- " specified\n" );
1748
- goto cifs_parse_mount_err ;
1749
- } else if (strnlen (string , 1024 ) >= 65 ) {
1735
+ if (strnlen (string , 1024 ) >= 65 ) {
1750
1736
printk (KERN_WARNING "CIFS: iocharset name "
1751
1737
"too long.\n" );
1752
1738
goto cifs_parse_mount_err ;
@@ -1771,11 +1757,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1771
1757
if (string == NULL )
1772
1758
goto out_nomem ;
1773
1759
1774
- if (!* string ) {
1775
- printk (KERN_WARNING "CIFS: No socket option"
1776
- " specified\n" );
1777
- goto cifs_parse_mount_err ;
1778
- }
1779
1760
if (strnicmp (string , "TCP_NODELAY" , 11 ) == 0 )
1780
1761
vol -> sockopt_tcp_nodelay = 1 ;
1781
1762
break ;
@@ -1784,12 +1765,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1784
1765
if (string == NULL )
1785
1766
goto out_nomem ;
1786
1767
1787
- if (!* string ) {
1788
- printk (KERN_WARNING "CIFS: Invalid (empty)"
1789
- " netbiosname\n" );
1790
- break ;
1791
- }
1792
-
1793
1768
memset (vol -> source_rfc1001_name , 0x20 ,
1794
1769
RFC1001_NAME_LEN );
1795
1770
/*
@@ -1817,11 +1792,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1817
1792
if (string == NULL )
1818
1793
goto out_nomem ;
1819
1794
1820
- if (!* string ) {
1821
- printk (KERN_WARNING "CIFS: Empty server"
1822
- " netbiosname specified\n" );
1823
- break ;
1824
- }
1825
1795
/* last byte, type, is 0x20 for servr type */
1826
1796
memset (vol -> target_rfc1001_name , 0x20 ,
1827
1797
RFC1001_NAME_LEN_WITH_NULL );
@@ -1848,12 +1818,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1848
1818
if (string == NULL )
1849
1819
goto out_nomem ;
1850
1820
1851
- if (!* string ) {
1852
- cERROR (1 , "no protocol version specified"
1853
- " after vers= mount option" );
1854
- goto cifs_parse_mount_err ;
1855
- }
1856
-
1857
1821
if (strnicmp (string , "cifs" , 4 ) == 0 ||
1858
1822
strnicmp (string , "1" , 1 ) == 0 ) {
1859
1823
/* This is the default */
@@ -1868,12 +1832,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1868
1832
if (string == NULL )
1869
1833
goto out_nomem ;
1870
1834
1871
- if (!* string ) {
1872
- printk (KERN_WARNING "CIFS: no security flavor"
1873
- " specified\n" );
1874
- break ;
1875
- }
1876
-
1877
1835
if (cifs_parse_security_flavors (string , vol ) != 0 )
1878
1836
goto cifs_parse_mount_err ;
1879
1837
break ;
0 commit comments