diff options
author | Steve French <sfrench@us.ibm.com> | 2006-05-31 18:40:51 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2006-05-31 18:40:51 -0400 |
commit | 3979877e5606ecc58c5a31bd0078c6d80ba9cbe7 (patch) | |
tree | d221455b5176ea8b26e750d6498c3ed822998ba3 /fs/cifs/cifs_debug.c | |
parent | 26a21b980b1897b11fd7f9ba4bf6060c9e15df10 (diff) |
[CIFS] Support for setting up SMB sessions to legacy lanman servers
Diffstat (limited to 'fs/cifs/cifs_debug.c')
-rw-r--r-- | fs/cifs/cifs_debug.c | 84 |
1 files changed, 71 insertions, 13 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index f4124a32bef8..7f4013a8607f 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c | |||
@@ -39,7 +39,7 @@ cifs_dump_mem(char *label, void *data, int length) | |||
39 | char *charptr = data; | 39 | char *charptr = data; |
40 | char buf[10], line[80]; | 40 | char buf[10], line[80]; |
41 | 41 | ||
42 | printk(KERN_DEBUG "%s: dump of %d bytes of data at 0x%p\n\n", | 42 | printk(KERN_DEBUG "%s: dump of %d bytes of data at 0x%p\n", |
43 | label, length, data); | 43 | label, length, data); |
44 | for (i = 0; i < length; i += 16) { | 44 | for (i = 0; i < length; i += 16) { |
45 | line[0] = 0; | 45 | line[0] = 0; |
@@ -57,6 +57,57 @@ cifs_dump_mem(char *label, void *data, int length) | |||
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 | ||
60 | #ifdef CONFIG_CIFS_DEBUG2 | ||
61 | void cifs_dump_detail(struct smb_hdr * smb) | ||
62 | { | ||
63 | cERROR(1,("Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d", | ||
64 | smb->Command, smb->Status.CifsError, | ||
65 | smb->Flags, smb->Flags2, smb->Mid, smb->Pid)); | ||
66 | cERROR(1,("smb buf %p len %d", smb, smbCalcSize_LE(smb))); | ||
67 | } | ||
68 | |||
69 | |||
70 | void cifs_dump_mids(struct TCP_Server_Info * server) | ||
71 | { | ||
72 | struct list_head *tmp; | ||
73 | struct mid_q_entry * mid_entry; | ||
74 | |||
75 | if(server == NULL) | ||
76 | return; | ||
77 | |||
78 | cERROR(1,("Dump pending requests:")); | ||
79 | spin_lock(&GlobalMid_Lock); | ||
80 | list_for_each(tmp, &server->pending_mid_q) { | ||
81 | mid_entry = list_entry(tmp, struct mid_q_entry, qhead); | ||
82 | if(mid_entry) { | ||
83 | cERROR(1,("State: %d Cmd: %d Pid: %d Tsk: %p Mid %d", | ||
84 | mid_entry->midState, | ||
85 | (int)mid_entry->command, | ||
86 | mid_entry->pid, | ||
87 | mid_entry->tsk, | ||
88 | mid_entry->mid)); | ||
89 | #ifdef CONFIG_CIFS_STATS2 | ||
90 | cERROR(1,("IsLarge: %d buf: %p time rcv: %ld now: %ld", | ||
91 | mid_entry->largeBuf, | ||
92 | mid_entry->resp_buf, | ||
93 | mid_entry->when_received, | ||
94 | jiffies)); | ||
95 | #endif /* STATS2 */ | ||
96 | cERROR(1,("IsMult: %d IsEnd: %d", mid_entry->multiRsp, | ||
97 | mid_entry->multiEnd)); | ||
98 | if(mid_entry->resp_buf) { | ||
99 | cifs_dump_detail(mid_entry->resp_buf); | ||
100 | cifs_dump_mem("existing buf: ", | ||
101 | mid_entry->resp_buf, | ||
102 | 62 /* fixme */); | ||
103 | } | ||
104 | |||
105 | } | ||
106 | } | ||
107 | spin_unlock(&GlobalMid_Lock); | ||
108 | } | ||
109 | #endif /* CONFIG_CIFS_DEBUG2 */ | ||
110 | |||
60 | #ifdef CONFIG_PROC_FS | 111 | #ifdef CONFIG_PROC_FS |
61 | static int | 112 | static int |
62 | cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | 113 | cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, |
@@ -73,7 +124,6 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
73 | 124 | ||
74 | *beginBuffer = buf + offset; | 125 | *beginBuffer = buf + offset; |
75 | 126 | ||
76 | |||
77 | length = | 127 | length = |
78 | sprintf(buf, | 128 | sprintf(buf, |
79 | "Display Internal CIFS Data Structures for Debugging\n" | 129 | "Display Internal CIFS Data Structures for Debugging\n" |
@@ -397,10 +447,10 @@ static read_proc_t multiuser_mount_read; | |||
397 | static write_proc_t multiuser_mount_write; | 447 | static write_proc_t multiuser_mount_write; |
398 | static read_proc_t extended_security_read; | 448 | static read_proc_t extended_security_read; |
399 | static write_proc_t extended_security_write; | 449 | static write_proc_t extended_security_write; |
400 | static read_proc_t ntlmv2_enabled_read; | 450 | /* static read_proc_t ntlmv2_enabled_read; |
401 | static write_proc_t ntlmv2_enabled_write; | 451 | static write_proc_t ntlmv2_enabled_write; |
402 | static read_proc_t packet_signing_enabled_read; | 452 | static read_proc_t packet_signing_enabled_read; |
403 | static write_proc_t packet_signing_enabled_write; | 453 | static write_proc_t packet_signing_enabled_write;*/ |
404 | static read_proc_t experimEnabled_read; | 454 | static read_proc_t experimEnabled_read; |
405 | static write_proc_t experimEnabled_write; | 455 | static write_proc_t experimEnabled_write; |
406 | static read_proc_t linuxExtensionsEnabled_read; | 456 | static read_proc_t linuxExtensionsEnabled_read; |
@@ -469,7 +519,7 @@ cifs_proc_init(void) | |||
469 | if (pde) | 519 | if (pde) |
470 | pde->write_proc = lookupFlag_write; | 520 | pde->write_proc = lookupFlag_write; |
471 | 521 | ||
472 | pde = | 522 | /* pde = |
473 | create_proc_read_entry("NTLMV2Enabled", 0, proc_fs_cifs, | 523 | create_proc_read_entry("NTLMV2Enabled", 0, proc_fs_cifs, |
474 | ntlmv2_enabled_read, NULL); | 524 | ntlmv2_enabled_read, NULL); |
475 | if (pde) | 525 | if (pde) |
@@ -479,7 +529,7 @@ cifs_proc_init(void) | |||
479 | create_proc_read_entry("PacketSigningEnabled", 0, proc_fs_cifs, | 529 | create_proc_read_entry("PacketSigningEnabled", 0, proc_fs_cifs, |
480 | packet_signing_enabled_read, NULL); | 530 | packet_signing_enabled_read, NULL); |
481 | if (pde) | 531 | if (pde) |
482 | pde->write_proc = packet_signing_enabled_write; | 532 | pde->write_proc = packet_signing_enabled_write;*/ |
483 | } | 533 | } |
484 | 534 | ||
485 | void | 535 | void |
@@ -496,9 +546,9 @@ cifs_proc_clean(void) | |||
496 | #endif | 546 | #endif |
497 | remove_proc_entry("MultiuserMount", proc_fs_cifs); | 547 | remove_proc_entry("MultiuserMount", proc_fs_cifs); |
498 | remove_proc_entry("OplockEnabled", proc_fs_cifs); | 548 | remove_proc_entry("OplockEnabled", proc_fs_cifs); |
499 | remove_proc_entry("NTLMV2Enabled",proc_fs_cifs); | 549 | /* remove_proc_entry("NTLMV2Enabled",proc_fs_cifs); */ |
500 | remove_proc_entry("ExtendedSecurity",proc_fs_cifs); | 550 | remove_proc_entry("ExtendedSecurity",proc_fs_cifs); |
501 | remove_proc_entry("PacketSigningEnabled",proc_fs_cifs); | 551 | /* remove_proc_entry("PacketSigningEnabled",proc_fs_cifs); */ |
502 | remove_proc_entry("LinuxExtensionsEnabled",proc_fs_cifs); | 552 | remove_proc_entry("LinuxExtensionsEnabled",proc_fs_cifs); |
503 | remove_proc_entry("Experimental",proc_fs_cifs); | 553 | remove_proc_entry("Experimental",proc_fs_cifs); |
504 | remove_proc_entry("LookupCacheEnabled",proc_fs_cifs); | 554 | remove_proc_entry("LookupCacheEnabled",proc_fs_cifs); |
@@ -787,7 +837,7 @@ extended_security_read(char *page, char **start, off_t off, | |||
787 | { | 837 | { |
788 | int len; | 838 | int len; |
789 | 839 | ||
790 | len = sprintf(page, "%d\n", extended_security); | 840 | len = sprintf(page, "0x%x\n", extended_security); |
791 | 841 | ||
792 | len -= off; | 842 | len -= off; |
793 | *start = page + off; | 843 | *start = page + off; |
@@ -808,19 +858,25 @@ extended_security_write(struct file *file, const char __user *buffer, | |||
808 | { | 858 | { |
809 | char c; | 859 | char c; |
810 | int rc; | 860 | int rc; |
861 | cERROR(1,("size %ld",count)); /* BB removeme BB */ | ||
862 | if((count < 2) || (count > 8)) | ||
863 | return -EINVAL; | ||
811 | 864 | ||
812 | rc = get_user(c, buffer); | 865 | rc = get_user(c, buffer); |
866 | |||
867 | /* BB fixme need to parse more characters in order to handle CIFSSEC flags */ | ||
868 | |||
813 | if (rc) | 869 | if (rc) |
814 | return rc; | 870 | return rc; |
815 | if (c == '0' || c == 'n' || c == 'N') | 871 | if (c == '0' || c == 'n' || c == 'N') |
816 | extended_security = 0; | 872 | extended_security = CIFSSEC_DEF; /* default */ |
817 | else if (c == '1' || c == 'y' || c == 'Y') | 873 | else if (c == '1' || c == 'y' || c == 'Y') |
818 | extended_security = 1; | 874 | extended_security = CIFSSEC_MAX; |
819 | 875 | ||
820 | return count; | 876 | return count; |
821 | } | 877 | } |
822 | 878 | ||
823 | static int | 879 | /* static int |
824 | ntlmv2_enabled_read(char *page, char **start, off_t off, | 880 | ntlmv2_enabled_read(char *page, char **start, off_t off, |
825 | int count, int *eof, void *data) | 881 | int count, int *eof, void *data) |
826 | { | 882 | { |
@@ -855,6 +911,8 @@ ntlmv2_enabled_write(struct file *file, const char __user *buffer, | |||
855 | ntlmv2_support = 0; | 911 | ntlmv2_support = 0; |
856 | else if (c == '1' || c == 'y' || c == 'Y') | 912 | else if (c == '1' || c == 'y' || c == 'Y') |
857 | ntlmv2_support = 1; | 913 | ntlmv2_support = 1; |
914 | else if (c == '2') | ||
915 | ntlmv2_support = 2; | ||
858 | 916 | ||
859 | return count; | 917 | return count; |
860 | } | 918 | } |
@@ -898,7 +956,7 @@ packet_signing_enabled_write(struct file *file, const char __user *buffer, | |||
898 | sign_CIFS_PDUs = 2; | 956 | sign_CIFS_PDUs = 2; |
899 | 957 | ||
900 | return count; | 958 | return count; |
901 | } | 959 | } */ |
902 | 960 | ||
903 | 961 | ||
904 | #endif | 962 | #endif |