aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
AgeCommit message (Collapse)AuthorFilesLines
2018-06-28Add macros to initialize nstime_t values and use them.Guy Harris1-0/+20
This allows code to initialize them without having to know the details of the structure; the initializes should, and will, be changed if the members of the structure are changed. Change-Id: I93e6ebfcde9ceca17df696fcba4e8410c5afb175 Reviewed-on: https://code.wireshark.org/review/28501 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-06-27Add Windows 10 Release ID to About infoGraham Bloice1-0/+7
Adds the Windows 10 (and Server 2016) Release ID to the info in the About Wireshark blurb. The ID displayed in parentheses, e.g. Running on 64-bit Windows 10 (1803), build 17134 Change-Id: I1bbce27e149dbf6da6da7847ad1f7dd861176ece Reviewed-on: https://code.wireshark.org/review/28475 Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-26Remove code specific to older versions of Visual Studio.Gerald Combs2-35/+0
Remove -DBUILD_WINDOWS and sections of code that we no longer use. Bug: 14715 Change-Id: Iae1a950e2f52f4ce45fcf0ae5dea06c1172c3a28 Reviewed-on: https://code.wireshark.org/review/28466 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-06-26Windows: Fetch our version using RtlGetVersion.Gerald Combs2-77/+54
GetVersionEx is deprecated. Use RtlGetVersion instead. Remove get_windows_major_version since it's no longer needed. Change-Id: I02f6458608c2328a96a0ac71c6b1f9187babd049 Reviewed-on: https://code.wireshark.org/review/28443 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-06-21Fix build paths for cmake's Xcode project generator on macOS.David Kreitschmann1-3/+11
Multi-configuration generators (such as Xcode or VS) append the current build configuration to most paths (eg. Debug/Release). Currently this results in inconsistent paths for the application bundle and the included command line tools. This commit sets the correct path information for multi-configuration generators for macOS application bundles. The standard Makefile behaviour is untouched. One Windows specific configuration was changed, as it was conflicting with these changes. This needs to be checked before merging. Additionally the wrapper scripts are omitted for Xcode, as the path to the binaries depends on the configuration chosen in Xcode. Therefore it is not viable to create these scripts in the cmake run. Bug: 11816 Change-Id: Ib43d82eb04600a0e2f2b020afb44b579ffc7a7c9 Reviewed-on: https://code.wireshark.org/review/28291 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-07CMake: Get rid of FULL_SO_VERSIONGerald Combs1-3/+1
gd2e0724afc moved our library versions into their own variables named FULL_SO_VERSION. They're no longer used and interfere with tools/release-update-debian-soversions.sh so remove them. Fix some shellcheck warnings in release-update-debian-soversions.sh while we're here. Bug: 14778 Change-Id: I0eb0bb4ab4c482bdb8a94f8c18aa04c6c83c781b Reviewed-on: https://code.wireshark.org/review/28068 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>
2018-06-04Allow user to override config dir for all OSesJoão Valverde1-8/+14
Using an environment variable the user can override the config directory. Keep the previous Windows-specific variable ("WIRESHARK_APPDATA") alive for backward compatibility. Change-Id: I2350b815e60e7dbb19f9c193d7aaaa68f94576b2 Reviewed-on: https://code.wireshark.org/review/27946 Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2018-05-28wsutil: fix compilation on freebsd.Dario Lombardo1-0/+4
Change-Id: Iadb3f3daa1095ac9cc971f79ba4d288e8d835a44 Reviewed-on: https://code.wireshark.org/review/27864 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-24ws_pipe: don't check for negative number using DWORD.Dario Lombardo1-1/+1
DWORD on windows is unsigned, then there is no point in checking for negative values. Change-Id: I0b03fb19ebdff86e610cd4571fc30c49b7bd1284 Reviewed-on: https://code.wireshark.org/review/27766 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-23ws_pipe: fix return code on windows.Dario Lombardo1-0/+1
Change-Id: I30d24a5cad1991c2ce6a0f2a63fbe715b92943ec Reviewed-on: https://code.wireshark.org/review/27745 Reviewed-by: Kenneth Soerensen <knnthsrnsn@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com>
2018-05-23make our version of nla_for_each_nested() publicMartin Kaiser2-0/+67
caputils/ws80211_utils.c contains a re-definition of the linux kernel's nla_for_each_nested() macro that applies the correct casts to allow compilation with a C++ compiler. Make this definition public by moving it into a new wsutil/netlink.h file. Include the kernel's original definition before we overwrite it. This way, it's not necessary for a .c file to include wsutil/netlink.h after the system includes. Use our nla_for_each_nested() version in extcap/dpauxmon.c to squelch the following compiler warning: [1664/2251] Building C object extcap/CMakeFiles/dpauxmon.dir/dpauxmon.c.o ../extcap/dpauxmon.c: In function ‘family_handler’: ../extcap/dpauxmon.c:168:13: warning: request for implicit conversion from ‘void *’ to ‘struct nlattr *’ not permitted in C++ [-Wc++-compat] nla_for_each_nested(mcgrp, tb[CTRL_ATTR_MCAST_GROUPS], rem_mcgrp) { Change-Id: I6ba40ef6343c5d168c1b0c4554f13202911ded76 Reviewed-on: https://code.wireshark.org/review/27688 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-18Older versions of Clang don't understand -Wpedantic.Guy Harris1-2/+2
Define DIAG_OFF_PEDANTIC and DIAG_ON_PEDANTIC, and have it do nothing on Clang prior to 4.0. Change-Id: Ic6b2e607659db66f3210401024bf3f2239665506 Reviewed-on: https://code.wireshark.org/review/27649 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-16Eliminate some unneeded header checks.Guy Harris4-10/+2
sys/stat.h and sys/types.h date back to V7 UNIX, so they should be present on all UN*Xes, and we're assuming they're available on Windows, so, unless and until we ever support platforms that are neither UN*Xes nor Windows, we don't need to check for them. Remove the CMake checks for them, remove the HAVE_ values from cmakeconfig.h.in, and remove all tests for the HAVE_ values. Change-Id: I90bb2aab37958553673b03b52f4931d3b304b9d0 Reviewed-on: https://code.wireshark.org/review/27603 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-14Free g_ptr_array_free-related memory leaksPeter Wu1-1/+1
g_ptr_array_free(a, FALSE) returns "a->pdata". Callers that do not handle this will leak memory (e.g. "tshark -G plugins"). Convert other users to use the return value instead of direct access to "a->pdata". Change-Id: I29835477d587f5f54bf0d94cdae9f375e3da3ce3 Reviewed-on: https://code.wireshark.org/review/27437 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-05-13wsutil: fix json-glib memleaks and warningPeter Wu1-2/+2
Fix memleaks and complaint when trying to load non-JSON file as JSON: "GError set over the top of a previous GError or uninitialized memory." Change-Id: If5ab04dbb757636f66130bf1f8de1a45748bf541 Fixes: v2.9.0rc0-276-g73a1e98f4e ("wsutil: use json-glib instead of jsmn if present.") Reviewed-on: https://code.wireshark.org/review/27469 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com>
2018-05-11wsutil: fix WS_INET_ADDRSTRLEN definition on WindowsPeter Wu1-15/+4
On Windows, epan/addr_resolv.c has a different definition of structures "hashipv4_t" (and "hashipv6_t") because the size of the "ip" member is dependent on "WS_INET_ADDRSTRLEN". A mismatch resulted in two different structures where the "name" field got shifted (resulting in empty names in the resolved addresses table due to leading nul bytes). Since including ws2tcpip.h for the appropriate definition results in various compile errors (config.h, packet-dcerpc-misc.h, ...) and the larger definition is actually not needed, just use constants again. Bug: 14667 Change-Id: I4f8b300eb977be55f16ac40cacc78a5549e2732f Fixes: v2.5.0rc0-1503-gde1b26a3c6 ("More ws_inet_ntop() tweaks.") Reviewed-on: https://code.wireshark.org/review/27453 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-10wsutil: null-terminate string in ws_read_string_from_pipe (CID: 1364684).Dario Lombardo1-18/+8
Change-Id: I713e7466843e5ccaa7252744c57c7ac4c7020809 Reviewed-on: https://code.wireshark.org/review/27422 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com>
2018-05-08Windows: prioritize Npcap over WinPcapPascal Quantin1-24/+10
It is now considered stable enough to be our default capture driver if present Change-Id: I7f3cdabcbaea526949afa47164e520202e6b93f2 Reviewed-on: https://code.wireshark.org/review/27393 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-05-05Don't use dladdr() to get a pathname for the current executable().Guy Harris2-58/+32
Change-Id: I24ad11a659c2cb936f873339dc2b36ac9944280a Reviewed-on: https://code.wireshark.org/review/27359 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-05Use dlget() and dlgetname() to get the executable path name on HP-UX.Guy Harris1-2/+16
That leaves only AIX (and, if we're looking at dead UN*Xes, IRIX and Tru64 UNIX) as platforms on which we can't fetch that. Change-Id: If7a6a425aba30e1abf82ecc66f6c28dc532a227c Reviewed-on: https://code.wireshark.org/review/27358 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-04Get rid of more autotoolsisms.Guy Harris1-15/+2
Change-Id: I124732adf3c3da511c206932544b4d533404cfc5 Reviewed-on: https://code.wireshark.org/review/27332 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-04Fix function declaration of ws_buffer_length().Guy Harris1-1/+1
This makes it match 1) the way the function is defined, if it is defined and 2) the type returned if it's a macro, not a function. Change-Id: I708a44d2d20f44e58d6ae0228a11e622e7648022 Reviewed-on: https://code.wireshark.org/review/27320 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-03fix missing parentheses in 'if' statementchinarulezzz1-1/+1
Change-Id: I47f8566c4410d6aac1111b35fff3b044c14bc70b Reviewed-on: https://code.wireshark.org/review/27079 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-30plugins: Remove autotools specific code for build pathJoão Valverde1-49/+1
Change-Id: I12a987cd84a7e04189a08771ce334e1d6152eab1 Reviewed-on: https://code.wireshark.org/review/27205 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2018-04-30Lua: ensure that DATA_DIR and USER_DIR have trailing slashesPeter Wu1-2/+2
These directories have had trailing slashes for years and users seem to rely on it, so restore this assumption for backwards compatibility. The underlying API function (Dir.persconffile_path()) is not changed because trailing slashes were not documented for that function. For consistency, ensure that all Lua Dir functions return paths without trailing slashes. Bug: 14619 Change-Id: Ia299864999578884b1ad1cd48f1bd883bce6879d Fixes: v2.5.0rc0-579-gfb052a637f ("Use g_build_filename() instead, fix indentation") Reviewed-on: https://code.wireshark.org/review/27166 Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-04-28lwm2mtlv: Handle String data type as UTF-8Stig Bjørlykke2-0/+28
Display element value as bytes if value is not a valid UTF-8 string. Add a new utility function isprint_utf8_string(). Change-Id: I211d5ed423b53a9fd15eb260bbc6298b0b8f46a0 Reviewed-on: https://code.wireshark.org/review/27178 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-25Get rid of stuff that checks for a .libs directory.Guy Harris2-39/+4
.libs is a libtoolism, and we're not using autotools or libtool any more, so there aren't any more libtoolisms. Change-Id: Idc9ef37f9650197da096cc8e3cb3ed459b71dea0 Reviewed-on: https://code.wireshark.org/review/27137 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-04-24remove redundant break statementchinarulezzz1-1/+0
Change-Id: Ib6d4bbb1662d921fc4b5920b50e47d2b30ebb95c Reviewed-on: https://code.wireshark.org/review/27103 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-24oss-fuzzshark: use install directory for headers. Install missing one.Jakub Zawadzki1-0/+1
From compilation log: epan/ipv4.h:19:10: fatal error: 'wsutil/inet_ipv4.h' file not found tools/oss-fuzzshark/fuzzshark.c:27:10: fatal error: 'version_info.h' file not found Change-Id: I3e147e014ae398ae07e64aec5a6535a8f9e357a3 Reviewed-on: https://code.wireshark.org/review/27076 Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-24wsutil: use json-glib instead of jsmn if present.Dario Lombardo2-2/+18
Change-Id: I61b0fc2c23ad08aba3e29471bdfef6cab682bb21 Reviewed-on: https://code.wireshark.org/review/27056 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-21wsutil: convert one leftover function in wsjson.Dario Lombardo2-3/+3
Change-Id: I8d65389dfd6bf373e751e3373d9f22d733d9b5e9 Reviewed-on: https://code.wireshark.org/review/27069 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-21wsutil: rename wsjsmn to wsjson.Dario Lombardo3-11/+11
This puts more distance between the caller and the underlying library. At the moment we're using libjsmn, but other libraries (like json-glib) could be used. Change-Id: I1431424a998fc8188ad47b71d6d95afdc92a3f9e Reviewed-on: https://code.wireshark.org/review/27055 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-18Remove autotools build system.Dario Lombardo1-224/+0
It has been replaced by cmake. Change-Id: I83a5eddb8645dbbf6bca9f026066d2e995d8e87a Reviewed-on: https://code.wireshark.org/review/26969 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-16glib-compat is no longer used - it provided only code for versions < 2.32Joerg Mayer4-187/+0
Change-Id: I17e2c221cc40dbe9328458db9f17480c05bdc276 Reviewed-on: https://code.wireshark.org/review/26972 Petri-Dish: Jörg Mayer <jmayer@loplof.de> Tested-by: Petri Dish Buildbot Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2018-04-08ws_pipe: Zero an array.Gerald Combs1-0/+2
Make sure we zero-initialize pipeinsts, otherwise ConnectNamedPipe will have indeterminate behavior according to the MSDN documentation for the OVERLAPPED structure. Change-Id: I38d9680cf01b0a8f9e566a85a7a330f6c0aa9a48 Ping-Bug: 14532 Reviewed-on: https://code.wireshark.org/review/26784 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>
2018-04-05Tweak ws_cpuid so that Valgrind is happy.Darius Davis1-1/+2
Valgrind considers the "cpuid" instruction to always depend on inputs from eax and ecx, even though it's only a subset of values of eax for which ecx is relevant. If ecx is undefined when cpuid is executed, the outputs of cpuid will be considered undefined. Instead of suppressing the resulting uninitialised-value warning (the suppression for which is now out-of-date anyway, now that register_all_protocols is moved to a worker thread), let's simply set ecx to zero in ws_cpuid. Testing done: Built Wireshark on Linux amd64. Before this change, running "tools/valgrind-wireshark.sh ./test/captures/dhcp.pcap" with valgrind-3.12.0.SVN on Debian 9.4 amd64 would yield the following Valgrind error: ==2416== Thread 2: ==2416== Conditional jump or move depends on uninitialised value(s) ==2416== at 0xACB8B22: ws_mempbrk_sse42_compile (ws_mempbrk_sse42.c:58) ==2416== by 0x74F4960: register_all_protocols_worker (register.c:37) ==2416== by 0xB1403D4: g_thread_proxy (gthread.c:784) ==2416== by 0xD438493: start_thread (pthread_create.c:333) ==2416== by 0xB4CAACE: clone (clone.S:97) With the change, the above message is gone. Inspected the disassembly of function ws_cpuid, and it looks sane -- just an added "xor ecx, ecx" at the top. Change-Id: I2fb382309cac234c400286a6e9fac7d922912c63 Reviewed-on: https://code.wireshark.org/review/26733 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-25Clean up REPORT_DISSECTOR_BUG().Guy Harris2-5/+14
Have it take a format and argument list as arguments, and have the formatting done inside the reporting code. That way, we're not relying on any particular wmem scope working. If WIRESHARK_ABORT_ON_DISSECTOR_BUG is set, try to add the message to the crash information (currently only supported in macOS), and print it to the standard error, before crashing. We won't necessarily have a usable crash dump to analyze, so we can't rely on that to find the cause of the crash. Ping-Bug: 14490 Change-Id: I2b39169c45c84f2ada31efa1d413bd28c140f8f4 Reviewed-on: https://code.wireshark.org/review/26643 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-23Include alloca.h if we have it.Guy Harris1-0/+8
Bug: 14552 Change-Id: I799691f7f33ca56748ed4e51d7d548f37769837b Reviewed-on: https://code.wireshark.org/review/26611 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-21rsa: fix memleak and accept keys from certain PKCS#12 filesPeter Wu1-12/+7
The "bag" was not deallocated when the key is successfully loaded. Parse all bag elements rather than clearing the bag after the first iteration (this restores previous behavior). Change-Id: Ib52da6586f7435d18fa5b0660e7771436544b634 Fixes: v2.5.0rc0-613-gf63b68f707 ("Further cleanups.") Reviewed-on: https://code.wireshark.org/review/26481 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-03-13Windows: Conditionally set CREATE_BREAKAWAY_FROM_JOB.Gerald Combs1-4/+13
Set CREATE_BREAKAWAY_FROM_JOB only on Windows 7 and earlier. It's not needed otherwise and might fail in some cases. Change-Id: I15843b5c1ae3c352fa267228b94b6933074a07f3 Reviewed-on: https://code.wireshark.org/review/26465 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-13Get rid of trailing white space.Guy Harris1-1/+1
Change-Id: Ib03afc7a4d6203188828fdcfec2c7604365e4d0a Reviewed-on: https://code.wireshark.org/review/26467 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-13Expand a comment.Guy Harris1-4/+20
Change-Id: I154bce4901929c5f3eafa88cae2cd4ce53b28326 Reviewed-on: https://code.wireshark.org/review/26466 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-13Windows: Always assign newly-created processes to our job.Gerald Combs4-64/+97
Move ws_pipe_kill_child_on_exit to win32-utils. Add win32_create_process, which calls CreateProcess + AssignProcessToJobObject. Use win32_create_process instead of CreateProcess everywhere. Bug: 1419 Change-Id: I7a1f17dddf6a73f6973d54621f271b69311400d1 Reviewed-on: https://code.wireshark.org/review/26448 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>
2018-03-13Remove popcount in favor of ws_count_ones.Gerald Combs4-54/+0
Remove our popcount implementation in favor of ws_count_ones, which is our other popcount implementation. This required updating and running process-x11-xcb.pl. Change-Id: I8634c55242113b338c5b0173837c35f98b148b4f Reviewed-on: https://code.wireshark.org/review/26454 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>
2018-03-12Remove some unused or hard-coded header checks.Gerald Combs2-99/+0
Remove some unused checks and code found using grep -o 'HAVE_[A-Z0-9_]*' ConfigureChecks.cmake | sort -u \ | while read have_h ; do echo = $have_h ; git --no-pager grep -cl $have_h ; done Change-Id: I86bfcfdc4f60d9d7de87017a7bb00f833a79bd2c Reviewed-on: https://code.wireshark.org/review/26451 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-09Add ws_pipe_kill_child_on_exit.Gerald Combs1-3/+55
Add ws_pipe_kill_child_on_exit, which associates a child process handle with a job object that has the JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE flag set. Call it when we create a process in ws_pipe_spawn_sync and ws_pipe_spawn_async. Note that we might want to use it elsewhere. Change-Id: Ia0f6863ea4df0ab8623bb923a49da7776d83bd33 Reviewed-on: https://code.wireshark.org/review/26398 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-09GeoIP: avoid closing random file descriptorsPeter Wu1-0/+8
Previously there were three different pipe validity checks: PID != WS_INVALID_PID, PID != 0 and stdin != 0. This resulted in using/closing file descriptors which might be owned by something else. When no GeoIP databases are defined, mmdb_resolve_stop would be called to close the pipe and set PID to WS_INVALID_PID. stdin is however not cleared and future invocations would try to close the previous fd. Change-Id: I1d15da29208efb41098ee6a4edeeabf61f84c2b3 Fixes: v2.5.1rc0-466-ga1da75c554 ("Transition from GeoIP Legacy to MaxMindDB.") Reviewed-on: https://code.wireshark.org/review/26391 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-09wsutil: add CR to license.Dario Lombardo1-1/+2
Change-Id: Ibef7761410cd4d653be0d87c2bd39c040da62e08 Reviewed-on: https://code.wireshark.org/review/26385 Reviewed-by: Dario Lombardo <lomato@gmail.com>
2018-03-09spdx: more licenses converted.Dario Lombardo3-52/+3
Change-Id: I8f6693108c43959e54911d35b4fbf730c59add60 Reviewed-on: https://code.wireshark.org/review/26361 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-09spdx: more licenses converted.Dario Lombardo1-13/+1
Change-Id: Ia1650bc02511f7bd47fb90be91b623177f05bcbd Reviewed-on: https://code.wireshark.org/review/26337 Reviewed-by: Anders Broman <a.broman58@gmail.com>