aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
AgeCommit message (Collapse)AuthorFilesLines
2020-01-06wsutil: Replace disallowed filename characters to '-'Stig Bjørlykke1-1/+18
Revert the removal of replacing disallowed filename characters in create_tempfile() to allow this characters in extcap interface names. This is a regression from g2925fb08. Change-Id: I833d1d19080c9c688dcaf076a840f55ef31e457d Reviewed-on: https://code.wireshark.org/review/35669 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-01-05Try this - it might be clearer.Guy Harris1-1/+1
It doesn't contain the text "please do not report it", so nobody will think it's a warning not to report the problem, it just says "don't call it a crash". Change-Id: I9ce71e6a1cc37446a08e44da64c8411166844f75 Reviewed-on: https://code.wireshark.org/review/35649 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-01-05Rewrite the "please submit" message a bit.Guy Harris1-2/+2
Say "as a bug" upfront, and clarify that "please do not report it as such" doesn't mean "please do not report this at all" (even though we say "please report this" earlier), it means "please do not report this as being a crash". Change-Id: I2656c4c13e90fcf41d00a4b6ab3c2f2998f55fd6 Reviewed-on: https://code.wireshark.org/review/35647 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2020-01-01Happy New Year 2020Stig Bjørlykke1-1/+1
Change-Id: Ic569e499d40def9397203510a121ff17a495ba9a Reviewed-on: https://code.wireshark.org/review/35616 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2019-12-30codecs API: Added description of API usageJirka Novak1-4/+64
Added API description clarifies when bytes/samples are used. New variable names proposed and all existing codecs are adapted to it. Change is just renaming... Change-Id: I75dba64a49eb3f4369ec7160cb793dda4b44c810 Reviewed-on: https://code.wireshark.org/review/35576 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2019-12-20Use g_file_open_tmp within create_tempfileMichael Mann2-165/+16
Much better to use a known library than create it ourselves. Also remove get_tempfile_path as it's not used. Bug: 15992 Change-Id: I17b9bd879e8bdb540f79db83c6c138f8ee724764 Reviewed-on: https://code.wireshark.org/review/34420 Reviewed-by: Tomasz Moń <desowin@gmail.com> Petri-Dish: Tomasz Moń <desowin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2019-12-02Add format_size_wmemMichael Mann2-15/+25
It's a "wmem version" of format_size (from wsutil/str_util.h). Also improved the flexibility in formatting of format_size() to handle future needs of format_size_wmem Ping-Bug: 15360 Change-Id: Id9977bbd7ec29375bbac955f685d46e75b0cef2c Reviewed-on: https://code.wireshark.org/review/31233 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-12wsutil: add netinet/in.h to socket.h.Dario Lombardo1-0/+4
Fix compilation under FreeBSD x86. Change-Id: Ifad9b21eb299e07e5a91424705e70b18e394eafc Reviewed-on: https://code.wireshark.org/review/35061 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-11-11Include <string.h>.Guy Harris1-0/+1
strchr() is declared in <string.h>, and we now use strchr(), so we must include <string.h>. Change-Id: Ie80763c10c4ad1ef85d4a83d8eacc3ea236bea56 Reviewed-on: https://code.wireshark.org/review/35052 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-11-11dumpcap: Add support for TCP@IPv6 socket capturesJoão Valverde2-0/+111
Bug: 15820 Change-Id: Id32f376190c115b0808ba72e5b63e019e2a70274 Reviewed-on: https://code.wireshark.org/review/35030 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2019-10-30Fix the temporary file string buffer expansion.Guy Harris1-2/+4
The buffer needs to be big enough to include the trailing '\0', so we need to compare the buffer's length against strlen(name) + 1, not against strlen(name). Bug: 15751 Change-Id: I75ae65f8c818284834d761d9dd911d029cfca3b1 Reviewed-on: https://code.wireshark.org/review/34892 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-10-10Revert "CMake: Don't install HTML manuals twice"João Valverde3-41/+6
This reverts commit f1285fcf061669702ca1accd7b2c50ebc8198993. NSIS package is broken with this commit. Change-Id: Ief22a308edad188fa2d5fab79355f19493359fa6 Reviewed-on: https://code.wireshark.org/review/34758 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2019-10-09CMake: Don't install HTML manuals twiceJoão Valverde3-6/+41
HTML docs are installed to both $docdir and $pkgdatadir. Fix that to install to $docdir only. Change-Id: I115158585b6df9170d9a01249adbc8548df91f14 Reviewed-on: https://code.wireshark.org/review/34640 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2019-10-03Win32: Fix a return value check.Gerald Combs1-1/+1
CreateNamedPipe returns INVALID_HANDLE_VALUE on failure. Change-Id: I79ad5144e084520db8197b69c4ad34431d183009 Reviewed-on: https://code.wireshark.org/review/34704 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-09-25Fix opening manual from staging directoryJoão Valverde1-2/+0
Change-Id: I6ac18a0379c4366c12dfb7dc00970e68451563a1 Reviewed-on: https://code.wireshark.org/review/34605 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2019-09-24wsutil: Use file descriptor in file_needs_reopen()Tomasz Moń2-5/+4
There's no extra benefit in having FILE pointer (over file descriptor) passed to file_needs_reopen(). Change-Id: Id49eb2f02b776c2f1ccd9d67fedd7eac38432f52 Reviewed-on: https://code.wireshark.org/review/34600 Reviewed-by: Craig Jackson <cejackson51@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-09-22Win32: Do not reload TLS keylog file on each packetTomasz Moń2-0/+71
On Windows, fstat() and stat() sets st_dev to different value depending on whether it was called with file handle or file path. If file handle was used, the st_dev is simply the file handle casted to unsigned. If file path was used, then st_dev corresponds to drive letter (A=0, B=1, C=2, ...). Compare the files using the file index information retrieved by GetFileInformationByHandle(). When compiled in configuration that supports FILE_ID_INFO, the code first tries to obtain 128-bit FILE_ID_INFO and if that fails, fallback to GetFileInformationByHandle(). Bug: 16059 Change-Id: I5f8d8d8127337891ef9907c291e550b1d17aabbb Reviewed-on: https://code.wireshark.org/review/34573 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-09-21MSVC: Warn about unused formal parametersTomasz Moń3-4/+14
Provide _U_ macro definition for Visual Studio. Change the way _U_ macro is ifdefed for some targets to allow Visual Studio to recognize it. Ping-Bug: 15832 Change-Id: Ic7ce145cbe9e8aa751d64c9c09ce8ba6c1bbbd30 Reviewed-on: https://code.wireshark.org/review/34530 Tested-by: Petri Dish Buildbot Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-09-15wsutil: Respect working directory on WindowsTomasz Moń1-1/+1
Pass working directory parameter to win32_create_process() in ws_pipe_spawn_sync(). Change-Id: I0abbc4fbf733138b20c2a34845b147530417c91e Reviewed-on: https://code.wireshark.org/review/34533 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2019-09-06wsjson.c: do not leak memory when checking input buffer in json_validate()Pascal Quantin1-5/+5
Bug: 16039 Change-Id: Id3c22fbee87b5a8f5d2e4bc488ad902098fa5f05 Reviewed-on: https://code.wireshark.org/review/34459 Reviewed-by: Pascal Quantin <pascal@wireshark.org> Petri-Dish: Pascal Quantin <pascal@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2019-09-03Also don't treat an empty buffer as JSON.Guy Harris1-3/+7
That also keeps us from looking at the non-existent first octet of an empty buffer. Bug: 16031 Change-Id: I3fcf4201d21dc44ccd8815cb0637c1eae4995560 Reviewed-on: https://code.wireshark.org/review/34439 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-09-03Strengthen the JSON validator.Guy Harris1-0/+12
jsmn_parse() is handed a buffer and a count of octets in the buffer; it treats either running out of octets, as specified by the count, *OR* seeing a NUL as meaning "end of JSON string". That means that a buffer, of arbitrary size, the first octet of which is zero is a null string and considered valid JSON. That is clearly bogus; it messes up both tests for JSON files *and*, potentially, heuristic checks for JSON in packet payloads. Bug: 16031 Change-Id: I5ee78b613df3358f19787f2ce28ddc883368f03d Reviewed-on: https://code.wireshark.org/review/34438 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-08-28Use g_hash_table_replace() when key depends on dataTomasz Moń1-1/+1
Using g_hash_table_insert() in cases where the key is contained within value is error prone. Use g_hash_table_replace() to eliminate the risk of ending up with incoherent hash table state. Change-Id: I595457476a2682e927d2c56b2692404aef4dc43a Reviewed-on: https://code.wireshark.org/review/34385 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-08-05Qt: Check filename before importRoland Knall2-0/+11
Before the unzipped files are being copied from the temp directory, they are checked against the stored list of profile names, to ensure, that only allowed files are being imported. Also ensures, that no empty directory exists for the skipped one Bug: 15969 Change-Id: I6ae8c9fb5f63d089d42fc0ef18dbe84baec515a2 Reviewed-on: https://code.wireshark.org/review/34184 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2019-08-02wsutil: link with -lm.Dario Lombardo1-0/+1
Required because json_dumper.c uses isfinite, fixes FreeBSD builds. Error: /usr/lib/libpcap.so && : /usr/local/bin/ld: run/libwsutil.so.0.0.0: undefined reference to `__isfinite' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. Change-Id: I6376250fa2037eab0bb2ad63382b8f3bb3560215 Reviewed-on: https://code.wireshark.org/review/34138 Reviewed-by: Dario Lombardo <lomato@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-30Qt: Change from User/System to Personal/Global profile typesStig Bjørlykke2-34/+34
Change the Profile types from User/System to Personal/Global in UI to match the terminology used in About Wireshark -> Folders. This reverts commit 40af4aa93e469d37bd8e712228ecccb07407c3c6. This reverts commit f0cde7ca34a4975370e1b9ded2fee7df266343f6. This reverts commit c37cabe900b9b11e12c8626ca46adc080e465fdb. Change-Id: I9012db6385707754e26a2dadb57f6003f8112f9b Reviewed-on: https://code.wireshark.org/review/34134 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2019-07-29Rename variable to eliminate shadow variable warning.Guy Harris2-4/+4
get_profile_dir() already calls the corresponding variable is_system; use that in profile_exists() as well. Change-Id: Icce42b2074d64c46598cc7561b3c5468da8ede90 Reviewed-on: https://code.wireshark.org/review/34131 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-29USBLL: Verify Token/Split packets CRC-5Tomasz Moń3-0/+110
Ping-Bug: 15908 Change-Id: I25aaf772d3d0af2f459a1ad78d8253344ed13f05 Reviewed-on: https://code.wireshark.org/review/34025 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-07-29Qt: Rename profile global to systemStig Bjørlykke2-34/+34
It's called system profiles in UI so update function names and variables to use the same name. This will increase code readability. Change-Id: I048e9ea85bd6ebab4a2c3ed1c685487ac8f7e40e Reviewed-on: https://code.wireshark.org/review/34116 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2019-07-28HTTPS In Even More Places, update some links.Guy Harris1-1/+1
Fall back on the Wayback Machine for some links. Change-Id: I6a44a2caaeb4fa521c2f08196e7c36069e3bb842 Reviewed-on: https://code.wireshark.org/review/34103 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-27HTTPS In Still More Places, update more URLs.Guy Harris4-5/+5
Microsoft reshuffled their documentation - almost all of it moved from msdn.microsoft.com to docs.microsoft.com. Some blogs moved to devblogs.microsoft.com; the comments *didn't* move, so in one case we go to the Wayback Machine - the link isn't dead, but it formats horribly, at least on my browser, but the archived version formats OK. Use the Wayback Machine for some URLs, and update others. Update the sections for MS-ADTS. Point to the HTML versions of some RFCs and I-Ds. Change-Id: I344b20f880de63f1ae2a4e3f9ff98af78a7fe139 Reviewed-on: https://code.wireshark.org/review/34101 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26HTTPS (almost) everywhere.Guy Harris45-45/+45
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-25USBLL: Verify DATA packets CRC-16Tomasz Moń2-0/+62
Ping-Bug: 15908 Change-Id: Idda280545665184aca40c694ea6d639c9317307a Reviewed-on: https://code.wireshark.org/review/34016 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-21Remove ABI compliance checker code.João Valverde2-22/+0
It's broken, unmaintained, poorly implemented and obsoleted by saner debug-info methods. Note: To do the compliance check properly would require much more extensive work to clearly define public and private interfaces (without manual bookeeping of files or symbols either, of course, because who would want that...). Change-Id: Ib801f3c152ca2369f95ca1f4af4d37cd8cc7c47a Reviewed-on: https://code.wireshark.org/review/33928 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: João Valverde <j@v6e.pt>
2019-07-20copyright_info: convert GPL-2.0 URL to HTTPPeter Wu1-2/+2
Use a shorter URL and use HTTPS. Change-Id: I9cfcd52775c95457e81694272dbe795d4eae4e58 Reviewed-on: https://code.wireshark.org/review/34026 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-16Editcap: Allow floating point split intervals.Gerald Combs1-0/+3
Update the `-i` option to allow floating point values as suggested at https://stackoverflow.com/questions/57004719/split-wireshark-to-miliseconds Change-Id: I24028d409bc441ed3b45ac2179f7c42b2bc424bc Reviewed-on: https://code.wireshark.org/review/33938 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-30wsutil: fix build failure of Debian packages on Ubuntu 16.04Peter Wu2-6/+22
The libwsutil symbols file contains two public symbols which depend on Libgcrypt 1.7.0. As the version included with Ubuntu 16.04 is too old, building a Debian package fails due to missing two curve25519 symbols. Add stub implementations as workaround. Change-Id: Ie39e784e9e631750b5269d038772496565b2dce8 Reviewed-on: https://code.wireshark.org/review/33780 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-16NGAP: fix dissection of N2 Information ContentPascal Quantin2-0/+90
Change-Id: I8aaf578c8eb71533313cf2cfd42871eae0c0ff57 Reviewed-on: https://code.wireshark.org/review/33603 Petri-Dish: Pascal Quantin <pascal@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2019-06-11Kill libwscodecs plugin library, just use pluginsJoão Valverde3-0/+254
Change-Id: I085d04840acb53b0b7681787429a2b4e10547cd5 Reviewed-on: https://code.wireshark.org/review/33068 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-05-24wsutil+macOS: Use realpath() to resolve our program path.Gerald Combs1-1/+16
Use realpath() to resolve our program file directory on macOS. This lets us create symlinks to the program files in our application bundle without affecting our plugin and other paths. Change-Id: If77cbd7da56e01f2cd602334d361c8aa52afeae0 Reviewed-on: https://code.wireshark.org/review/33151 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-05-03CMake: Remove wsutil pcap dependencyJoão Valverde2-36/+0
Change-Id: Ic5a3653cb8bcc33e0be108c8b201567e7090f9f5 Reviewed-on: https://code.wireshark.org/review/33043 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: João Valverde <j@v6e.pt>
2019-05-03CMake: Add libpcap imported library targetJoão Valverde1-2/+1
Change-Id: I5326b87784817fb353329e2d686fe0515c32f6cb Reviewed-on: https://code.wireshark.org/review/33038 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: João Valverde <j@v6e.pt>
2019-05-02Have the multiple-include guards cover everything.Guy Harris1-2/+2
Change-Id: Ibfb7b014fbffff64d1c4f179c452b4499c683481 Reviewed-on: https://code.wireshark.org/review/33050 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-05-02Move the Winsock initialization and cleanup to wsutil routines.Guy Harris3-0/+72
Those routines exist on both Windows and UN*X, but they don't do anything on UN*X (they could if it were ever necessary). That eliminates some #ifdefs, and also means that the gory details of initializing Winsock, including the Winsock version being requested, are buried in one routine. The initialization routine returns NULL on success and a pointer to a g_malloc()ated error message on failure; report the error to the user, along with a "report this to the Wireshark developers" suggestion. That means including wsutil/socket.h, which obviates the need to include some headers for socket APIs, as it includes them for you. Change-Id: I9327bbf25effbb441e4217edc5354a4d5ab07186 Reviewed-on: https://code.wireshark.org/review/33045 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-01Windows: Modernize our WSAStartup usage.Gerald Combs1-1/+1
Make sure we link each application that calls WSAStartup with ws2_32.lib. Pass version 2.2 to WSAStartup. Wikipedia says it was introduced in 1996, so we should be OK. Ping-Bug: 15711 Change-Id: I431839e930e7c646669af7373789640b5180ec28 Reviewed-on: https://code.wireshark.org/review/33033 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Tomasz Moń <desowin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-04-30wsutil: Fix 30 seconds freeze if process fails to startTomasz Moń1-0/+1
In ws_pipe_wait_for_pipe() on Windows, the WaitForMultipleObjects() waits on the pending pipe connection events and process handle. If the process handle is signalled, then it means that the process did exit without connecting to the pipes. The WaitForMultipleObjects() was not waiting on the process handle and thus if the process did fail without connecting to pipes the Wireshark gui was frozen for 30 seconds. This change fixes the freeze by increasing the number of handles, so WaitForMultipleObjects() is aware of the process handle. Change-Id: Id13824a60baf4be7795cbe1d5ed1c7932edbff45 Reviewed-on: https://code.wireshark.org/review/33028 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-04-26file-util: fix possible null reference from code analysisGraham Bloice1-19/+21
Change-Id: I9b0c6b118b5f866abc969a437bbd9b9a28271bf0 Reviewed-on: https://code.wireshark.org/review/32841 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Petri-Dish: Graham Bloice <graham.bloice@trihedral.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-25win32-utils: Do not share job between Wireshark instancesTomasz Moń1-1/+1
Creating Job Object named "Local\Wireshark child process cleanup" results in the job being shared between all Wireshark instances run within a single session. When two or more Wireshark instances were running, debug message appeared: "Could not assign child cleanup process: Access is denied. (5)" As the child process was not assigned to a job, it was possible that the child process was still active even after Wireshark did terminate. This fixes the issue by creating unnamed job object which is not shared. Change-Id: I59adc2aacff0151802163f155d68cbc8022c1479 Reviewed-on: https://code.wireshark.org/review/32985 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-04-23ws_pipe: fix memory leaks in spawn arguments handlingPeter Wu2-81/+102
On Windows, ws_pipe_spawn_sync always leaks 'winargs', and leaks 'argv' on some error paths. Fix these and refactor the common argument parsing functionality to reduce duplication of functionality. Change-Id: I8fa5ca45aec20b53f6fa243b0dd07241a345f7ab Reviewed-on: https://code.wireshark.org/review/32932 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Tomasz Moń <desowin@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-04-22ws_pipe: fix return value of ws_pipe_spawn_async on error pathPeter Wu1-3/+3
The function returns a GPid, not a gboolean. Callers (mmdbresolv and extcap) only assume WS_INVALID_PID to be invalid (as documented). Change-Id: I40b491272a451f569864fa3259009d6d3fcce772 Fixes: v2.5.1rc0-413-g1a0987904f ("Generalize our process spawning code.") Reviewed-on: https://code.wireshark.org/review/32933 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Tomasz Moń <desowin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>