Commit Graph

194 Commits

Author SHA1 Message Date
Dennis Heimbigner
02bd33f250 Merge branch 'dapparams.dmh' of https://github.com/Unidata/netcdf-c into dapparams.dmh 2018-05-19 16:11:24 -06:00
Dennis Heimbigner
5fc6be9472 Code duplicated; merge failure? 2018-05-18 20:28:51 -06:00
Ward Fisher
ebe6633006
Merge branch 'master' into dapparams.dmh 2018-05-16 14:34:28 -06:00
luz.paz
b4d0fe651a Follow-up trivial typos 2018-04-26 23:04:01 -04:00
luz.paz
74fbacdb82 Misc. source comment typos
Some are user-facing. Found via `codespell` and through the downstream FreeCAD.
2018-04-26 23:04:01 -04:00
Ward Fisher
ed9fa9f64c
Merge branch 'master' into dapparams.dmh 2018-04-23 13:38:18 -06:00
Ward Fisher
dad2101a04
Merge branch 'master' into index.dmh 2018-04-02 13:56:00 -06:00
Ward Fisher
a13b722af9
Merge branch 'master' into dapparams.dmh 2018-04-02 13:55:02 -06:00
Ward Fisher
e7a16a19a6 Modified tst_remote3.sh to work on OSX. 2018-03-29 18:30:16 -06:00
Ward Fisher
913b4a3961
Merge branch 'master' into index.dmh 2018-03-26 14:22:46 -06:00
Dennis Heimbigner
e6e3583e30 Merge branch 'master' into ncdaptestsclean.dmh 2018-03-20 21:37:35 -06:00
Dennis Heimbigner
05d078a8b0 The ncdap_tests were a mess, so I decided to clean them up
to remove cruft and to remove unused site tests
and make the tests somewhat more understandable.

Also did a fix to libdispatch/dwinpath to convert
relative paths to absolute paths. This will, I hope,
take care of some windows path problems when using
$srcdir in shell scripts.
2018-03-20 21:31:31 -06:00
Dennis Heimbigner
cc136cad08 Add a configurable "test case" that will create
and then open a file with a lot of metadata.
The test is configurable to determine the parameters
for the created metadata.
2018-03-17 16:25:13 -06:00
Dennis Heimbigner
25f062528b This completes (for now) the refactoring of libsrc4.
The file docs/indexing.dox tries to provide design
information for the refactoring.

The primary change is to replace all walking of linked
lists with the use of the NCindex data structure.
Ncindex is a combination of a hash table (for name-based
lookup) and a vector (for walking the elements in the index).
Additionally, global vectors are added to NC_HDF5_FILE_INFO_T
to support direct mapping of an e.g. dimid to the NC_DIM_INFO_T
object. These global vectors exist for dimensions, types, and groups
because they have globally unique id numbers.

WARNING:
1. since libsrc4 and libsrchdf4 share code, there are also
   changes in libsrchdf4.
2. Any outstanding pull requests that change libsrc4 or libhdf4
   are likely to cause conflicts with this code.
3. The original reason for doing this was for performance improvements,
   but as noted elsewhere, this may not be significant because
   the meta-data read performance apparently is being dominated
   by the hdf5 library because we do bulk meta-data reading rather
   than lazy reading.
2018-03-16 11:46:18 -06:00
Ward Fisher
da87652aa7
Merge branch 'master' into dapparams.dmh 2018-03-07 12:50:03 -07:00
Dennis Heimbigner
8cb1fc4cfe This is the second step in refactoring the libsrc4 code.
The first was branch newhash0.dmh.

As with newhash0.dmh, these changes should be transparent.
2018-02-24 20:36:24 -07:00
Dennis Heimbigner
99fccab359 1. Keep up to date by merging master
2. Fixed plugin building (nc_test4/hdf5plugins)
   to be done properly by cmake and automake.
4. Duplicated part of the nc_test4 filter test code
   in examples/C

An incomplete and untested set of hooks exist
for OS-X in nc_test4/findplugins.in. They need testing.
2018-01-16 11:00:09 -07:00
Ed Hartnett
0fbfc2bce4 more warnings 2017-11-30 09:16:29 -07:00
Ed Hartnett
3c5404ccf7
Merge branch 'master' into ejh_ncfunc_testing 2017-11-28 00:04:38 +00:00
Ed Hartnett
f779345b23 eliminating test dependencies in ncdap_test 2017-11-26 07:00:17 -07:00
Dennis Heimbigner
4db4393e69 Begin changing over to use strlcat instead of strncat because
strlcat provides better protection against buffer overflows.

Code is taken from the FreeBSD project source code. Specifically:
https://github.com/freebsd/freebsd/blob/master/lib/libc/string/strlcat.c
License appears to be acceptable, but needs to be checked by e.g. Debian.

Step 1:
1. Add to netcdf-c/include/ncconfigure.h to use our version
   if not already available as determined by HAVE_STRLCAT in config.h.
2. Add the strlcat code to libdispatch/dstring.c
3. Turns out that strlcat was already defined in several places.
   So remove it from:
	ncgen3/genlib.c
	ncdump/dumplib.c
3. Define strlcat extern definition in ncconfigure.h.
4. Modify following directories to use strlcat:
	libdap2 libdap4 ncdap_test dap4_test
   Will do others in subsequent steps.
2017-11-23 10:55:24 -07:00
Ed Hartnett
66ddc9dfb4 getting make -j check working 2017-11-17 10:49:06 -07:00
Ward Fisher
16d6f94f30 Merge branch 'master' into filters.dmh 2017-11-13 11:15:02 -07:00
Dennis Heimbigner
3074cc7824 re: esupport AVS-567793
Some parameters like stringlength actually affect a dimension
named maxStrlen.  So, add some aliasing so maxstrlen can be
specified as a parameter and as an alias for stringlength.

The affected parameters (case insensitive):
stringlength has alias maxstrlen
stringlength_<varname> has alias maxstrlen_<varname>

Also:
1. added a test case in ncdap_test/testurl.sh
2. added note to documentation
2017-11-08 19:02:13 -07:00
Ed Hartnett
74519d550b moved tests dependant on ncdump inside BUILD_UTILITIES block in Makefile.am files 2017-11-04 08:12:48 -06:00
Dennis Heimbigner
9983b9d911 re e-support UBS-599337
re pull request https://github.com/Unidata/netcdf-c/pull/405
re pull request https://github.com/Unidata/netcdf-c/pull/446

Notes:
1. This branch is a cleanup of the magic.dmh branch.
2. magic.dmh was originally merged, but caused problems with parallel IO.
   It was re-issued as pull request https://github.com/Unidata/netcdf-c/pull/446.
3. This branch + pull request replace any previous pull requests and magic.dmh branch.

Given an otherwise valid netCDF file that has a corrupted header,
the netcdf library currently crashes. Instead, it should return
NC_ENOTNC.

Additionally, the NC_check_file_type code does not do the
forward search required by hdf5 files. It currently only looks
at file position 0 instead of 512, 1024, 2048,... Also, it turns
out that the HDF4 magic number is assumed to always be at the
beginning of the file (unlike HDF5).
The change is localized to libdispatch/dfile.c See
https://support.hdfgroup.org/release4/doc/DSpec_html/DS.pdf

Also, it turns out that the code in NC_check_file_type is duplicated
(mostly) in the function libsrc4/nc4file.c#nc_check_for_hdf.

This branch does the following.
1. Make NC_check_file_type return NC_ENOTNC instead of crashing.
2. Remove nc_check_for_hdf and centralize all file format checking
   NC_check_file_type.
3. Add proper forward search for HDF5 files (but not HDF4 files)
   to look for the magic number at offsets of 0, 512, 1024...
4. Add test tst_hdf5_offset.sh. This tests that hdf5 files with
   an offset are properly recognized. It does so by prefixing
   a legal file with some number of zero bytes: 512, 1024, etc.
5. Off-topic: Added -N flag to ncdump to force a specific output dataset name.
2017-10-24 16:25:09 -06:00
Dennis Heimbigner
d8d4ed627a master merge 2017-08-29 18:05:46 -06:00
Dennis Heimbigner
e9888829f0 Suppress debug output 2017-08-29 15:10:55 -06:00
Dennis Heimbigner
b0cf032ddd Merge branch 'master' into authtesting.dmh 2017-08-20 15:01:19 -06:00
Ward Fisher
9e7a902dcf Merge branch 'issue435.dmh' into multi-pull 2017-07-27 12:20:11 -06:00
Ward Fisher
30711ccb20 Updated shell scripts to accomodate windows style carriage returns. 2017-07-26 13:35:27 -06:00
Dennis Heimbigner
07d67e737a 1. Cleaned up some holdover debug code.
2. modified ncdap_tests to remove <cr>
   from generated output before comparison
   to expected. This is a hack because
   my other attempts to force windows to use
   binary mode have not worked.
2017-07-25 14:58:29 -06:00
Dennis Heimbigner
adb86f9aed ckp 2017-07-21 13:54:09 -06:00
Dennis Heimbigner
6505ff6880 Force file opens to default to binary mode for cygwin and windows 2017-07-17 18:58:45 -06:00
Dennis Heimbigner
88b3d20e4e turn debug on 2017-07-16 13:13:10 -06:00
Dennis Heimbigner
967187f1a5 turn of extra debug 2017-07-15 20:21:24 -06:00
Dennis Heimbigner
d08a028a37 use srcdir instead of pws 2017-07-15 19:16:45 -06:00
Dennis Heimbigner
86c8898bdd add tst_ber.sh to extra dist 2017-07-15 15:39:34 -06:00
Dennis Heimbigner
aa74d73da0 update file permissions on test_ber 2017-07-15 14:45:57 -06:00
Dennis Heimbigner
fb0a679c2a verbose output 2017-07-15 14:32:21 -06:00
Dennis Heimbigner
75c551f53d bug fix in dwinpath 2017-07-15 13:03:35 -06:00
Dennis Heimbigner
1b138ecf64 more debug info 2017-07-14 19:37:35 -06:00
Dennis Heimbigner
081963ef8a forgot to add to cmake 2017-07-14 16:44:50 -06:00
Dennis Heimbigner
5117cc1052 Attempt to get more debug info out of ber test 2017-07-14 16:38:50 -06:00
Dennis Heimbigner
d1544b8ad9 Error in ncuri in handling user:pwd@ in url 2017-07-05 14:39:23 -06:00
Dennis Heimbigner
9719fbfbad re: hithub issue https://github.com/Unidata/netcdf-c/issues/435
Some temporary files are being left in a tempdir (e.g. /tmp
under *nix*).

The situation is described tersely in
netcdf-c/docs/auth.html#REDIR Basically, when a url is used that
requires redirection, a physical cookiejar file is required
to exist in the file system in order for this to work.

Since it was difficult to figure out when redirection was
being used (it was internal to libcurl) I needed to be prepared for that
eventuality. The result was that I always created a cookiejar file if one
was not specified in the rc file. This actually occurs in two places:
one inside oc2 and one inside libdap4.

The solution was two-fold:
1. do not use a cookiejar directory -- create cookiejar file directly
2. ensure that all cookiejar related files are reclaimed by nc_close().
Note that if nc_close (or nc_abort) is not called for whatever reason,
then reclamation will not occur.
2017-07-05 10:03:48 -06:00
Dennis Heimbigner
0ae22325f3 Forgot to add test files to github 2017-06-28 15:08:20 -06:00
Dennis Heimbigner
dc9e31df68 Fix for github issue https://github.com/Unidata/netcdf-c/issues/310.
The problem was that for opendap, it is possible to use keywords
as identifiers
 when there is no ambiguity. However, the DAP2
parser lost the case of the identifier used the lower case version.
Fix is to use the actual text of the symbol when it is used as an identifier.
Also added a test case for this (kwcase.*).

Additionally cleaned up some misc. dap2 testing problems.
1. ncdap_test/tst_ncdap3.sh was using an empty test set.
   restored the testing of datasets.
2. as a consequence of #1, some tests needed to be updated with minor
   tweeks.
3. fix dapmerge to handle multiple DODS_EXTRAS attributes.
4. modify buildattribute to suppress nul characters and terminate
   the name at the first nul.
5. clean up various test scripts to remove residual, unused
   references to obsolete netcdf-4 translation.
6. export e.g. NCDUMP from test_common.in so that non-top-level
   shell scripts can access it.
2017-06-28 13:51:01 -06:00
Dennis Heimbigner
6d8809100f Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh)
1. When running under windows (as opposed to cygwin)
   we need to make sure to not user /cygdrive/ file paths.
   This was ocurring in libdap4/d4read.c, but may occur
   elsewhere.
2. Shell scripts in the git repo are not being checked-out
   with the executable mode set. Had core.filemode set to false.
   Was a major hassle to fix.
2017-04-03 21:39:44 -06:00
Dennis Heimbigner
be6e1b65dc Fix conflicts with master 2017-03-17 14:58:38 -06:00