@@ -82,6 +82,12 @@ struct smb_vol {
82
82
unsigned remap :1 ; /* set to remap seven reserved chars in filenames */
83
83
unsigned posix_paths :1 ; /* unset to not ask for posix pathnames. */
84
84
unsigned sfu_emul :1 ;
85
+ unsigned krb5 :1 ;
86
+ unsigned ntlm :1 ;
87
+ unsigned ntlmv2 :1 ;
88
+ unsigned nullauth :1 ; /* attempt to authenticate with null user */
89
+ unsigned sign :1 ;
90
+ unsigned seal :1 ; /* encrypt */
85
91
unsigned nocase ; /* request case insensitive filenames */
86
92
unsigned nobrl ; /* disable sending byte range locks to srv */
87
93
unsigned int rsize ;
@@ -777,7 +783,7 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol)
777
783
778
784
/* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */
779
785
vol -> rw = TRUE;
780
-
786
+ vol -> ntlm = TRUE;
781
787
/* default is always to request posix paths. */
782
788
vol -> posix_paths = 1 ;
783
789
@@ -903,6 +909,39 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol)
903
909
printk (KERN_WARNING "CIFS: ip address too long\n" );
904
910
return 1 ;
905
911
}
912
+ } else if (strnicmp (data , "sec" , 3 ) == 0 ) {
913
+ if (!value || !* value ) {
914
+ cERROR (1 ,("no security value specified" ));
915
+ continue ;
916
+ } else if (strnicmp (value , "krb5i" , 5 ) == 0 ) {
917
+ vol -> sign = 1 ;
918
+ vol -> krb5 = 1 ;
919
+ } else if (strnicmp (value , "krb5p" , 5 ) == 0 ) {
920
+ /* vol->seal = 1;
921
+ vol->krb5 = 1; */
922
+ cERROR (1 ,("Krb5 cifs privacy not supported" ));
923
+ return 1 ;
924
+ } else if (strnicmp (value , "krb5" , 4 ) == 0 ) {
925
+ vol -> krb5 = 1 ;
926
+ } else if (strnicmp (value , "ntlmv2i" , 7 ) == 0 ) {
927
+ vol -> ntlmv2 = 1 ;
928
+ vol -> sign = 1 ;
929
+ } else if (strnicmp (value , "ntlmv2" , 6 ) == 0 ) {
930
+ vol -> ntlmv2 = 1 ;
931
+ } else if (strnicmp (value , "ntlmi" , 5 ) == 0 ) {
932
+ vol -> ntlm = 1 ;
933
+ vol -> sign = 1 ;
934
+ } else if (strnicmp (value , "ntlm" , 4 ) == 0 ) {
935
+ /* ntlm is default so can be turned off too */
936
+ vol -> ntlm = 1 ;
937
+ } else if (strnicmp (value , "nontlm" , 6 ) == 0 ) {
938
+ vol -> ntlm = 0 ;
939
+ } else if (strnicmp (value , "none" , 4 ) == 0 ) {
940
+ vol -> nullauth = 1 ;
941
+ } else {
942
+ cERROR (1 ,("bad security option: %s" , value ));
943
+ return 1 ;
944
+ }
906
945
} else if ((strnicmp (data , "unc" , 3 ) == 0 )
907
946
|| (strnicmp (data , "target" , 6 ) == 0 )
908
947
|| (strnicmp (data , "path" , 4 ) == 0 )) {
@@ -1546,7 +1585,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
1546
1585
cFYI (1 , ("Username: %s " , volume_info .username ));
1547
1586
1548
1587
} else {
1549
- cifserror ("No username specified " );
1588
+ cifserror ("No username specified" );
1550
1589
/* In userspace mount helper we can get user name from alternate
1551
1590
locations such as env variables and files on disk */
1552
1591
kfree (volume_info .UNC );
@@ -1587,7 +1626,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
1587
1626
return - EINVAL ;
1588
1627
} else /* which servers DFS root would we conect to */ {
1589
1628
cERROR (1 ,
1590
- ("CIFS mount error: No UNC path (e.g. -o unc=//192.168.1.100/public) specified " ));
1629
+ ("CIFS mount error: No UNC path (e.g. -o unc=//192.168.1.100/public) specified" ));
1591
1630
kfree (volume_info .UNC );
1592
1631
kfree (volume_info .password );
1593
1632
FreeXid (xid );
@@ -1626,7 +1665,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
1626
1665
1627
1666
1628
1667
if (srvTcp ) {
1629
- cFYI (1 , ("Existing tcp session with server found " ));
1668
+ cFYI (1 , ("Existing tcp session with server found" ));
1630
1669
} else { /* create socket */
1631
1670
if (volume_info .port )
1632
1671
sin_server .sin_port = htons (volume_info .port );
@@ -1689,11 +1728,11 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
1689
1728
1690
1729
if (existingCifsSes ) {
1691
1730
pSesInfo = existingCifsSes ;
1692
- cFYI (1 , ("Existing smb sess found " ));
1731
+ cFYI (1 , ("Existing smb sess found" ));
1693
1732
kfree (volume_info .password );
1694
1733
/* volume_info.UNC freed at end of function */
1695
1734
} else if (!rc ) {
1696
- cFYI (1 , ("Existing smb sess not found " ));
1735
+ cFYI (1 , ("Existing smb sess not found" ));
1697
1736
pSesInfo = sesInfoAlloc ();
1698
1737
if (pSesInfo == NULL )
1699
1738
rc = - ENOMEM ;
@@ -1777,7 +1816,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
1777
1816
find_unc (sin_server .sin_addr .s_addr , volume_info .UNC ,
1778
1817
volume_info .username );
1779
1818
if (tcon ) {
1780
- cFYI (1 , ("Found match on UNC path " ));
1819
+ cFYI (1 , ("Found match on UNC path" ));
1781
1820
/* we can have only one retry value for a connection
1782
1821
to a share so for resources mounted more than once
1783
1822
to the same server share the last value passed in
0 commit comments