Commit Graph

8203 Commits

Author SHA1 Message Date
Dennis Heimbigner
6523f048e1 Update RELEASENOTES.md 2021-12-22 21:06:57 -07:00
Dennis Heimbigner
b0a495c7d0 Replace ezxml with tinyxml2
re: PR https://github.com/Unidata/netcdf-c/pull/2139
re: PR https://github.com/Unidata/netcdf-c/pull/2169
re: PR https://github.com/Unidata/netcdf-c/pull/2146
re: Issue https://github.com/Unidata/netcdf-c/issues/2119

Found the product tinyxml2 at https://github.com/leethomason/tinyxml2.git
and replaced ezxml with it. Tinyxml2 is about twice the LOC of ezxml,
but at least is it still being maintained, and I can use it out of the box.
It is C++ rather than C, but we seem to have reached the point that we can
include C++ code with only minor compile flag changes. Untested on Mac OS.
Added instructions to the end of libncxml/Makefile.am on how to upgrade
to a later version of tinyxml2.

This PR obsoletes the use of ezxml (re PRs https://github.com/Unidata/netcdf-c/pull/2146 and https://github.com/Unidata/netcdf-c/issue/2119).
2021-12-22 21:04:40 -07:00
Ward Fisher
dfb10a3f21
Merge pull request #2168 from DennisHeimbigner/ncdumptests.dmh
Cleanup the CMake inter-test dependencies
2021-12-21 14:29:46 -07:00
Dennis Heimbigner
5fb64d59af Update RELEASE Notes 2021-12-20 18:10:56 -07:00
Dennis Heimbigner
73caeb674d Cleanup the CMake inter-test dependencies
The ncdump test set has a number of inter-test dependencies
that are not properly established in ncdump/CMakeLists.txt.

So this PR attempts to:
1. reorder the tests
2. change tests in CMakeLists.txt from build_bin_test_no_prefix to add_bin_test_no_prefix so they get executed

Plus a couple of minor bug fixes.
1. Change ENABLE_NC4 => ENABLE_HDF5 in github action.
2. fix a memory error in findtestserver.c.in
3. fix bug in ncdap_tests/tst_urls.sh
4. fix netcdf file name bug in tst_netcdf4_4.sh
2021-12-20 15:13:08 -07:00
Ward Fisher
1ad0a53595
Merge pull request #2167 from DennisHeimbigner/addremotetest.dmh
Restore default enable for enable-dap-remote-testsc
2021-12-17 12:02:46 -06:00
Dennis Heimbigner
f00d03284a Restore default on for enable-dap-remote-testsc
The remote test server is up again. So re-enable.
Also do some test cleanup.
2021-12-16 15:43:22 -07:00
Ward Fisher
ebbb742819
Merge pull request #2164 from DennisHeimbigner/cmakelog4j.dmh
Disable by default dap-remote-tests for CMake
2021-12-13 10:16:18 -06:00
Dennis Heimbigner
ed1b82cdd3 The remotetest server is down for a while
because of the log4j security flaw.
So we default to disabling dap-remote-tests.
This PR adds disable to CMake
2021-12-11 19:19:27 -07:00
Ward Fisher
72a7926fdb
Merge pull request #2163 from DennisHeimbigner/log4j.dmh 2021-12-10 21:51:45 -07:00
Dennis Heimbigner
b768d5d2a2 The remotetest server is down for a while
because of the log4j security flaw.
So we default to disabling dap-remote-tests.
2021-12-10 18:53:00 -07:00
Ward Fisher
26ac2a6cba
Merge pull request #2121 from gsjaardema/patch-48
Refactor Z library detection
2021-11-04 15:42:02 -06:00
Ward Fisher
7dc355aab8
Merge pull request #2139 from WardF/gh2135.wif
libxml2 capability
2021-11-04 14:47:14 -06:00
Ward Fisher
b3fe92e304 Fencepost unistd.h inclusion. 2021-11-04 14:21:55 -06:00
Ward Fisher
c0a6acaf5a
Merge branch 'main' into gh2135.wif 2021-11-04 13:56:05 -06:00
Ward Fisher
b69163a387 Preprocessing for generated ezxml files. 2021-11-04 13:46:07 -06:00
Ward Fisher
33e4ec4675
Merge pull request #2138 from DennisHeimbigner/fixosbugs.dmh
Fix a number of OS specific bugs
2021-11-04 13:36:49 -06:00
Ward Fisher
0e336208da Addressed an issue in ncbytes where long unsigned ~= size_t 2021-11-04 10:10:28 -06:00
Ward Fisher
25d3d008f6 Added missing include for read() function. 2021-11-04 10:01:27 -06:00
Ward Fisher
0471869f58 Merge remote-tracking branch 'upstream/main' into gh2135.wif 2021-11-03 13:47:35 -06:00
Ward Fisher
8f648252ee Adding control block, --enable and disable option for libxml2 to configure.ac 2021-11-03 13:40:47 -06:00
Ward Fisher
0e205f9513
Merge pull request #2137 from DennisHeimbigner/typo.dmh
Typo in previous PR
2021-11-03 13:34:47 -06:00
Ward Fisher
516a9c35d3 Updated .gitignore to ignore .vscode directory. 2021-11-03 13:14:02 -06:00
Ward Fisher
73c4cc3883 Updated release notes. 2021-11-03 13:13:25 -06:00
Dennis Heimbigner
6bd289d655 Update release notes 2021-11-03 12:52:42 -06:00
Dennis Heimbigner
55a2643cac Fix a number of OS specific bugs
1. Issue https://github.com/Unidata/netcdf-c/issues/2043
   * FreeBSD build fails because of conflicts in defining the fileno() function. So removed all extern declarations of fileno.

2. Issue https://github.com/Unidata/netcdf-c/issues/2124
   * There were a couple of problems here.
     * I was conflating msys with mingw and they need separate handling of paths. So treat mingw like windows.
     * memio.c was not always writing the full content of the memory to file. Untested fix by properly accounting for zero size writes.
     * Fix bug when skipping white space in tst_xcache.c

3. Issue https://github.com/Unidata/netcdf-c/pull/2105
   * On MINGW, bash and other POSIX utilities use a mounted root directory,
     but executables compiled for Windows do not recognise the mount point.
     Ensure that Windows paths are used in tests of Windows executables.

4. Issue https://github.com/Unidata/netcdf-c/issues/2132
   * Apparently the Intel C compiler on OSX defines isnan etc.
     So disable declaration in dutil.c under that condition.

5. Fix and re-enable test_rcmerge.sh by allowing override of where to
   look for .rc files

6. CMakeLists.txt suppresses certain ncdump directory tests because of differences in printing floats/doubles.
   * Extend the list to include those that also fail under mingw.
   * Suppress the mingw tests in ncdump/Makefile.am
2021-11-03 12:49:54 -06:00
Dennis Heimbigner
e14c17fd08 Typo in previous PR
re: https://github.com/Unidata/netcdf-c/issues/2136

Patch for: https://github.com/Unidata/netcdf-c/pull/2134/

Inadvertent error changing ->info to ->s3.
2021-11-03 12:06:50 -06:00
Ward Fisher
eead7fa6d2 Begin wiring in option to toggle automatic search for libxml2 in support of https://github.com/Unidata/netcdf-c/pulls/2135 2021-11-02 15:35:04 -06:00
Dennis Heimbigner
cf903a678a Update release notes 2021-11-01 22:40:08 -06:00
Dennis Heimbigner
53464e8963 Allow optional use of libxml2
re: https://github.com/Unidata/netcdf-c/issues/2119

H/T to [Egbert Eich](https://github.com/e4t) and [Bas Couwenberg](https://github.com/sebastic) for this PR.

It is undesirable to make netcdf be dependent on the availability
of libxml2, but it is desirable to allow its use if available.

In order to do this, a wrapper API (include/ncxml.h) was constructed
that supports either ezxml or libxml2 as the implementation.
Additionally, the xml support code was moved to a new directory
netcdf-c/libncxml.

Primary changes:
* Create a new sub-directory named netcdf-c/libncxml to hold all the xml implementation code.
* Move ezxml.c and ezxml.h to libncxml
* Create a wrapper API -- include/ncxml.h
* Create an implementation, ncxml_ezxml.c to support use of ezxml.
* Create an implementation, ncxml_xml2.c to support use of libxml2.
* Add a check for libxml2 in configure.ac and CMakeLists.txt
* Modify libdap to use the wrapper API instead of ezxml directly.

Misc. Other Changes:
* Change include/netcdf_json.h from built source to be part of the distribution.
2021-11-01 22:37:05 -06:00
Ward Fisher
fcf0fa7dbd
Merge pull request #2134 from DennisHeimbigner/zarrs3part2.dmh 2021-11-01 16:00:39 -06:00
Dennis Heimbigner
6f3bfde222 Update release notes 2021-10-29 20:35:13 -06:00
Dennis Heimbigner
f6e25b695e Fix additional S3 support issues
re: https://github.com/Unidata/netcdf-c/issues/2117
re: https://github.com/Unidata/netcdf-c/issues/2119

* Modify libsrc to allow byte-range reading of netcdf-3 files in private S3 buckets; this required using the aws sdk. Also add a test case.
* The aws sdk can sometimes cause problems if the Awd::ShutdownAPI function is not called. So at optional atexit() support to ensure it is called. This is disabled for Windows.
* Add documentation to nczarr.md on how to build and use the aws sdk under windows. Currently it builds, but testing fails.
* Switch testing from stratus to the Unidata bucket on S3.
* Improve support for the s3: url protocol.
* Add a s3 specific utility code file: ds3util.c
* Modify NC_infermodel to attempt to read the magic number of byte-ranged files in S3.

## Misc.

* Move and rename the core S3 SDK wrapper code (libnczarr/zs3sdk.cpp) to libdispatch since it now used in libsrc as well as libnczarr.
* Add calls to nc_finalize in the utilities in case atexit is disabled.
* Add header only json parser to the distribution rather than as a built source.
2021-10-29 20:06:37 -06:00
Ward Fisher
228e7f5b5c
Merge pull request #2114 from DennisHeimbigner/zarrs3.dmh
Significantly Improve Amazon S3 Cloud Storage Support
2021-10-28 14:22:56 -06:00
Dennis Heimbigner
2da684fc37 ckp 2021-10-26 22:52:23 -06:00
Dennis Heimbigner
58ba84de0b update merge 2021-10-26 20:53:05 -06:00
Ward Fisher
783dc54d12
Merge pull request #2131 from gsjaardema/patch-49
Remove duplicate line
2021-10-26 09:48:28 -06:00
Greg Sjaardema
9c6181da09
Remove duplicate line
Remove a duplicate line...
2021-10-25 17:09:17 -06:00
Ward Fisher
19828e137d
Merge pull request #2127 from DennisHeimbigner/byterangefix.dmh
Fix bug in the default HDF5 byte-range reader
2021-10-19 10:35:05 -06:00
Dennis Heimbigner
3d6ab95dea Update Release Notes 2021-10-17 13:57:07 -06:00
Dennis Heimbigner
2d08c64290 Fix bug in the default HDF5 byte-range reader
re: https://github.com/Unidata/netcdf-c/issues/2122

There was a string allocation error in H5FDhttp.c
2021-10-17 13:55:03 -06:00
Ward Fisher
9116700eaf
Merge pull request #2126 from gsjaardema/patch-49
Avoid infinite loop for finding large prime values
2021-10-14 16:31:32 -06:00
Greg Sjaardema
6f65754357
Avoid infinite loop for finding large prime values
If the `val` passed to `findPrimeGreaterThan` is greater than the largest value (not the sentinel) in the `NC_primes`, then the routine will fall into an infinite loop.   Modified to call an external routine that brute forces the finding of a prime larger than the value in this case.  

The brute force routine uses the primes in `NC_primes` table in the prime test, so this will fail if given a `value > 180503 * 180503`.   The `isPrime` function could be rewritten to avoid this, but assuming this won't happen for the forseeable future.  If it does happen, `isPrime` will return that any value larger than this is prime...
2021-10-14 15:55:04 -06:00
Ward Fisher
4086bbd887
Merge pull request #2056 from gsjaardema/WIP-attribute-creation-order-tracking-option
Attribute creation order on/off
2021-10-13 10:18:36 -06:00
Ward Fisher
4c2adb5ff0
Merge pull request #2125 from DennisHeimbigner/dmh-patches1.dmh
Patch errors
2021-10-12 14:57:23 -06:00
Dennis Heimbigner
8bbdee157f Fix memory leak 2021-10-12 14:20:37 -06:00
Dennis Heimbigner
bf593248b3 Update release notes 2021-10-12 14:06:18 -06:00
Dennis Heimbigner
b5d4afd1d5 Patch errors
## Examine and fix ezxml errors

re: Issue https://github.com/Unidata/netcdf-c/issues/2119

Multiple security issues were found in ezxml (see above Issue).

* CVE-2021-31598
* CVE-2021-31348 / CVE-2021-31347
* CVE-2021-31229
* CVE-2021-30485
* CVE-2021-26222
* CVE-2021-26221
* CVE-2021-26220
* CVE-2019-20202
* CVE-2019-20201
* CVE-2019-20200
* CVE-2019-20199
* CVE-2019-20198
* CVE-2019-20007
* CVE-2019-20006
* CVE-2019-20005

In addition, moved ezxml to libdispatch.

## Examine and fix selected  oss-fuzz detected errors

Note that most of these errors are in the libsrc .m4 generated
code so fixing them is difficult. It would nice if we could tell
oss-fuzz to skip those files. They are old and crufty and
probably need a complete refactor.

Issue|Status
-----|------
35382|Fixed; old bug
35398|Closed by OSS-Fuzz
35442|Guarantee alloc > 0 or error; Old bug
35721|Assert failure; ok
35992|Fixed; old bug
36038|Fixed; old bug
36129|Unfixed; old bug
36229|Fixed by adding assert; old bug
37476|Unfixed; old bug
37824|Assert Failure; ok
38300|Closed by OSS-Fuzz
38537|Unfixed; old bug
38658|Unfixed; old bug
38699|Fixed maybe; old bug
38772|Nature of error is unclear, suspect that it results from using too large a type.
39248|Need more information
39394|Unfixed; old bug
2021-10-12 14:03:48 -06:00
Greg Sjaardema
80f3c78593
Clean up some whitespace junk
A previous edit added some extraneous whitespace that should not be there...
2021-10-12 09:52:57 -06:00
Greg Sjaardema
c2fac03d1a
Use consistent form for find_package
Remove the double quotes I had used in the find_package...
2021-10-11 14:56:52 -06:00