Commit Graph

170 Commits

Author SHA1 Message Date
dmh
f423f27693 Sync with oc project.
This supports better authorization
handling for DAP requests, especially redirection
based authorization. I also added a new test case
ncdap_tests/testauth.sh.

Specifically, suppose I have a netrc file /tmp/netrc
containing this.
    machine uat.urs.earthdata.nasa.gov login xxxxxx password yyyyyy
Also suppose I have a .ocrc file containing these lines
    HTTP.COOKIEJAR=/tmp/cookies
    HTTP.NETRC=/tmp/netrc
Assume that .ocrc is in the local directory or HOME.

Then this command should work (assuming a valid login and password).
    ncdump -h "https://54.86.135.31/opendap/data/nc/fnoc1.nc"
2014-12-24 10:22:47 -07:00
Ward Fisher
f9fa4793c2 Revert "Corrected several static analysis issues related to potential null pointer dereferences and memory leaks."
This caused problems with large file support.  Reverting, will examine more closely and attempt a different fix.

This reverts commit 074603293f.
2014-12-09 11:49:32 -07:00
Rob Latham
af4eb0fb1d sync lines for generated C files
m4 can emit 'sync lines' which tell the toolchain "hey, this code
actually came from this other file over here".  Should help prevent
anyone accidentally editing a generated file.
2014-12-05 12:55:49 -06:00
Rob Latham
3b61804ff7 fix m4 dealing with split lines
Wei-keng Liao fixed this for pnetcdf. See pnetcdf revision 1904.
2014-12-05 12:55:38 -06:00
Ward Fisher
074603293f Corrected several static analysis issues related to potential null pointer dereferences and memory leaks. 2014-11-11 15:05:55 -07:00
Ward Fisher
9f9de5a493 Added a fix for a 'garbage/undefined value' bug reported by clang. in var.c, when varp->shape was being allocated, it was not being initialized properly and as a result, in some circustances, could potentially be dereferenced and evaluated without having a proper value. It is now initialized to 0. Hopefully this does not cause a problem. All the tests continue to pass, but I'm leaving a verbose comment here in case there is a knock-on problem discovered somewhere down the line. 2014-11-06 14:43:09 -07:00
Ward Fisher
52189b7725 Corrected an an issue where memcpy might be passed a NULL destination buffer. 2014-10-01 16:31:57 -06:00
Ward Fisher
461c96cdbe Fixed a clang-reported NULL pointer dereference issue. 2014-09-30 11:30:00 -06:00
Ward Fisher
9b1eb01923 Modified comment to adhere to doxygen format. 2014-09-18 13:31:30 -06:00
Ward Fisher
056de3f69d Corrected a logic error introduced in previous commit. 2014-08-27 15:40:41 -06:00
Ward Fisher
dac65bdab8 Removed a commented-out block of code. 2014-08-27 14:40:40 -06:00
Ward Fisher
4286822b91 Moved lseek call out of assert statement into an explicit check. JIRA NCF-312. 2014-08-27 14:26:54 -06:00
Ward Fisher
ae927f3c84 Fixed a dereference issue where ndims was greater than 0 but the allocation for dimids would fail. Identified by clang static analysis. 2014-07-09 12:45:06 -06:00
Ward Fisher
7f812b367e Manual merge of pull request https://github.com/Unidata/netcdf-c/pull/64 contributed by nschloe. Assorted CMake improvements. 2014-06-11 15:51:31 -06:00
Ward Fisher
05aaa4b376 Renamed man4 directory to docs. 2014-05-21 14:40:39 -06:00
Ward Fisher
44fae42214 Cleaned up indentation, white space in multiple CMakeLists.txt files. 2014-04-21 11:15:33 -06:00
Russ Rew
4a90e9a888 Change assertions that indicate file corruption into error status return. 2014-04-16 08:04:00 -06:00
Dennis Heimbigner
576cd84754 Merge branch 'master' of https://github.com/Unidata/netcdf-c 2014-03-29 13:36:02 -06:00
Dennis Heimbigner
4e68a3b8d3 add some jna personal scripts 2014-03-29 13:35:52 -06:00
Ward Fisher
76e5e0f1fa Addressed several minor issues revealed by static analysis (coverity, clang). Mostly to do with extreme corner cases in which a null pointer would be dereferenced, or dereferencing a non-null (but non-initialized) pointer would result in garbage. 2014-03-28 17:11:26 -06:00
Quincey Koziol
4bfd9b27a0 Merge remote-tracking branch 'upstream/master'
Conflicts:
	libdap2/common34.c
	oc2/ocutil.c
2014-02-11 17:26:09 -06:00
Quincey Koziol
b2dfacbcfa Big clean up to type handling in libsrc4, which makes fill-values work
correctly for variables with string datatype, plus a few other minor changes.
2014-02-11 17:12:08 -06:00
Ward Fisher
5600bd327e Updated CMake file. 2014-02-06 11:35:35 -07:00
Ward Fisher
7786b78cfc Reorganized Windows includes. 2014-02-04 11:10:27 -07:00
Ward Fisher
c1407c3239 Removed stray debugging message. 2014-02-03 14:42:56 -07:00
Quincey Koziol
cd71eb525c Corrected "BAIL" macros to avoid infinite loop when logging is disabled and an
error occurs after an "exit:" label.

Corrected a dozen Coverity errors (mainly allocation issues, along with a few
    other things):
        711711, 711802, 711803, 711905, 970825, 996123, 996124, 1025787,
        1047274, 1130013, 1130014, 1139538

Refactored internal fill-value code to correctly handle string types, and
    especially to allow NULL pointers and null strings (ie. "") to be
    distinguished.  The code now avoids partially aliasing the two together
    (which only happened on the 'write' side of things and wasn't reflected on
    the 'read' side, adding to the previous confusion).

    Probably still weak on handling fill-values of variable-length and compound
    datatypes.

Refactored the recursive metadata reads a bit more, to process HDF5 named
    datatypes and datasets immediately, avoiding chewing up memory for those
    types of objects, etc.

Finished uncommenting and updating the nc_test4/tst_fills2.c code (as I'm
    proceeding alphabetically through the nc_test4 code files).
2013-12-29 01:12:43 -06:00
dmh
582410a407 [NCF-273]/HZY-708311
Add a new function called nc_inq_format_extended that
returns more detailed format information (vis-a-vis
nc_inq_format) about an open dataset.

Note that the netcdf API will present the file as if it had
the format specified by nc_inq_format.  The true file
format, however, may not even be a netcdf file; it might be
DAP, HDF4, or PNETCDF, for example. This function returns
that true file type.  It also returns the effective mode for
the file.

signature: nc_inq_format_extended(int ncid, int* formatp, int* modep)
where
* ncid is the NetCDF ID from a previous call to nc_open() or
  nc_create().
* formatp is a pointer to a location for returned true format.
* modep is a pointer to a location for returned mode flags.

Refer to the actual list in the file netcdf.h to see the
currently defined set.

Also added test cases (tst_formatx*).
2013-12-22 12:53:20 -07:00
Ward Fisher
b3388178b4 Corrected a double-free issue reported by Coverity. 2013-12-17 15:54:14 -07:00
Quincey Koziol
b3044de434 Refactored read_scale(), memio_new(), var_create_dataset() and makespecial()
to clean up resources properly on failure.

Refactored doubly-linked list code for objects in the libsrc4 directory,
    cleaning up the add/del routines, breaking out the common next/prev
    pointers into a struct and extracting the add/del operations on them,
    changed the list of dims to add new dims in the same order as the other
    types, made all add routines able to optionally return a pointer to the
    newly created object.

Removed some dead code (pg_var(), nc4_pg_var1(), nc4_pg_varm(), misc. small
    routines, etc)

Fixed fill value handling for string types in nc4_get_vara().

Changed many malloc()+strcpy() pairs into calls to strdup().

Cleaned up misc. other minor Coverity issues.
2013-12-08 03:29:26 -06:00
Ward Fisher
5566cbb772 Added a check for _filelengthi64 in configuration. When found, this will be used instead of fstat when computing file length. 2013-11-04 12:58:33 -07:00
Ward Fisher
bda59030cb Replaced call to fstat with call to filelength, on apropriate system. 2013-11-01 16:30:33 -06:00
Ward Fisher
3a4d8252c3 Corrected an issue on OSX 'Mavericks'. 2013-10-21 17:39:13 -06:00
Ward Fisher
e636881aa7 Debugging an issue with LFS tests on Windows. 2013-09-03 14:22:55 -06:00
Ward Fisher
dae5e2f697 Added a short copyright message at head of a couple CMakeLists files; this will be propegated to the others.
Updated version in configure.ac to 4.3.1-rc2.
2013-08-15 09:43:59 -06:00
Ward Fisher
85465d8c10 Added stanza to only invoke m4 in non-MSVC environments. 2013-08-13 15:57:53 -06:00
Ward Fisher
43532c4193 Updated revision to rc2.
Refactored CMakeLists.txt in libsrc to generate, install netcdf.3 man page.
2013-08-13 15:42:45 -06:00
Ward Fisher
d91aa28110 Corrected a couple resource leak issues reported by Coverity static analysis. 2013-08-09 16:19:45 -06:00
Dennis Heimbigner
b85d3568ec Added the necessary code to support
group renaming. The primary API
is 'nc_rename_grp(int grpid, const char* name)'.
No test cases provided yet.
This also required adding a rename_grp entry
to the dispatch tables.
2013-07-19 21:48:37 +00:00
Ward Fisher
1c23ec06b8 Merging latest from netcdf-cmake branch. Includes a handful
of fixes for coverity-identified errors.
2013-07-19 21:32:27 +00:00
Ward Fisher
33d3d06971 Added initial 'make dist', 'make distcheck' support to
CMake-based builds.
2013-06-03 16:42:04 +00:00
Russ Rew
946a7ab8b5 Fix contributed by Nath Gopalaswamy to large file problem reading
netCDF classic or 64-bit offset files that have a UINT32_MAX flag for
large last record size of a variable that has values larger than 1
byte.  This problem had previously been fixed for *writing* such data,
but was only tested with an ncbyte variable.  Fixed test to
demonstrate problem and the fix.

More updates to chunking documentation, cosmetic fixes for some
"--option=" documentation that doxygen turns into mdash.
2013-05-31 20:18:18 +00:00
Ward Fisher
da16fc1cde Fixed an issue with Windows builds
not compiling due to how
ssize_t was being detected/defined.
2013-05-24 21:19:07 +00:00
Dennis Heimbigner
c659633d2e merge from trunk 2013-03-26 16:45:02 +00:00
Dennis Heimbigner
4b7817e69e Return EACCES instead of NC_EMETADATA when failing to create an HDF5 file 2013-03-26 16:31:56 +00:00
Ward Fisher
89ea9a4631 Added include for Windows in order to make use of alloca. 2013-03-25 21:02:11 +00:00
Dennis Heimbigner
9b4db7a039 Make some things static that do not need to be externally visible 2013-03-24 17:33:17 +00:00
Ward Fisher
f26a4a559a Merged latest from netcdf-cmake branch.
Addressed several cmake-related issues, in terms of
building on Windows.  Also added XGetopt.c to 
EXTRA_dist in Makefile.am files.
2013-03-19 22:40:15 +00:00
Dennis Heimbigner
dea3c726c8 merge trunk into this branch 2013-03-15 20:31:07 +00:00
Dennis Heimbigner
9eaac2a595 Apply Wei-Keng's fix
for JIRA issue NCF-241.
This is only temporary
until I can make pnetcdf
operate as a separate dispatch table.

Also, fix nc_test4/tst_pnetcdf
to open with nc_open_par;
this is necessary because a pnetcdf
created file cannot be opened
as a netcdf classic file.
2013-03-13 17:34:47 +00:00
Dennis Heimbigner
c18c90b012 removed some unused local variables 2013-03-12 20:45:58 +00:00