aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-smb.c
AgeCommit message (Collapse)AuthorFilesLines
2012-08-15bugfix minor memory leaks with GString usemmann1-0/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@44514 f5534014-38df-0310-8fa8-9805f1628bb7
2012-08-10Use val_to_str_const() where appropriate;wmeier1-1/+1
Also (for a few files): - create/use some extended value strings; - remove unneeded #include files; - remove unneeded variable initialization; - re-order fcns slightly so prefs_reg_handoff...() at end, etc git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@44438 f5534014-38df-0310-8fa8-9805f1628bb7
2012-07-27Fix memleak of listdarkjames1-0/+2
Valgrind log: = 2,656 (640 direct, 2,016 indirect) bytes in 40 blocks are definitely lost in loss record 41,241 of 41,608 = at 0x4C26ABB: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) = by 0xC5B0574: g_malloc (in /usr/lib64/libglib-2.0.so.0.2800.8) = by 0xC5C94DF: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.2800.8) = by 0xC5CA5ED: g_slist_insert_sorted (in /usr/lib64/libglib-2.0.so.0.2800.8) = by 0x697E8B8: dissect_smb_fid (packet-smb.c:3499) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@44067 f5534014-38df-0310-8fa8-9805f1628bb7
2012-06-28Update Free Software Foundation address.darkjames1-1/+1
(COPYING will be updated in next commit) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@43536 f5534014-38df-0310-8fa8-9805f1628bb7
2012-06-26General cleanup:wmeier1-1604/+1607
- Remove _U_ when function arg is actually used; - Use consistent formatting and whitespace style. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@43500 f5534014-38df-0310-8fa8-9805f1628bb7
2012-06-26Validate 'offset' before calling proto_item_set_end(); prevents potential ↵wmeier1-0/+4
'Dissector Bug' msg Addresses comment in Bug #7390 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7390#c1 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@43496 f5534014-38df-0310-8fa8-9805f1628bb7
2012-06-25Tighten up validity checking when doing reassembly.wmeier1-13/+10
Fixes Bug #7390 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7390 (Esentially: Do proper validity checking to prevent a "Dissector Bug" exception; throw a BoundsError exception instead). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@43483 f5534014-38df-0310-8fa8-9805f1628bb7
2012-06-20Use separate filters for the RTT found on a SACK and the RTT found on amorriss1-40/+339
DATA chunk: having them in both places is helpful when looking at the messages but having them separate is helpful when graphing the RTTs. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@43406 f5534014-38df-0310-8fa8-9805f1628bb7
2011-12-13Use consistent indentation.wmeier1-392/+391
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40185 f5534014-38df-0310-8fa8-9805f1628bb7
2011-12-13Use tvb_new_child_real_data() instead of tvb_new_real_data() + ↵wmeier1-3/+2
tvb_set_child_real_data_tvbuff(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@40173 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-24Fix encoding arg for various fcn calls:wmeier1-1/+1
- proto_tree_add_bits_item - proto_tree_add_bits_ret_val - proto_tree_add_bitmask - tvb_get_bits - tvb_get_bits16 - tvb_get_bits24 - tvb_get_bits32 - tvb_get_bits64 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39539 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.wmeier1-1/+1
Also: remove trailing whitespace for a number of files. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39503 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-15Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, ↵wmeier1-9/+9
FT_STRINGZ, FT_UINT_STRING as follows: 1. If there's no character encoding (ENC_ASCII, ...) specified then use ENC_ASCII. 2. For all but FT_UINT_STRING, always use ENC_NA (replacing any existing True/1/FALSE/0 /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39426 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-04Use ENC_NA as encoding for proto_tree_add_item() calls which directly ↵wmeier1-3/+3
reference an hf item (in hf[] with types: FT_NONE FT_BYTES FT_IPV6 FT_IPXNET FT_OID Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39260 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-01Set encoding.etxrab1-463/+463
Should hf_smb_server_guid hf_smb_dfs_referral_server_guid be FT_GUIDS? git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39209 f5534014-38df-0310-8fa8-9805f1628bb7
2011-10-01From Stefan Metzmacher: Support for SMB 2.22 features;wmeier1-18/+34
"Patches to add most things for SMB 2.22" https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6394 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39205 f5534014-38df-0310-8fa8-9805f1628bb7
2011-09-08From Stefan Metzmacher: Fix flags in packet-smbwmeier1-25/+60
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6320 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38940 f5534014-38df-0310-8fa8-9805f1628bb7
2011-08-16Initialize trunc.stig1-1/+1
Fix CID 1229. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38572 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-27Treat TVBs as opaque: use the accessor functions instead of accessing the fieldsmorriss1-10/+17
directly. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37420 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-20Use tvb_get_ephemeral_string() instead of tvb_get_ptr().morriss1-3/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37322 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-19Give some routines used for info levels that appear both in set and getguy1-70/+174
names beginning with dissect_qspi_, and give some of them names with the info level structure in them rather than the SNIA CIFS specification section number. Have separate routines for SMB_INFO_STANDARD and SMB_INFO_QUERY_EA_SIZE; SMB_INFO_STANDARD is specified differently in the SNIA CIFS specification and the MS-CIFS specification, and some captures have the SNIA CIFS version, with the EA length and some have the MS-CIFS version without it. The dissector for SMB_INFO_STANDARD will dissect it if it's there and not say "this structure is truncated" if it's not there. Rename dissect_qfi_SMB_FILE_ALTERNATE_NAME_INFO() to dissect_qfi_SMB_FILE_NAME_INFO(), as it also dissects SMB_QUERY_FILE_NAME_INFO. Merge the dissectors for SMB_FILE_ALLOCATION_INFO and SMB_SET_FILE_ALLOCATION_INFO, and for SMB_FILE_END_OF_FILE_INFO and SMB_SET_FILE_END_OF_FILE_INFO, as the structures are the same. Dissect some presumed "passthrough info levels" the same way the corresponding official SMB infos are dissected. Expand some comments for info level dissectors to give the MS-CIFS section number and to give some other details. If an info level is truncated, put in an expert info error. If we don't know about a given info level, just dissect the body as "Information level unknown", rather than having it dissected as an "unknown information" trailer. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37297 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-19The routines declared in packet-smb.h are defined in packet-smb.c;guy1-55/+54
include packet-smb.h in packet-smb.c so that we check the declarations against the definitions. In query ops, info level 2 is Query EA Size, not Query EAs From List. In set ops, info level 2 is Set EAs, not Query EA Size. Expand the constants for the Trans2 subcodes to 16 bits. The tvb argument to dissect_find_file_unix_info2() is used. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37286 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-17Don't leave the truncation flag unset in any of the info levelguy1-6/+14
dissectors. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37209 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-16Give the UNIX-extension routines used for info levels that appear bothguy1-20/+20
in set and get names beginning with dissect_qspi_. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37192 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-16Fix some comments.guy1-18/+31
Get rid of null-pointer tests for t2i in the "not null" branch of an earlier test whether it's null, as those tests are redundant. Use a switch statement to check the subcommand for Trans2. If t2i->info_level is -1, it means we don't know the info level, for whatever reason (e.g., the request was cut short by the snapshot length before the info level). Report it as such. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37183 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-14Remove the qpi_ from info level dissectors used for set info calls asguy1-16/+16
well. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37139 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-14For Find File Unix and Unix Info2, spell it "Unix", to match Query Fileguy1-219/+181
and Set File. Add Query and Set File Unix Info2; use common code to dissect the Unix Info2 structure. Use common code for Unix Basic, while we're at it. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37138 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-12Fix the test.sh failures based on Guy's suggestion in ↵morriss1-1/+1
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5445#c15 : Add a new tap flag to indicate that a tap listener is just a "dissector helper", that is, a tap which is used by a dissector to help it do its dissection but does not, itself, require dissection. Use this new flag in the dissectors which register taps. Remove the (now-unused) have_tap_listeners() function. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37069 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-09Support SMB_FIND_FILE_UNIX_INFO2.guy1-8/+298
Don't use "link destination" for file names in SMB_FIND_FILE_UNIX. Link to the page for Microsoft's public protocol specifications and to the Samba Wiki page for the UNIX extensions. Fix a typo in a variable name. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37023 f5534014-38df-0310-8fa8-9805f1628bb7
2011-05-09Count padding bytes against the transaction data byte count.guy1-2/+5
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37022 f5534014-38df-0310-8fa8-9805f1628bb7
2011-04-26Fix Dead Store (Dead assignement/Dead increment) Warning found by Clangalagoutte1-27/+20
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36872 f5534014-38df-0310-8fa8-9805f1628bb7
2011-04-16Add NULL checks. Fixes Coverity CIDs 509 and 510.gerald1-3/+9
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36670 f5534014-38df-0310-8fa8-9805f1628bb7
2011-04-13Comment out code to create a subtree since it's (currently ?) unused: ↵wmeier1-21/+19
Coverity 1039; Don't assign to a proto_item * if the value won't be used: Coverity 1040 & 1041. Remove some unneede #includes; Do some minor indentation & whitespace cleanup. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36630 f5534014-38df-0310-8fa8-9805f1628bb7
2011-03-27Added a FALLTHRU comment to avoid a "missing break" warning.stig1-1/+2
Coverity 472. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36366 f5534014-38df-0310-8fa8-9805f1628bb7
2011-02-10Modify proto_tree_add_bytes_format() and proto_tree_add_bytes_format_value()morriss1-3/+2
so that if the start_ptr is NULL the bytes are extracted from the given TVB using the given offset and length. Replace a bunch of: proto_tree_add_bytes_format*(tree, hf, tvb, offset, length, tvb_get_ptr(tvb, offset, length), [...]) with: proto_tree_add_bytes_format*(tree, hf, tvb, offset, length, NULL, [...]) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35896 f5534014-38df-0310-8fa8-9805f1628bb7
2011-01-30Introduce "Fragment count" filter element for all protocols doing reassembly.stig1-0/+6
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35705 f5534014-38df-0310-8fa8-9805f1628bb7
2011-01-16There's no need to pass the result of tvb_get_ptr() as the 'value' inmorriss1-2/+1
proto_tree_add_*(): just use proto_tree_add_item(). Replace some tvb_get_ptr()s with tvb_get_ephemeral_string() or tvb_get_const_stringz(). Use tvb_memeql() & tvb_memcmp(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35558 f5534014-38df-0310-8fa8-9805f1628bb7
2010-12-23Proof of concept for using new tvb_get_ephemeral_unicode_stringz(), which wassfisher1-1/+5
just introduced in SVN revision 35253. This new function has many more uses in the SMB (and other) dissectors. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35254 f5534014-38df-0310-8fa8-9805f1628bb7
2010-12-20Rename the routines that handle dissector tables with unsigned integerguy1-7/+7
keys to have _uint in their names, to match the routines that handle dissector tables with string keys. (Using _port can confuse people into thinking they're intended solely for use with TCP/UDP/etc. ports when, in fact, they work better for things such as Ethernet types, where the binding of particular values to particular protocols are a lot stronger.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35224 f5534014-38df-0310-8fa8-9805f1628bb7
2010-12-06Fix various typos and spelling errors.wmeier1-9/+9
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@35126 f5534014-38df-0310-8fa8-9805f1628bb7
2010-11-12Fix a crash I introduced in SVN #34692: A value_string ext referenced ↵wmeier1-1/+1
smb_cmd_vals rather than smb_cmd_vals_ext. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34853 f5534014-38df-0310-8fa8-9805f1628bb7
2010-10-29Use value_string_ext fcns to access certain value_string arrays.wmeier1-30/+39
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34692 f5534014-38df-0310-8fa8-9805f1628bb7
2010-10-27Fix the disssector assertion reported in ↵morriss1-5/+5
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3877 : The rest of the code assumes that sip can be NULL, so don't assert when it's not. Also make fid_cmp() static since it's only used in this module. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34663 f5534014-38df-0310-8fa8-9805f1628bb7
2010-10-22packet-smb.c:890: warning: data definition has no type or storage classetxrab1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34615 f5534014-38df-0310-8fa8-9805f1628bb7
2010-10-22From CaL Turney:etxrab1-1/+7
Add support for well-known SIDs/RIDs and option to display in hex. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5286 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34613 f5534014-38df-0310-8fa8-9805f1628bb7
2010-09-24(Refining the regexp...) Replace blurbs that match the name (case ↵morriss1-1/+1
insensitive) with NULL. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34230 f5534014-38df-0310-8fa8-9805f1628bb7
2010-09-23Replace blurbs that match the name (case insensitive) with NULL.morriss1-10/+10
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34227 f5534014-38df-0310-8fa8-9805f1628bb7
2010-08-10Dissect SMB_FILE_ATTRIBUTES, when used as file attributes rather thanguy1-66/+41
search attributes, as a 16-bit quantity, with only the bits specified by section 2.2.1.2.4 of [MS-CIFS]. Use dissect_file_ext_attr() in all cases where we're dissecting SMB_EXT_FILE_ATTR, as specified by section 2.2.1.2.3 of [MS-CIFS]. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33753 f5534014-38df-0310-8fa8-9805f1628bb7
2010-08-06From Tan Kean Siong:jake1-5/+89
Dissect the SMB Tree_Connect_Andx Request and Response properly with extension request and response which are documented in [MS-SMB] — v20100711 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33726 f5534014-38df-0310-8fa8-9805f1628bb7
2010-07-10Fix for bug 4993:jake1-1/+1
Mac support flags are little endian too. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33483 f5534014-38df-0310-8fa8-9805f1628bb7