diff options
author | Jeff Layton <jlayton@redhat.com> | 2013-05-26 07:01:00 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2013-06-24 02:56:43 -0400 |
commit | 28e11bd86d63ce18b481cd9f90bd5fa1b5ba746b (patch) | |
tree | a039b42511ec25fc96827f5bb894270965624a05 /fs/cifs | |
parent | e598d1d8fb512c7a4d86c729cdca30e87fe7cfc9 (diff) |
cifs: add new fields to cifs_ses to track requested security flavor
Currently we have the overrideSecFlg field, but it's quite cumbersome
to work with. Add some new fields that will eventually supercede it.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsfs.c | 11 | ||||
-rw-r--r-- | fs/cifs/cifsglob.h | 2 | ||||
-rw-r--r-- | fs/cifs/connect.c | 4 |
3 files changed, 13 insertions, 4 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 3752b9f6d9e4..0f36654f22d0 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -312,11 +312,14 @@ cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server) | |||
312 | } | 312 | } |
313 | 313 | ||
314 | static void | 314 | static void |
315 | cifs_show_security(struct seq_file *s, struct TCP_Server_Info *server) | 315 | cifs_show_security(struct seq_file *s, struct cifs_ses *ses) |
316 | { | 316 | { |
317 | if (ses->sectype == Unspecified) | ||
318 | return; | ||
319 | |||
317 | seq_printf(s, ",sec="); | 320 | seq_printf(s, ",sec="); |
318 | 321 | ||
319 | switch (server->secType) { | 322 | switch (ses->sectype) { |
320 | case LANMAN: | 323 | case LANMAN: |
321 | seq_printf(s, "lanman"); | 324 | seq_printf(s, "lanman"); |
322 | break; | 325 | break; |
@@ -338,7 +341,7 @@ cifs_show_security(struct seq_file *s, struct TCP_Server_Info *server) | |||
338 | break; | 341 | break; |
339 | } | 342 | } |
340 | 343 | ||
341 | if (server->sec_mode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) | 344 | if (ses->sign) |
342 | seq_printf(s, "i"); | 345 | seq_printf(s, "i"); |
343 | } | 346 | } |
344 | 347 | ||
@@ -369,7 +372,7 @@ cifs_show_options(struct seq_file *s, struct dentry *root) | |||
369 | srcaddr = (struct sockaddr *)&tcon->ses->server->srcaddr; | 372 | srcaddr = (struct sockaddr *)&tcon->ses->server->srcaddr; |
370 | 373 | ||
371 | seq_printf(s, ",vers=%s", tcon->ses->server->vals->version_string); | 374 | seq_printf(s, ",vers=%s", tcon->ses->server->vals->version_string); |
372 | cifs_show_security(s, tcon->ses->server); | 375 | cifs_show_security(s, tcon->ses); |
373 | cifs_show_cache_flavor(s, cifs_sb); | 376 | cifs_show_cache_flavor(s, cifs_sb); |
374 | 377 | ||
375 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER) | 378 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER) |
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 82ba4b974894..87d92e35e991 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -712,6 +712,8 @@ struct cifs_ses { | |||
712 | char *password; | 712 | char *password; |
713 | struct session_key auth_key; | 713 | struct session_key auth_key; |
714 | struct ntlmssp_auth *ntlmssp; /* ciphertext, flags, server challenge */ | 714 | struct ntlmssp_auth *ntlmssp; /* ciphertext, flags, server challenge */ |
715 | enum securityEnum sectype; /* what security flavor was specified? */ | ||
716 | bool sign; /* is signing required? */ | ||
715 | bool need_reconnect:1; /* connection reset, uid now invalid */ | 717 | bool need_reconnect:1; /* connection reset, uid now invalid */ |
716 | #ifdef CONFIG_CIFS_SMB2 | 718 | #ifdef CONFIG_CIFS_SMB2 |
717 | __u16 session_flags; | 719 | __u16 session_flags; |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 160134902233..2a8b2107ad5f 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -2501,6 +2501,8 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) | |||
2501 | ses->linux_uid = volume_info->linux_uid; | 2501 | ses->linux_uid = volume_info->linux_uid; |
2502 | 2502 | ||
2503 | ses->overrideSecFlg = volume_info->secFlg; | 2503 | ses->overrideSecFlg = volume_info->secFlg; |
2504 | ses->sectype = volume_info->sectype; | ||
2505 | ses->sign = volume_info->sign; | ||
2504 | 2506 | ||
2505 | mutex_lock(&ses->session_mutex); | 2507 | mutex_lock(&ses->session_mutex); |
2506 | rc = cifs_negotiate_protocol(xid, ses); | 2508 | rc = cifs_negotiate_protocol(xid, ses); |
@@ -3918,6 +3920,8 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid) | |||
3918 | vol_info->nocase = master_tcon->nocase; | 3920 | vol_info->nocase = master_tcon->nocase; |
3919 | vol_info->local_lease = master_tcon->local_lease; | 3921 | vol_info->local_lease = master_tcon->local_lease; |
3920 | vol_info->no_linux_ext = !master_tcon->unix_ext; | 3922 | vol_info->no_linux_ext = !master_tcon->unix_ext; |
3923 | vol_info->sectype = master_tcon->ses->sectype; | ||
3924 | vol_info->sign = master_tcon->ses->sign; | ||
3921 | 3925 | ||
3922 | rc = cifs_set_vol_auth(vol_info, master_tcon->ses); | 3926 | rc = cifs_set_vol_auth(vol_info, master_tcon->ses); |
3923 | if (rc) { | 3927 | if (rc) { |