netcdf-c/ncdump
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
..
cdl Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
expected NetCDF-c Github issue #178 2015-12-26 18:19:04 -07:00
bom.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
cdl.h Add provenance info for netcdf-4 files. 2016-05-07 14:32:07 -06:00
chunkspec.c The max dimension sizes do not take CDF-5 format into account. 2016-01-05 21:26:25 -07:00
chunkspec.h Fix -d0 option to not do unwanted chunking or associated shuffle. 2014-03-21 12:34:19 -06:00
CMakeLists.txt re e-support UBS-599337 2017-10-24 16:25:09 -06:00
ctests.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
depend
dimmap.c
dimmap.h
dumplib.c Solve issue https://github.com/Unidata/netcdf-c/issues/359 2017-07-24 18:59:16 -06:00
dumplib.h Define macro for NIL string value in ncdump/dumplib.h 2013-07-10 20:56:24 +00:00
env re: NCF-317 2014-10-07 12:37:41 -06:00
indent.c Fixed bug NCF-144 (ncdump of variables with multiple unlimited 2012-11-16 21:37:43 +00:00
indent.h
inttags4.cdl re: gihub issue https://github.com/Unidata/netcdf-c/issues/380 2017-03-24 18:56:14 -06:00
inttags.cdl ckp 2015-11-19 13:44:55 -07:00
isnan.h Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
L512.bin re e-support UBS-599337 2017-10-24 16:25:09 -06:00
Make0 Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
Makefile.am re e-support UBS-599337 2017-10-24 16:25:09 -06:00
nc4print.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
nccomps.h Fixed bug NCF-144 (ncdump of variables with multiple unlimited 2012-11-16 21:37:43 +00:00
nccopy.1 Fix another hyphen-used-as-minus-sign issue in nccopy.1 man page. 2015-01-25 19:20:00 +01:00
nccopy.c Corrected a missing break in a switch statement. 2017-09-20 14:18:43 -06:00
ncdump.1 hyphens used as minus signs 2015-01-16 13:12:11 +01:00
ncdump.c ckp 2017-04-14 11:05:30 -06:00
ncdump.h Add provenance info for netcdf-4 files. 2016-05-07 14:32:07 -06:00
nciter.c corrected an undefined value error identified by clang. 2014-10-02 12:43:27 -06:00
nciter.h Refactor to share functions between ncdump and nccopy. Merge nccopy 2013-01-23 17:45:29 +00:00
nctime0.c Fix common typos 2015-08-20 11:42:05 +02:00
nctime0.h Fix Coverity complaint about passing big parameter by value 2012-08-17 22:00:36 +00:00
nctrunc.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
ocprint.c Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
ref1.ncml Fix github issue: https://github.com/Unidata/netcdf-c/issues/236 2016-03-17 22:05:46 -06:00
ref_ctest1_nc4.cdl Wiring in more validation 2016-11-18 11:53:53 -07:00
ref_ctest1_nc4c.cdl Fix ncdump clang warnings. Fix invalid encodings for some non-ascii strings in tests. 2015-08-02 16:09:47 -06:00
ref_ctest64.c Fix ncdump clang warnings. Fix invalid encodings for some non-ascii strings in tests. 2015-08-02 16:09:47 -06:00
ref_ctest.c Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
ref_inttags4.cdl Working on getting cdf5 tests running. 2017-09-15 18:00:28 -06:00
ref_inttags.cdl ckp 2015-11-19 13:44:55 -07:00
ref_nc_test_netcdf4_4_0.nc
ref_nc_test_netcdf4.cdl
ref_nccopy3_subset.nc Wiring new test into autotools. 2017-09-01 11:57:28 -06:00
ref_test_360_day_1900.cdl Solve issue https://github.com/Unidata/netcdf-c/issues/359 2017-07-25 11:58:34 -06:00
ref_test_365_day_1900.cdl Solve issue https://github.com/Unidata/netcdf-c/issues/359 2017-07-25 11:58:34 -06:00
ref_test_366_day_1900.cdl Solve issue https://github.com/Unidata/netcdf-c/issues/359 2017-07-25 11:58:34 -06:00
ref_test_corrupt_magic.nc re e-support UBS-599337 2017-10-24 16:25:09 -06:00
ref_times.cdl Fixed bug NCF-175: ncdump -t incorrectly interpreting units attribute 2012-06-07 18:14:02 +00:00
ref_tst_charfill.cdl
ref_tst_comp2.cdl
ref_tst_comp.cdl
ref_tst_compounds2.cdl
ref_tst_compounds2.nc
ref_tst_compounds3.cdl
ref_tst_compounds3.nc
ref_tst_compounds4.cdl
ref_tst_compounds4.nc
ref_tst_enum_data.cdl
ref_tst_fillbug.cdl
ref_tst_format_att_64.cdl
ref_tst_format_att.cdl
ref_tst_group_data_v23.cdl
ref_tst_group_data.cdl
ref_tst_grp_spec0.cdl
ref_tst_grp_spec.cdl
ref_tst_mud4_chars.cdl Fixed bug NCF-310 (ncdump char vars with multiple unlimited dims). 2014-08-07 14:35:29 -06:00
ref_tst_mud4-bc.cdl Add reference file for ncdump -bc test 2013-11-13 13:45:20 -07:00
ref_tst_mud4.cdl Fixed bug NCF-144 (ncdump of variables with multiple unlimited 2012-11-16 21:37:43 +00:00
ref_tst_nans.cdl
ref_tst_ncf213.cdl Add provenance info for netcdf-4 files. 2016-05-07 14:32:07 -06:00
ref_tst_noncoord.cdl
ref_tst_opaque_data.cdl
ref_tst_small.cdl
ref_tst_solar_1.cdl ckp 2015-11-19 13:44:55 -07:00
ref_tst_solar_2.cdl
ref_tst_special_atts3.cdl
ref_tst_special_atts.cdl Add provenance info for netcdf-4 files. 2016-05-07 14:32:07 -06:00
ref_tst_string_data.cdl Fix NCF-186, ncdump bug not escaping quotes and newlines in string data 2012-08-03 04:40:06 +00:00
ref_tst_unicode.cdl
ref_tst_utf8_4.cdl re: Jira NCF-320 2015-08-20 15:53:48 -06:00
ref_tst_utf8.cdl
ref_tst_vlen_data2.cdl
ref_tst_vlen_data.cdl
rewrite-scalar.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
run_back_comp_tests.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
run_ncgen_nc4_tests.sh Added missing scripts. 2017-05-24 14:37:54 -06:00
run_ncgen_tests.sh Corrected conditional logic syntax in a few shell test scripts. 2017-09-20 11:29:25 -06:00
run_tests.sh Corrected typos. 2017-09-20 11:22:33 -06:00
run_utf8_nc4_tests.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
run_utf8_tests.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
small2.cdl
small.cdl
test0.cdl [NCF-267]/SAI-630695 2013-09-23 17:11:59 -06:00
test_360_day_1900.nc Solve issue https://github.com/Unidata/netcdf-c/issues/359 2017-07-25 11:58:34 -06:00
test_365_day_1900.nc Solve issue https://github.com/Unidata/netcdf-c/issues/359 2017-07-25 11:58:34 -06:00
test_366_day_1900.nc Solve issue https://github.com/Unidata/netcdf-c/issues/359 2017-07-25 11:58:34 -06:00
test_corrupt_magic.cdl re e-support UBS-599337 2017-10-24 16:25:09 -06:00
test_corrupt_magic.nc re e-support UBS-599337 2017-10-24 16:25:09 -06:00
tst_64bit.sh Corrected typos. 2017-09-20 11:22:33 -06:00
tst_bom.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_brecs.cdl
tst_bug321.cdl Add test CDL file and tst_nccopy4.sh test for fix of NCF-321 2015-01-03 17:18:14 -07:00
tst_bug324.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_calendars.cdl Fixed bug NCF-175: ncdump -t incorrectly interpreting units attribute 2012-06-07 18:14:02 +00:00
tst_calendars.sh Solve issue https://github.com/Unidata/netcdf-c/issues/359 2017-07-25 11:58:34 -06:00
tst_charfill.cdl
tst_charfill.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_chunking.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_comp2.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_comp.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_compress.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_create_files.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_dimsizes.c Flagging test to only run when CDF5 is enabled. 2017-09-14 15:01:40 -06:00
tst_dimsizes.sh Moved error code to common shell. 2017-05-30 15:11:39 -06:00
tst_enum_data.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_fileinfo.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_fileinfo.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_fillbug.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_fillbug.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_formatx3.sh Corrected conditional logic syntax in a few shell test scripts. 2017-09-20 11:29:25 -06:00
tst_formatx4.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_group_data.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_grp_spec.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_h_rdc0.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_h_scalar.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_h_scalar.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_hdf5_offset.sh re e-support UBS-599337 2017-10-24 16:25:09 -06:00
tst_inmemory_nc3.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_inmemory_nc4.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_inttags4.sh Working on getting cdf5 tests running. 2017-09-15 18:00:28 -06:00
tst_inttags.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_iter.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_lengths.sh Fixed another typo. 2017-09-19 16:18:25 -06:00
tst_mslp.cdl
tst_mud.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_nans.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_nccopy3_subset.sh Infile given absolute path. 2017-09-05 13:13:08 -06:00
tst_nccopy3.sh Updated test to use new file name. 2017-09-20 11:25:36 -06:00
tst_nccopy4.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_ncgen4_classic.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_ncgen4_cycle.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_ncgen4_diff.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_ncgen4.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_ncgen_shared.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_ncml.cdl Fix github issue: https://github.com/Unidata/netcdf-c/issues/236 2016-03-17 22:05:46 -06:00
tst_netcdf4_4.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_netcdf4.sh re e-support UBS-599337 2017-10-24 16:25:09 -06:00
tst_opaque_data.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_output.sh Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
tst_special_atts.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_string_data.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_unicode.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_utf8.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
tst_vlen_data.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
utils.c re: Github issue netcdf-c 300 2016-08-08 09:24:19 -06:00
utils.h Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
vardata.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
vardata.h Fixed bug NCF-144 (ncdump of variables with multiple unlimited 2012-11-16 21:37:43 +00:00
XGetopt.c Merge from latest netcdf-cmake branch. 2012-12-05 18:35:42 +00:00