mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-04-06 18:00:24 +08:00
conflicts
This commit is contained in:
commit
805a4882cb
@ -11,9 +11,9 @@ before_install:
|
||||
|
||||
# We need to install hdf5.
|
||||
# hdf5-1.8.14.tar.bz2
|
||||
- wget http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.14/src/hdf5-1.8.14.tar.bz2
|
||||
- tar -jxf hdf5-1.8.14.tar.bz2
|
||||
- cd hdf5-1.8.14 && ./configure --enable-shared --disable-static --disable-fortran --enable-hl --disable-fortran --prefix=/usr && make -j 4 && sudo make install
|
||||
- wget http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.15/src/hdf5-1.8.15.tar.bz2
|
||||
- tar -jxf hdf5-1.8.15.tar.bz2
|
||||
- cd hdf5-1.8.15 && ./configure --enable-shared --disable-static --disable-fortran --enable-hl --disable-fortran --prefix=/usr && make -j 4 && sudo make install
|
||||
- cd ..
|
||||
|
||||
before_script:
|
||||
|
@ -7,6 +7,8 @@ This file contains a high-level description of this package's evolution. Release
|
||||
|
||||
## 4.3.x Released TBD
|
||||
|
||||
* Addressed an issue with IBM's `XL C` compiler on AIX and how it handled some calls to malloc. Also, as suggested by Wolfgang Hayek, developers using this compiler may need to pass `CPPFLAGS=-D_LINUX_SOURCE_COMPAT` to avoid some test failures.
|
||||
|
||||
* Addressed an issure in netcdf4 related to specifying an endianness explicitly. When specifying an endianness for `NC_FLOAT`, the value would appear to not be written to file, if checked with `ncdump -s`. The issue was more subtle; the value would be written but was not being read from file properly for non-`NC_INT`. See [GitHub Issue](https://github.com/Unidata/netcdf-c/issues/112) or [NCF-331](https://bugtracking.unidata.ucar.edu/browse/NCF-331) for more information.
|
||||
|
||||
* Addressed an issue in netcdf4 on Windows w/DAP related to how byte values were copied with sscanf. Issue originally reported by Ellen Johnson at Mathworks, see [NCF-330](https://bugtracking.unidata.ucar.edu/browse/NCF-330) for more information.
|
||||
|
2
cf
2
cf
@ -122,7 +122,7 @@ FLAGS="$FLAGS --disable-examples"
|
||||
#FLAGS="$FLAGS --enable-large-file-tests"
|
||||
#FLAGS="$FLAGS --disable-testsets"
|
||||
#FLAGS="$FLAGS --disable-dap-remote-tests"
|
||||
#FLAGS="$FLAGS --enable-dap-auth-tests"
|
||||
FLAGS="$FLAGS --enable-dap-auth-tests"
|
||||
#FLAGS="$FLAGS --enable-doxygen"
|
||||
#FLAGS="$FLAGS --enable-logging"
|
||||
#FLAGS="$FLAGS --disable-diskless"
|
||||
|
26
configure.ac
26
configure.ac
@ -79,12 +79,35 @@ AC_ARG_WITH([minblocksize],
|
||||
AC_MSG_RESULT([$NCIO_MINBLOCKSIZE])
|
||||
AC_DEFINE_UNQUOTED([NCIO_MINBLOCKSIZE], [$NCIO_MINBLOCKSIZE], [min blocksize for posixio.])
|
||||
|
||||
###
|
||||
# Doxygen and doxygen-related options.
|
||||
###
|
||||
AC_ARG_ENABLE([doxygen],
|
||||
[AS_HELP_STRING([--enable-doxygen],
|
||||
[Enable generation of documentation.])])
|
||||
test "x$enable_doxygen" = xyes || enable_doxygen=no
|
||||
AM_CONDITIONAL([BUILD_DOCS], [test "x$enable_doxygen" = xyes])
|
||||
|
||||
AC_ARG_ENABLE([doxygen-tasks],
|
||||
[AS_HELP_STRING([--enable-doxygen-tasks],
|
||||
[Enable Doxygen-generated test, todo and bug list documentation. Developers only.])])
|
||||
test "x$enable_doxygen_tasks" = xyes || enable_doxygen_tasks=no
|
||||
AM_CONDITIONAL([SHOW_DOXYGEN_TAG_LIST], [test "x$enable_doxygen_tasks" = xyes])
|
||||
AC_SUBST([SHOW_DOXYGEN_TAG_LIST], [$enable_doxygen_tasks])
|
||||
|
||||
AC_ARG_ENABLE([doxygen-server-side-search],
|
||||
[AS_HELP_STRING([--enable-doxygen-server-side-search],
|
||||
[Enable doxygen server-side search. This is of interest to developers only, or users who will serve the documentation via a web server instead of browsing locally.])])
|
||||
test "x$enable_doxygen_server_side_search" = xyes || enable_doxygen_server_side_search=no
|
||||
AM_CONDITIONAL([SERVER_SIDE_SEARCH], [test "x$enable_doxygen_server_side_search" = xyes])
|
||||
AC_SUBST([SERVER_SIDE_SEARCH], [$enable_doxygen_server_side_search])
|
||||
|
||||
AC_ARG_ENABLE([doxygen-pdf-output],
|
||||
[AS_HELP_STRING([--enable-doxygen-pdf-output],
|
||||
[Build netCDF library documentation in PDF format. Experimental.])])
|
||||
AM_CONDITIONAL([NC_ENABLE_DOXYGEN_PDF_OUTPUT], [test "x$enable_doxygen_pdf_output" = xyes])
|
||||
AC_SUBST([NC_ENABLE_DOXYGEN_PDF_OUTPUT], [$enable_doxygen_pdf_output])
|
||||
|
||||
AC_ARG_ENABLE([dot],
|
||||
[AS_HELP_STRING([--enable-dot],
|
||||
[Use dot (provided by graphviz) to generate charts and graphs in the doxygen-based documentation.])])
|
||||
@ -974,6 +997,9 @@ AM_CONDITIONAL(BUILD_CDMREMOTE, [test "x$enable_cdmremote" = xyes]) # Alias
|
||||
AM_CONDITIONAL(BUILD_RPC, [test "x$enable_rpc" = xyes])
|
||||
AM_CONDITIONAL(BUILD_DISKLESS, [test x$enable_diskless = xyes])
|
||||
AM_CONDITIONAL(BUILD_MMAP, [test x$enable_mmap = xyes])
|
||||
AM_CONDITIONAL(BUILD_DOCS, [test x$enable_doxygen = xyes])
|
||||
AM_CONDITIONAL(SHOW_DOXYGEN_TAG_LIST, [test x$enable_doxygen_tasks = xyes])
|
||||
AM_CONDITIONAL(SERVER_SIDE_SEARCH, [test x$enable_doxygen_server_side_search = xyes])
|
||||
|
||||
# If the machine doesn't have a long long, and we want netCDF-4, then
|
||||
# we've got problems!
|
||||
|
@ -761,6 +761,7 @@ INPUT = \
|
||||
@abs_top_srcdir@/docs/notes.md \
|
||||
@abs_top_srcdir@/docs/all-error-codes.md \
|
||||
@abs_top_srcdir@/docs/FAQ.md \
|
||||
@abs_top_srcdir@/docs/software.md \
|
||||
@abs_top_srcdir@/docs/COPYRIGHT.dox \
|
||||
@abs_top_srcdir@/docs/credits.md \
|
||||
@abs_top_srcdir@/include/netcdf.h \
|
||||
|
@ -1,4 +1,4 @@
|
||||
FAQ {#ncFAQ}
|
||||
FAQ {#faq}
|
||||
=======================
|
||||
|
||||
[TOC]
|
||||
|
@ -10,7 +10,8 @@ EXTRA_DIST = netcdf.m4 DoxygenLayout.xml Doxyfile.in footer.html \
|
||||
architecture.dox internal.dox windows-binaries.md \
|
||||
building-with-cmake.md CMakeLists.txt \
|
||||
groups.dox install.md notes.md install-fortran.md \
|
||||
all-error-codes.md cmake_faq.md credits.md auth.md.in auth.md
|
||||
all-error-codes.md cmake_faq.md credits.md auth.md.in auth.md \
|
||||
software.md
|
||||
|
||||
# Turn off parallel builds in this directory.
|
||||
.NOTPARALLEL:
|
||||
|
826
docs/auth.md
826
docs/auth.md
@ -1,479 +1,449 @@
|
||||
OC Authorization Support {#auth}
|
||||
========================
|
||||
Authorization Support in the netDF-C Libraries {#auth}
|
||||
==================================================
|
||||
|
||||
[TOC]
|
||||
\brief It is possible to support a number of authorization schemes
|
||||
in the netCDF-C library.
|
||||
|
||||
###### Author: Dennis Heimbigner
|
||||
dmh at ucar dot edu
|
||||
With one exception, authorization in the netCDF-C library is
|
||||
delegated to the oc2 code, which in turn delegates it to the
|
||||
libcurl library. The exception is that the location of the rc
|
||||
file can be specified by setting the environment variable *NCRCFILE*.
|
||||
Note that the value of this environment variable should be the
|
||||
absolute path of the rc file, not the path to its containing directory.
|
||||
|
||||
###### Draft: 11/21/2014
|
||||
Last Revised: 12/23/2014
|
||||
OC Version 2.1
|
||||
|
||||
###### Table of Contents {.break}
|
||||
|
||||
1. [Introduction](#Introduction)
|
||||
2. [URL-Based Authentication](#URL-AUTH)
|
||||
3. [RC File Authentication](#DODSRC)
|
||||
4. [Redirection-Based Authentication](#REDIR)
|
||||
5. [URL Constrained RC File Entries](#URLCONS)
|
||||
6. [Client-Side Certificates](#CLIENTCERTS)
|
||||
7. [Appendix A. All RC-File Keys](#allkeys)
|
||||
8. [Appendix B. ESG Access in Detail](#ESGDETAIL)
|
||||
|
||||
Introduction {.break}
|
||||
------------
|
||||
Following is the authorization documentation.
|
||||
|
||||
<!- Copyright 2014, UCAR/Unidata and OPeNDAP, Inc. -->
|
||||
<!- See the COPYRIGHT file for more information. -->
|
||||
<html>
|
||||
<style>
|
||||
.break { page-break-before: always; }
|
||||
body { counter-reset: H2; font-size: 12pt; }
|
||||
h2:before {
|
||||
content: counter(H2) " ";
|
||||
counter-increment: H2;
|
||||
}
|
||||
h2 { counter-reset: H3; }
|
||||
h3:before {
|
||||
content: counter(H2) "." counter(H3) " ";
|
||||
counter-increment:H3;
|
||||
}
|
||||
h3 { counter-reset: H4; }
|
||||
h4:before {
|
||||
content: counter(H2) "." counter(H3) "." counter(H4) " ";
|
||||
counter-increment:H4;
|
||||
}
|
||||
h5 {font-size: 14pt; } /* For Appendices */
|
||||
h6 {font-size: 16pt; } /* For Subtitles */
|
||||
</style>
|
||||
<body>
|
||||
|
||||
<center>
|
||||
<h1>OC Authorization Support</h1>
|
||||
<h6>Author: Dennis Heimbigner<br>
|
||||
dmh at ucar dot edu</h6>
|
||||
<h6>Draft: 11/21/2014<br>
|
||||
Last Revised: 12/23/2014<br>
|
||||
OC Version 2.1</h6>
|
||||
</center>
|
||||
|
||||
<h6 class="break"><u>Table of Contents</u></h6>
|
||||
<ol>
|
||||
<li> <a href="#Introduction">Introduction</a>
|
||||
<li> <a href="#URL-AUTH">URL-Based Authentication</a>
|
||||
<li> <a href="#DODSRC">RC File Authentication</a>
|
||||
<li> <a href="#REDIR">Redirection-Based Authentication</a>
|
||||
<li> <a href="#URLCONS">URL Constrained RC File Entries</a>
|
||||
<li> <a href="#CLIENTCERTS">Client-Side Certificates</a>
|
||||
<li> <a href="#allkeys">Appendix A. All RC-File Keys</a>
|
||||
<li> <a href="#ESGDETAIL">Appendix B. ESG Access in Detail</a>
|
||||
</ol>
|
||||
|
||||
<h2 class="break"><a name="Introduction"><u>Introduction</u></a></h2>
|
||||
OC can support user authorization using those provided by the curl
|
||||
library. This includes basic password authentication as well as
|
||||
certificate-based authorization.
|
||||
<p>
|
||||
With some exceptions (e.g. see the section on <a href="#REDIR">redirection</a>)
|
||||
The libcurl authorization mechanisms can be accessed in two ways
|
||||
<ol>
|
||||
<li> Inserting the username and password into the url, or
|
||||
<li> Accessing information from a so-called <i>rc</i> file named either
|
||||
<i>.daprc</i> or <i>.dodsrc</i>
|
||||
</ol>
|
||||
|
||||
With some exceptions (e.g. see the section on [redirection](#REDIR)) The
|
||||
libcurl authorization mechanisms can be accessed in two ways
|
||||
|
||||
1. Inserting the username and password into the url, or
|
||||
2. Accessing information from a so-called *rc* file named either
|
||||
*.daprc* or *.dodsrc*
|
||||
|
||||
URL-Based Authentication {.break}
|
||||
------------------------
|
||||
|
||||
For simple password based authentication, it is possible to directly
|
||||
insert the username and the password into a url in this form.
|
||||
|
||||
http://username:password@host/...
|
||||
|
||||
<h2 class="break"><a name="URL-AUTH"><u>URL-Based Authentication</u></a></h2>
|
||||
For simple password based authentication, it is possible to
|
||||
directly insert the username and the password into a url in this form.
|
||||
<pre>
|
||||
http://username:password@host/...
|
||||
</pre>
|
||||
This username and password will be used if the server asks for
|
||||
authentication. Note that only simple password authentication is
|
||||
supported in this format. Specifically note that [redirection](#REDIR)
|
||||
based authorization will not work with this.
|
||||
|
||||
RC File Authentication {.break}
|
||||
----------------------
|
||||
|
||||
The oc library supports an *rc* file mechanism to allow the passing of a
|
||||
number of parameters to liboc and libcurl.
|
||||
|
||||
The file must be called one of the following names: ".daprc" or
|
||||
".dodsrc" If both .daprc and .dodsrc exist, then the .daprc file will
|
||||
take precedence.
|
||||
|
||||
Searching for the rc file first looks in the current directory and then
|
||||
in the home directory (as defined by the HOME environment variable). It
|
||||
is also possible to specify a direct path using the *-R* option to
|
||||
ocprint or using the *oc\_set\_rcfile* procedure (see oc.h). Note that
|
||||
for these latter cases, the path must be to the file itself, not to the
|
||||
containing directory.
|
||||
authentication. Note that only simple password authentication
|
||||
is supported in this format.
|
||||
Specifically note that <a href="#REDIR">redirection</a> based
|
||||
authorization will not work with this.
|
||||
|
||||
<h2 class="break"><a name="DODSRC"><u>RC File Authentication</u></a></h2>
|
||||
The oc library supports an <i>rc</i> file mechanism to allow the passing
|
||||
of a number of parameters to liboc and libcurl.
|
||||
<p>
|
||||
The file must be called one of the following names:
|
||||
".daprc" or ".dodsrc"
|
||||
If both .daprc and .dodsrc exist, then
|
||||
the .daprc file will take precedence.
|
||||
<p>
|
||||
Searching for the rc file first looks in the current directory
|
||||
and then in the home directory (as defined by the HOME environment
|
||||
variable). It is also possible to specify a direct path using
|
||||
the <i>-R</i> option to ocprint or using the <i>oc_set_rcfile</i>
|
||||
procedure (see oc.h). Note that for these latter cases, the path
|
||||
must be to the file itself, not to the containing directory.
|
||||
<p>
|
||||
The rc file format is a series of lines of the general form:
|
||||
|
||||
[<host:port>]<key>=<value>
|
||||
|
||||
where the bracket-enclosed host:port is optional and will be discussed
|
||||
<pre>
|
||||
[<host:port>]<key>=<value>
|
||||
</pre>
|
||||
where the bracket-enclosed host:port is optional and will be discussed
|
||||
subsequently.
|
||||
|
||||
<p>
|
||||
The currently defined set of authorization-related keys are as follows.
|
||||
The second column is the affected curl\_easy\_setopt option(s).
|
||||
|
||||
Key
|
||||
|
||||
curl\_easy\_setopt Option
|
||||
|
||||
HTTP.COOKIEJAR
|
||||
|
||||
CURLOPT\_COOKIEJAR, CURLOPT\_COOKIEFILE
|
||||
|
||||
HTTP.PROXY\_SERVER
|
||||
|
||||
CURLOPT\_PROXY, CURLOPT\_PROXYPORT, CURLOPT\_PROXYUSERPWD
|
||||
|
||||
HTTP.SSL.CERTIFICATE
|
||||
|
||||
CURLOPT\_SSLCERT
|
||||
|
||||
HTTP.SSL.KEY
|
||||
|
||||
CURLOPT\_SSLKEY
|
||||
|
||||
HTTP.SSL.KEYPASSWORD
|
||||
|
||||
CURLOPT\_KEYPASSWORD
|
||||
|
||||
HTTP.SSL.CAINFO
|
||||
|
||||
CURLOPT\_SSLCAINFO
|
||||
|
||||
HTTP.SSL.CAPATH
|
||||
|
||||
CURLOPT\_SSLCAPATH
|
||||
|
||||
HTTP.SSL.VERIFYPEER
|
||||
|
||||
CURLOPT\_SSL\_VERIFYPEER
|
||||
The second column is the affected curl_easy_setopt option(s).
|
||||
<table>
|
||||
<tr><th>Key<th>curl_easy_setopt Option
|
||||
<tr><td>HTTP.COOKIEJAR<td>CURLOPT_COOKIEJAR, CURLOPT_COOKIEFILE
|
||||
<tr><td>HTTP.PROXY_SERVER<td>CURLOPT_PROXY, CURLOPT_PROXYPORT, CURLOPT_PROXYUSERPWD
|
||||
<tr><td>HTTP.SSL.CERTIFICATE<td>CURLOPT_SSLCERT
|
||||
<tr><td>HTTP.SSL.KEY<td>CURLOPT_SSLKEY
|
||||
<tr><td>HTTP.SSL.KEYPASSWORD<td>CURLOPT_KEYPASSWORD
|
||||
<tr><td>HTTP.SSL.CAINFO<td>CURLOPT_SSLCAINFO
|
||||
<tr><td>HTTP.SSL.CAPATH<td>CURLOPT_SSLCAPATH
|
||||
<tr><td>HTTP.SSL.VERIFYPEER<td>CURLOPT_SSL_VERIFYPEER
|
||||
<tr><td>HTTP.CREDENTIALS.USERPASSWORD<td>CURLOPT_USERPASSWORD
|
||||
</table>
|
||||
</ul>
|
||||
|
||||
<h3><u>Password Authentication</u></h3>
|
||||
The key
|
||||
HTTP.CREDENTIALS.USERPASSWORD
|
||||
can be used to set the simple password authentication.
|
||||
This is an alternative to setting it in the url.
|
||||
The value must be of the form "username:password".
|
||||
|
||||
CURLOPT\_USERPASSWORD
|
||||
<h3><u>Cookie Jar</u></h3>
|
||||
The HTTP.COOKIEJAR key
|
||||
specifies the name of file from which
|
||||
to read cookies (CURLOPT_COOKIEJAR) and also
|
||||
the file into which to store cookies (CURLOPT_COOKIEFILE).
|
||||
The same value is used for both CURLOPT values.
|
||||
It defaults to in-memory storage.
|
||||
|
||||
### Password Authentication
|
||||
|
||||
The key HTTP.CREDENTIALS.USERPASSWORD can be used to set the simple
|
||||
password authentication. This is an alternative to setting it in the
|
||||
url. The value must be of the form "username:password".
|
||||
|
||||
### Cookie Jar
|
||||
|
||||
The HTTP.COOKIEJAR key specifies the name of file from which to read
|
||||
cookies (CURLOPT\_COOKIEJAR) and also the file into which to store
|
||||
cookies (CURLOPT\_COOKIEFILE). The same value is used for both CURLOPT
|
||||
values. It defaults to in-memory storage.
|
||||
|
||||
### Certificate Authentication
|
||||
|
||||
HTTP.SSL.CERTIFICATE specifies a file path for a file containing a PEM
|
||||
cerficate. This is typically used for client-side authentication.
|
||||
|
||||
HTTP.SSL.KEY is essentially the same as HTTP.SSL.CERTIFICATE and should
|
||||
usually have the same value.
|
||||
|
||||
HTTP.SSL.KEYPASSWORD specifies the password for accessing the
|
||||
HTTP.SSL.KEY/HTTP.SSL.CERTIFICATE file.
|
||||
|
||||
HTTP.SSL.CAPATH specifies the path to a directory containing trusted
|
||||
certificates for validating server sertificates.
|
||||
|
||||
HTTP.SSL.VALIDATE is a boolean (1/0) value that if true (1) specifies
|
||||
that the client should verify the server's presented certificate.
|
||||
|
||||
HTTP.PROXY\_SERVER specified the url for accessing the proxy:
|
||||
<h3><u>Certificate Authentication</u></h3>
|
||||
HTTP.SSL.CERTIFICATE
|
||||
specifies a file path for a file containing a PEM cerficate.
|
||||
This is typically used for client-side authentication.
|
||||
<p>
|
||||
HTTP.SSL.KEY is essentially the same as HTTP.SSL.CERTIFICATE
|
||||
and should usually have the same value.
|
||||
<p>
|
||||
HTTP.SSL.KEYPASSWORD
|
||||
specifies the password for accessing the HTTP.SSL.KEY/HTTP.SSL.CERTIFICATE
|
||||
file.
|
||||
<p>
|
||||
HTTP.SSL.CAPATH
|
||||
specifies the path to a directory containing
|
||||
trusted certificates for validating server sertificates.
|
||||
<p>
|
||||
HTTP.SSL.VALIDATE
|
||||
is a boolean (1/0) value that if true (1)
|
||||
specifies that the client should verify the server's presented certificate.
|
||||
<p>
|
||||
HTTP.PROXY_SERVER
|
||||
specified the url for accessing the proxy:
|
||||
(e.g.http://[username:password@]host[:port])
|
||||
|
||||
Redirection-Based Authentication {.break}
|
||||
--------------------------------
|
||||
|
||||
Some sites provide authentication by using a third party site to to the
|
||||
authentication. One example is
|
||||
[URS](https://uat.urs.earthdata.nasa.gov), the EOSDIS User Registration
|
||||
System.
|
||||
|
||||
<h2 class="break"><a name="REDIR"><u>Redirection-Based Authentication</u></a> </h2>
|
||||
Some sites provide authentication by using a third party site
|
||||
to to the authentication. One example is
|
||||
<a href="https://uat.urs.earthdata.nasa.gov">URS</a>,
|
||||
the EOSDIS User Registration System.
|
||||
<p>
|
||||
The process is usually as follows.
|
||||
|
||||
1. The client contacts the server of interest (SOI), the actual data
|
||||
provider.
|
||||
2. The SOI sends a redirect to the client to connect to the URS system.
|
||||
3. The client authenticates with URS.
|
||||
4. URS sends a redirect (with authorization information) to send the
|
||||
client back to the SOI to actually obtain the data.
|
||||
|
||||
In order for this to work with libcurl, the client will usually need to
|
||||
provide a .netrc file so that the redirection will work correctly. The
|
||||
format of this .netrc file will contain content that typically look like
|
||||
this.
|
||||
|
||||
machine uat.urs.earthdata.nasa.gov login xxxxxx password yyyyyy
|
||||
|
||||
where the machine is the one to which the client is redirected for
|
||||
authorization, and the login and password are those needed to
|
||||
authenticate.
|
||||
|
||||
<ol>
|
||||
<li>The client contacts the server of interest (SOI), the actual data provider.
|
||||
<li>The SOI sends a redirect to the client to connect to the URS system.
|
||||
<li>The client authenticates with URS.
|
||||
<li>URS sends a redirect (with authorization information) to send
|
||||
the client back to the SOI to actually obtain the data.
|
||||
</ol>
|
||||
<p>
|
||||
In order for this to work with libcurl, the client will usually need
|
||||
to provide a .netrc file so that the redirection will work correctly.
|
||||
The format of this .netrc file will contain content that
|
||||
typically look like this.
|
||||
<pre>
|
||||
machine uat.urs.earthdata.nasa.gov login xxxxxx password yyyyyy
|
||||
</pre>
|
||||
where the machine is the one to which the client is redirected
|
||||
for authorization, and the login and password are those
|
||||
needed to authenticate.
|
||||
<p>
|
||||
The .netrc file can be specified in two ways.
|
||||
<ol>
|
||||
<li> Specify the netrc file to liboc using the procedure in oc.h:
|
||||
<pre>
|
||||
oc_set_netrc(OClink* link, const char* file)
|
||||
</pre>
|
||||
(This is equivalent to the -N flag to ocprint).
|
||||
<p>
|
||||
<li> Put the following line in your .daprc/.dodsrc file.
|
||||
<pre>
|
||||
HTTP.NETRC=<path to netrc file>
|
||||
</pre>
|
||||
</ol>
|
||||
<p>
|
||||
One final note. In using this, it is probable that you will
|
||||
need to specify a cookie jar (HTTP.COOKIEJAR) so that the
|
||||
redirect site can pass back authorization information.
|
||||
|
||||
1. Specify the netrc file to liboc using the procedure in oc.h:
|
||||
|
||||
oc_set_netrc(OClink* link, const char* file)
|
||||
|
||||
(This is equivalent to the -N flag to ocprint).
|
||||
|
||||
2. Put the following line in your .daprc/.dodsrc file.
|
||||
|
||||
HTTP.NETRC=<path to netrc file>
|
||||
|
||||
One final note. In using this, it is probable that you will need to
|
||||
specify a cookie jar (HTTP.COOKIEJAR) so that the redirect site can pass
|
||||
back authorization information.
|
||||
|
||||
URL Constrained RC File Entries {.break}
|
||||
-------------------------------
|
||||
|
||||
Each line of the rc file can begin with a host+port enclosed in square
|
||||
brackets. The form is "host:port". If the port is not specified then the
|
||||
form is just "host". The reason that more of the url is not used is that
|
||||
<h2 class="break"><a name="URLCONS"><u>URL Constrained RC File Entries</u></a></h2>
|
||||
Each line of the rc file can begin with
|
||||
a host+port enclosed in square brackets.
|
||||
The form is "host:port". If the port is not specified
|
||||
then the form is just "host".
|
||||
The reason that more of the url is not used is that
|
||||
libcurl's authorization grain is not any finer than host level.
|
||||
|
||||
<p>
|
||||
Examples.
|
||||
|
||||
[remotetest.unidata.ucar.edu]HTTP.VERBOSE=1
|
||||
or
|
||||
[fake.ucar.edu:9090]HTTP.VERBOSE=0
|
||||
|
||||
If the url request from, say, the *oc\_open* method has a host+port
|
||||
matchine one of the prefixes in the rc file, then the corresponding
|
||||
entry will be used, otherwise ignored.
|
||||
|
||||
<pre>
|
||||
[remotetest.unidata.ucar.edu]HTTP.VERBOSE=1
|
||||
or
|
||||
[fake.ucar.edu:9090]HTTP.VERBOSE=0
|
||||
</pre>
|
||||
If the url request from, say, the <i>oc_open</i> method
|
||||
has a host+port matchine one of the prefixes in the rc file, then
|
||||
the corresponding entry will be used, otherwise ignored.
|
||||
<p>
|
||||
For example, the URL
|
||||
|
||||
http://remotetest.unidata.ucar.edu/thredds/dodsC/testdata/testData.nc
|
||||
|
||||
<pre>
|
||||
http://remotetest.unidata.ucar.edu/thredds/dodsC/testdata/testData.nc
|
||||
</pre>
|
||||
will have HTTP.VERBOSE set to 1.
|
||||
|
||||
Similarly,
|
||||
|
||||
http://fake.ucar.edu:9090/dts/test.01
|
||||
|
||||
<p>
|
||||
Similarly,
|
||||
<pre>
|
||||
http://fake.ucar.edu:9090/dts/test.01
|
||||
</pre>
|
||||
will have HTTP.VERBOSE set to 0.
|
||||
|
||||
Client-Side Certificates {.break}
|
||||
------------------------
|
||||
|
||||
Some systems, notably ESG (Earth System Grid), requires the use of
|
||||
client-side certificates, as well as being [re-direction based](#REDIR).
|
||||
<h2 class="break"><a name="CLIENTCERTS"><u>Client-Side Certificates</u></a></h2>
|
||||
Some systems, notably ESG (Earth System Grid), requires
|
||||
the use of client-side certificates, as well as being
|
||||
<a href="#REDIR">re-direction based</a>.
|
||||
This requires setting the following entries:
|
||||
<ul>
|
||||
<li>HTTP.COOKIEJAR — a file path for storing cookies across re-direction.
|
||||
<li>HTTP.NETRC — the path to the netrc file.
|
||||
<li>HTTP.SSL.CERTIFICATE — the file path for the client side certificate file.
|
||||
<li>HTTP.SSL.KEY — this should have the same value as HTTP.SSL.CERTIFICATE.
|
||||
<li>HTTP.SSL.CAPATH — the path to a "certificates" directory.
|
||||
<li>HTTP.SSL.VALIDATE — force validation of the server certificate.
|
||||
</ul>
|
||||
Note that the first two are to support re-direction based authentication.
|
||||
|
||||
- HTTP.COOKIEJAR — a file path for storing cookies across
|
||||
re-direction.
|
||||
- HTTP.NETRC — the path to the netrc file.
|
||||
- HTTP.SSL.CERTIFICATE — the file path for the client side certificate
|
||||
file.
|
||||
- HTTP.SSL.KEY — this should have the same value as
|
||||
HTTP.SSL.CERTIFICATE.
|
||||
- HTTP.SSL.CAPATH — the path to a "certificates" directory.
|
||||
- HTTP.SSL.VALIDATE — force validation of the server certificate.
|
||||
|
||||
Note that the first two are to support re-direction based
|
||||
authentication.
|
||||
|
||||
##### Appendix A. All RC-File Keys {.break}
|
||||
|
||||
<h5 class="break"><a name="allkeys"><u>Appendix A. All RC-File Keys</u></a></h5>
|
||||
For completeness, this is the list of all rc-file keys.
|
||||
<table>
|
||||
<tr><th>Key<th>curl_easy_setopt Option
|
||||
<tr valign="top"><td>HTTP.DEFLATE<td>CUROPT_DEFLATE<br>with value "deflate,gzip"
|
||||
<tr><td>HTTP.VERBOSE <td>CUROPT_VERBOSE
|
||||
<tr><td>HTTP.TIMEOUT<td>CUROPT_TIMEOUT
|
||||
<tr><td>HTTP.USERAGENT<td>CUROPT_USERAGENT
|
||||
<tr><td>HTTP.COOKIEJAR<td>CUROPT_COOKIEJAR
|
||||
<tr><td>HTTP.COOKIE_JAR<td>CUROPT_COOKIEJAR
|
||||
<tr valign="top"><td>HTTP.PROXY_SERVER<td>CURLOPT_PROXY,<br>CURLOPT_PROXYPORT,<br>CURLOPT_PROXYUSERPWD
|
||||
<tr><td>HTTP.SSL.CERTIFICATE<td>CUROPT_SSLCERT
|
||||
<tr><td>HTTP.SSL.KEY<td>CUROPT_SSLKEY
|
||||
<tr><td>HTTP.SSL.KEYPASSWORD<td>CUROPT_KEYPASSWORD
|
||||
<tr><td>HTTP.SSL.CAINFO<td>CUROPT_SSLCAINFO
|
||||
<tr><td>HTTP.SSL.CAPATH<td>CUROPT_SSLCAPATH
|
||||
<tr><td>HTTP.SSL.VERIFYPEER<td>CUROPT_SSL_VERIFYPEER
|
||||
<tr><td>HTTP.CREDENTIALS.USERPASSWORD<td>CUROPT_USERPASSWORD
|
||||
<tr><td>HTTP.NETRC<td>CURLOPT_NETRC,CURLOPT_NETRC_FILE
|
||||
</table>
|
||||
</ul>
|
||||
|
||||
Key
|
||||
<h5 class="break"><a name="ESGDETAIL"><u>Appendix B. ESG Access in Detail</u></a></h5>
|
||||
It is possible to access Earth Systems Grid (ESG) datasets
|
||||
from ESG servers through the OC API using the techniques
|
||||
described in the section on <a href="#CLIENTCERTS">Client-Side Certificates</a>.
|
||||
<p>
|
||||
In order to access ESG datasets, however, it is necessary to
|
||||
register as a user with ESG and to setup your environment
|
||||
so that proper authentication is established between an oc
|
||||
client program and the ESG data server. Specifically, it
|
||||
is necessary to use what is called "client-side keys" to
|
||||
enable this authentication. Normally, when a client accesses
|
||||
a server in a secure fashion (using "https"), the server
|
||||
provides an authentication certificate to the client.
|
||||
With client-side keys, the client must also provide a
|
||||
certificate to the server so that the server can know with
|
||||
whom it is communicating.
|
||||
<p>
|
||||
The oc library uses the <i>curl</i> library and it is that
|
||||
underlying library that must be properly configured.
|
||||
|
||||
curl\_easy\_setopt Option
|
||||
<h3><u>Terminology</u></h3>
|
||||
The key elements for client-side keys requires the constructions of
|
||||
two "stores" on the client side.
|
||||
<ul>
|
||||
<li> Keystore - a repository to hold the client side key.
|
||||
<li> Truststore - a repository to hold a chain of certificates
|
||||
that can be used to validate the certificate
|
||||
sent by the server to the client.
|
||||
</ul>
|
||||
The server actually has a similar set of stores, but the client
|
||||
need not be concerned with those.
|
||||
|
||||
HTTP.DEFLATE
|
||||
<h3><u>Initial Steps</u></h3>
|
||||
|
||||
CUROPT\_DEFLATE\
|
||||
with value "deflate,gzip"
|
||||
The first step is to obtain authorization from ESG.
|
||||
Note that this information may evolve over time, and
|
||||
may be out of date.
|
||||
This discussion is in terms of BADC and NCSA. You will need
|
||||
to substitute as necessary.
|
||||
<ol>
|
||||
<li> Register at http://badc.nerc.ac.uk/register
|
||||
to obtain access to badc and to obtain an openid,
|
||||
which will looks something like:
|
||||
<pre>https://ceda.ac.uk/openid/Firstname.Lastname</pre>
|
||||
<li> Ask BADC for access to whatever datasets are of interest.
|
||||
<p>
|
||||
<li> Obtain short term credentials at
|
||||
http://grid.ncsa.illinois.edu/myproxy/MyProxyLogon/
|
||||
You will need to download and run the MyProxyLogon
|
||||
program.
|
||||
This will create a keyfile in, typically, the directory ".globus".
|
||||
The keyfile will have a name similar to this: "x509up_u13615"
|
||||
The other elements in ".globus" are certificates to use in
|
||||
validating the certificate your client gets from the server.
|
||||
<p>
|
||||
<li> Obtain the program source ImportKey.java
|
||||
from this location: http://www.agentbob.info/agentbob/79-AB.html
|
||||
(read the whole page, it will help you understand the remaining steps).
|
||||
</ol>
|
||||
|
||||
HTTP.VERBOSE
|
||||
<h3><u>Building the KeyStore</u></h3>
|
||||
You will have to modify the keyfile in the previous step
|
||||
and then create a keystore and install the key and a certificate.
|
||||
The commands are these:
|
||||
<pre>
|
||||
openssl pkcs8 -topk8 -nocrypt -in x509up_u13615 -inform PEM -out key.der -outform DER
|
||||
|
||||
CUROPT\_VERBOSE
|
||||
openssl x509 -in x509up_u13615 -inform PEM -out cert.der -outform DER
|
||||
|
||||
HTTP.TIMEOUT
|
||||
|
||||
CUROPT\_TIMEOUT
|
||||
|
||||
HTTP.USERAGENT
|
||||
|
||||
CUROPT\_USERAGENT
|
||||
|
||||
HTTP.COOKIEJAR
|
||||
|
||||
CUROPT\_COOKIEJAR
|
||||
|
||||
HTTP.COOKIE\_JAR
|
||||
|
||||
CUROPT\_COOKIEJAR
|
||||
|
||||
HTTP.PROXY\_SERVER
|
||||
|
||||
CURLOPT\_PROXY,\
|
||||
CURLOPT\_PROXYPORT,\
|
||||
CURLOPT\_PROXYUSERPWD
|
||||
|
||||
HTTP.SSL.CERTIFICATE
|
||||
|
||||
CUROPT\_SSLCERT
|
||||
|
||||
HTTP.SSL.KEY
|
||||
|
||||
CUROPT\_SSLKEY
|
||||
|
||||
HTTP.SSL.KEYPASSWORD
|
||||
|
||||
CUROPT\_KEYPASSWORD
|
||||
|
||||
HTTP.SSL.CAINFO
|
||||
|
||||
CUROPT\_SSLCAINFO
|
||||
|
||||
HTTP.SSL.CAPATH
|
||||
|
||||
CUROPT\_SSLCAPATH
|
||||
|
||||
HTTP.SSL.VERIFYPEER
|
||||
|
||||
CUROPT\_SSL\_VERIFYPEER
|
||||
|
||||
HTTP.CREDENTIALS.USERPASSWORD
|
||||
|
||||
CUROPT\_USERPASSWORD
|
||||
|
||||
HTTP.NETRC
|
||||
|
||||
CURLOPT\_NETRC,CURLOPT\_NETRC\_FILE
|
||||
|
||||
##### Appendix B. ESG Access in Detail {.break}
|
||||
|
||||
It is possible to access Earth Systems Grid (ESG) datasets from ESG
|
||||
servers through the OC API using the techniques described in the section
|
||||
on [Client-Side Certificates](#CLIENTCERTS).
|
||||
|
||||
In order to access ESG datasets, however, it is necessary to register as
|
||||
a user with ESG and to setup your environment so that proper
|
||||
authentication is established between an oc client program and the ESG
|
||||
data server. Specifically, it is necessary to use what is called
|
||||
"client-side keys" to enable this authentication. Normally, when a
|
||||
client accesses a server in a secure fashion (using "https"), the server
|
||||
provides an authentication certificate to the client. With client-side
|
||||
keys, the client must also provide a certificate to the server so that
|
||||
the server can know with whom it is communicating.
|
||||
|
||||
The oc library uses the *curl* library and it is that underlying library
|
||||
that must be properly configured.
|
||||
|
||||
### Terminology
|
||||
|
||||
The key elements for client-side keys requires the constructions of two
|
||||
"stores" on the client side.
|
||||
|
||||
- Keystore - a repository to hold the client side key.
|
||||
- Truststore - a repository to hold a chain of certificates that can
|
||||
be used to validate the certificate sent by the server to the
|
||||
client.
|
||||
|
||||
The server actually has a similar set of stores, but the client need not
|
||||
be concerned with those.
|
||||
|
||||
### Initial Steps
|
||||
|
||||
The first step is to obtain authorization from ESG. Note that this
|
||||
information may evolve over time, and may be out of date. This
|
||||
discussion is in terms of BADC and NCSA. You will need to substitute as
|
||||
necessary.
|
||||
|
||||
1. Register at http://badc.nerc.ac.uk/register to obtain access to badc
|
||||
and to obtain an openid, which will looks something like:
|
||||
|
||||
https://ceda.ac.uk/openid/Firstname.Lastname
|
||||
|
||||
2. Ask BADC for access to whatever datasets are of interest.
|
||||
3. Obtain short term credentials at
|
||||
http://grid.ncsa.illinois.edu/myproxy/MyProxyLogon/ You will need to
|
||||
download and run the MyProxyLogon program. This will create a
|
||||
keyfile in, typically, the directory ".globus". The keyfile will
|
||||
have a name similar to this: "x509up\_u13615" The other elements in
|
||||
".globus" are certificates to use in validating the certificate your
|
||||
client gets from the server.
|
||||
4. Obtain the program source ImportKey.java from this location:
|
||||
http://www.agentbob.info/agentbob/79-AB.html (read the whole page,
|
||||
it will help you understand the remaining steps).
|
||||
|
||||
### Building the KeyStore
|
||||
|
||||
You will have to modify the keyfile in the previous step and then create
|
||||
a keystore and install the key and a certificate. The commands are
|
||||
these:
|
||||
|
||||
openssl pkcs8 -topk8 -nocrypt -in x509up_u13615 -inform PEM -out key.der -outform DER
|
||||
|
||||
openssl x509 -in x509up_u13615 -inform PEM -out cert.der -outform DER
|
||||
|
||||
java -classpath -Dkeypassword="" -Dkeystore=./ key.der cert.der
|
||||
|
||||
Note, the file names "key.der" and "cert.der" can be whatever you
|
||||
choose. It is probably best to leave the .der extension, though.
|
||||
|
||||
### Building the TrustStore
|
||||
java -classpath <path to ImportKey.class> -Dkeypassword="<password>" -Dkeystore=./<keystorefilename> key.der cert.der
|
||||
</pre>
|
||||
Note, the file names "key.der" and "cert.der" can be whatever you choose.
|
||||
It is probably best to leave the .der extension, though.
|
||||
|
||||
<h3><u>Building the TrustStore</u></h3>
|
||||
Building the truststore is a bit tricky because as provided, the
|
||||
certificates in ".globus" need some massaging. See the script below for
|
||||
the details. The primary command is this, which is executed for every
|
||||
certificate, c, in globus. It sticks the certificate into the file named
|
||||
"truststore"
|
||||
certificates in ".globus" need some massaging. See the script below
|
||||
for the details. The primary command is this, which is executed for every
|
||||
certificate, c, in globus. It sticks the certificate into the file
|
||||
named "truststore"
|
||||
<pre>
|
||||
keytool -trustcacerts -storepass "password" -v -keystore "truststore" -importcert -file "${c}"
|
||||
</pre>
|
||||
|
||||
keytool -trustcacerts -storepass "password" -v -keystore "truststore" -importcert -file "${c}"
|
||||
<h3><u>Running the C Client</u></h3>
|
||||
|
||||
### Running the C Client
|
||||
|
||||
Refer to the section on [Client-Side Certificates](#CLIENTCERTS). The
|
||||
keys specified there must be set in the rc file to support ESG access.
|
||||
|
||||
- HTTP.COOKIEJAR=\~/.dods\_cookies
|
||||
- HTTP.NETRC=\~/.netrc
|
||||
- HTTP.SSL.CERTIFICATE=\~/esgkeystore
|
||||
- HTTP.SSL.KEY=\~/esgkeystore
|
||||
- HTTP.SSL.CAPATH=\~/.globus
|
||||
- HTTP.SSL.VALIDATE=1
|
||||
|
||||
Of course, the file paths above are suggestions only; you can modify as
|
||||
needed. The HTTP.SSL.CERTIFICATE and HTTP.SSL.KEY entries should have
|
||||
same value, which is the file path for the certificate produced by
|
||||
MyProxyLogon. The HTTP.SSL.CAPATH entry should be the path to the
|
||||
"certificates" directory produced by MyProxyLogon.
|
||||
|
||||
As noted, also uses re-direction based authentication. So, when it
|
||||
receives an initial connection from a client, it redirects to a separate
|
||||
authentication server. When that server has authenticated the client, it
|
||||
redirects back to the original url to complete the request.
|
||||
|
||||
### Script for creating Stores
|
||||
Refer to the section on <a href="#CLIENTCERTS">Client-Side Certificates</a>.
|
||||
The keys specified there must be set in the rc file to support
|
||||
ESG access.
|
||||
<ul>
|
||||
<li> HTTP.COOKIEJAR=~/.dods_cookies
|
||||
<li> HTTP.NETRC=~/.netrc
|
||||
<li> HTTP.SSL.CERTIFICATE=~/esgkeystore
|
||||
<li> HTTP.SSL.KEY=~/esgkeystore
|
||||
<li> HTTP.SSL.CAPATH=~/.globus
|
||||
<li> HTTP.SSL.VALIDATE=1
|
||||
</ul>
|
||||
Of course, the file paths above are suggestions only;
|
||||
you can modify as needed.
|
||||
The HTTP.SSL.CERTIFICATE and HTTP.SSL.KEY
|
||||
entries should have same value, which is the file path for the
|
||||
certificate produced by MyProxyLogon. The HTTP.SSL.CAPATH entry
|
||||
should be the path to the "certificates" directory produced by
|
||||
MyProxyLogon.
|
||||
<p>
|
||||
As noted, also uses re-direction based authentication.
|
||||
So, when it receives an initial connection from a client, it
|
||||
redirects to a separate authentication server. When that
|
||||
server has authenticated the client, it redirects back to
|
||||
the original url to complete the request.
|
||||
|
||||
<h3><u>Script for creating Stores</u></h3>
|
||||
The following script shows in detail how to actually construct the key
|
||||
and trust stores. It is specific to the format of the globus file as it
|
||||
was when ESG support was first added. It may have changed since then, in
|
||||
which case, you will need to seek some help in fixing this script. It
|
||||
would help if you communicated what you changed to the author so this
|
||||
document can be updated.
|
||||
and trust stores. It is specific to the format of the globus file
|
||||
as it was when ESG support was first added. It may have changed
|
||||
since then, in which case, you will need to seek some help
|
||||
in fixing this script. It would help if you communicated
|
||||
what you changed to the author so this document can be updated.
|
||||
<pre>
|
||||
#!/bin/sh -x
|
||||
KEYSTORE="esgkeystore"
|
||||
TRUSTSTORE="esgtruststore"
|
||||
GLOBUS="globus"
|
||||
TRUSTROOT="certificates"
|
||||
CERT="x509up_u13615"
|
||||
TRUSTROOTPATH="$GLOBUS/$TRUSTROOT"
|
||||
CERTFILE="$GLOBUS/$CERT"
|
||||
PWD="password"
|
||||
|
||||
#!/bin/sh -x
|
||||
KEYSTORE="esgkeystore"
|
||||
TRUSTSTORE="esgtruststore"
|
||||
GLOBUS="globus"
|
||||
TRUSTROOT="certificates"
|
||||
CERT="x509up_u13615"
|
||||
TRUSTROOTPATH="$GLOBUS/$TRUSTROOT"
|
||||
CERTFILE="$GLOBUS/$CERT"
|
||||
PWD="password"
|
||||
D="-Dglobus=$GLOBUS"
|
||||
CCP="bcprov-jdk16-145.jar"
|
||||
CP="./build:${CCP}"
|
||||
JAR="myproxy.jar"
|
||||
|
||||
D="-Dglobus=$GLOBUS"
|
||||
CCP="bcprov-jdk16-145.jar"
|
||||
CP="./build:${CCP}"
|
||||
JAR="myproxy.jar"
|
||||
# Initialize needed directories
|
||||
rm -fr build
|
||||
mkdir build
|
||||
rm -fr $GLOBUS
|
||||
mkdir $GLOBUS
|
||||
rm -f $KEYSTORE
|
||||
rm -f $TRUSTSTORE
|
||||
|
||||
# Initialize needed directories
|
||||
rm -fr build
|
||||
mkdir build
|
||||
rm -fr $GLOBUS
|
||||
mkdir $GLOBUS
|
||||
rm -f $KEYSTORE
|
||||
rm -f $TRUSTSTORE
|
||||
# Compile MyProxyCmd and ImportKey
|
||||
javac -d ./build -classpath "$CCP" *.java
|
||||
javac -d ./build ImportKey.java
|
||||
|
||||
# Compile MyProxyCmd and ImportKey
|
||||
javac -d ./build -classpath "$CCP" *.java
|
||||
javac -d ./build ImportKey.java
|
||||
# Execute MyProxyCmd
|
||||
java -cp "$CP myproxy.MyProxyCmd
|
||||
|
||||
# Execute MyProxyCmd
|
||||
java -cp "$CP myproxy.MyProxyCmd
|
||||
# Build the keystore
|
||||
openssl pkcs8 -topk8 -nocrypt -in $CERTFILE -inform PEM -out key.der -outform DER
|
||||
openssl x509 -in $CERTFILE -inform PEM -out cert.der -outform DER
|
||||
java -Dkeypassword=$PWD -Dkeystore=./${KEYSTORE} -cp ./build ImportKey key.der cert.der
|
||||
|
||||
# Build the keystore
|
||||
openssl pkcs8 -topk8 -nocrypt -in $CERTFILE -inform PEM -out key.der -outform DER
|
||||
openssl x509 -in $CERTFILE -inform PEM -out cert.der -outform DER
|
||||
java -Dkeypassword=$PWD -Dkeystore=./${KEYSTORE} -cp ./build ImportKey key.der cert.der
|
||||
# Clean up the certificates in the globus directory
|
||||
for c in ${TRUSTROOTPATH}/*.0 ; do
|
||||
alias=`basename $c .0`
|
||||
sed -e '0,/---/d' <$c >/tmp/${alias}
|
||||
echo "-----BEGIN CERTIFICATE-----" >$c
|
||||
cat /tmp/${alias} >>$c
|
||||
done
|
||||
|
||||
# Build the truststore
|
||||
for c in ${TRUSTROOTPATH}/*.0 ; do
|
||||
alias=`basename $c .0`
|
||||
echo "adding: $TRUSTROOTPATH/${c}"
|
||||
echo "alias: $alias"
|
||||
yes | keytool -trustcacerts -storepass "$PWD" -v -keystore ./$TRUSTSTORE -alias $alias -importcert -file "${c}"
|
||||
done
|
||||
exit
|
||||
</pre>
|
||||
|
||||
# Clean up the certificates in the globus directory
|
||||
for c in ${TRUSTROOTPATH}/*.0 ; do
|
||||
alias=`basename $c .0`
|
||||
sed -e '0,/---/d' <$c >/tmp/${alias}
|
||||
echo "-----BEGIN CERTIFICATE-----" >$c
|
||||
cat /tmp/${alias} >>$c
|
||||
done
|
||||
|
||||
# Build the truststore
|
||||
for c in ${TRUSTROOTPATH}/*.0 ; do
|
||||
alias=`basename $c .0`
|
||||
echo "adding: $TRUSTROOTPATH/${c}"
|
||||
echo "alias: $alias"
|
||||
yes | keytool -trustcacerts -storepass "$PWD" -v -keystore ./$TRUSTSTORE -alias $alias -importcert -file "${c}"
|
||||
done
|
||||
exit
|
||||
</body>
|
||||
</html>
|
||||
|
2721
docs/software.md
Normal file
2721
docs/software.md
Normal file
File diff suppressed because it is too large
Load Diff
@ -657,8 +657,9 @@ nc4_put_vara(NC *nc, int ncid, int varid, const size_t *startp,
|
||||
/* If we're reading, we need bufr to have enough memory to store
|
||||
* the data in the file. If we're writing, we need bufr to be
|
||||
* big enough to hold all the data in the file's type. */
|
||||
if (!(bufr = malloc(len * file_type_size)))
|
||||
BAIL(NC_ENOMEM);
|
||||
if(len > 0)
|
||||
if (!(bufr = malloc(len * file_type_size)))
|
||||
BAIL(NC_ENOMEM);
|
||||
}
|
||||
else
|
||||
#endif /* ifndef HDF5_CONVERT */
|
||||
@ -823,7 +824,7 @@ nc4_put_vara(NC *nc, int ncid, int varid, const size_t *startp,
|
||||
num_plists--;
|
||||
#endif
|
||||
#ifndef HDF5_CONVERT
|
||||
if (need_to_convert) free(bufr);
|
||||
if (need_to_convert && bufr) free(bufr);
|
||||
#endif
|
||||
|
||||
/* If there was an error return it, otherwise return any potential
|
||||
@ -1039,8 +1040,9 @@ nc4_get_vara(NC *nc, int ncid, int varid, const size_t *startp,
|
||||
/* If we're reading, we need bufr to have enough memory to store
|
||||
* the data in the file. If we're writing, we need bufr to be
|
||||
* big enough to hold all the data in the file's type. */
|
||||
if (!(bufr = malloc(len * file_type_size)))
|
||||
BAIL(NC_ENOMEM);
|
||||
if(len > 0)
|
||||
if (!(bufr = malloc(len * file_type_size)))
|
||||
BAIL(NC_ENOMEM);
|
||||
}
|
||||
else
|
||||
#endif /* ifndef HDF5_CONVERT */
|
||||
@ -1187,7 +1189,7 @@ nc4_get_vara(NC *nc, int ncid, int varid, const size_t *startp,
|
||||
#endif
|
||||
}
|
||||
#ifndef HDF5_CONVERT
|
||||
if (need_to_convert)
|
||||
if (need_to_convert && bufr != NULL)
|
||||
free(bufr);
|
||||
#endif
|
||||
if (xtend_size)
|
||||
|
@ -12,7 +12,7 @@ CLEANFILES = nc_test_classic.nc nc_test_64bit.nc nc_test_netcdf4.nc \
|
||||
tst_*.nc t_nc.nc large_files.nc quick_large_files.nc \
|
||||
tst_diskless.nc tst_diskless2.nc \
|
||||
tst_diskless3.nc tst_diskless3_file.cdl tst_diskless3_memory.cdl \
|
||||
tst_diskless4.cdl tst_diskless4.nc tst_formatx.nc
|
||||
tst_diskless4.cdl tst_diskless4.nc tst_formatx.nc unlim.nc
|
||||
|
||||
# These are the tests which are always run.
|
||||
TESTPROGRAMS = t_nc tst_small nc_test tst_misc tst_norm tst_names \
|
||||
|
@ -24,6 +24,9 @@
|
||||
#define BE_FLOAT_VARNAME "fl_be"
|
||||
#define LE_INT_VARNAME "int_le"
|
||||
#define BE_INT_VARNAME "int_be"
|
||||
#define LE_DBL_VARNAME "dbl_le"
|
||||
#define BE_DBL_VARNAME "dbl_be"
|
||||
|
||||
int main() {
|
||||
|
||||
int ncid, dimid;
|
||||
@ -31,6 +34,8 @@ int main() {
|
||||
int be_float_varid;
|
||||
int le_int_varid;
|
||||
int be_int_varid;
|
||||
int le_dbl_varid;
|
||||
int be_dbl_varid;
|
||||
int ed;
|
||||
int failures = 0;
|
||||
int retval = 0;
|
||||
@ -63,6 +68,14 @@ int main() {
|
||||
retval = nc_def_var(ncid, BE_INT_VARNAME, NC_INT, 1, &dimid, &be_int_varid);
|
||||
retval = nc_def_var_endian(ncid, be_int_varid, NC_ENDIAN_BIG);
|
||||
|
||||
/* Little-Endian Double */
|
||||
retval = nc_def_var(ncid, LE_DBL_VARNAME, NC_DOUBLE, 1, &dimid, &le_dbl_varid);
|
||||
retval = nc_def_var_endian(ncid, le_dbl_varid, NC_ENDIAN_LITTLE);
|
||||
|
||||
/* Big-Endian Double */
|
||||
retval = nc_def_var(ncid, BE_DBL_VARNAME, NC_DOUBLE, 1, &dimid, &be_dbl_varid);
|
||||
retval = nc_def_var_endian(ncid, be_dbl_varid, NC_ENDIAN_BIG);
|
||||
|
||||
|
||||
retval = nc_close(ncid);
|
||||
}
|
||||
@ -74,6 +87,13 @@ int main() {
|
||||
printf("** Checking test files.\n");
|
||||
{
|
||||
ncid = 0;
|
||||
le_float_varid = 0;
|
||||
be_float_varid = 0;
|
||||
le_int_varid = 0;
|
||||
be_int_varid = 0;
|
||||
le_dbl_varid = 0;
|
||||
be_dbl_varid = 0;
|
||||
|
||||
printf("*** %s\n",FILE_NAME_NC);
|
||||
retval = nc_open(FILE_NAME_NC, NC_NETCDF4 | NC_NOWRITE, &ncid);
|
||||
|
||||
@ -81,6 +101,8 @@ int main() {
|
||||
retval = nc_inq_varid(ncid,BE_FLOAT_VARNAME,&be_float_varid);
|
||||
retval = nc_inq_varid(ncid,LE_INT_VARNAME,&le_int_varid);
|
||||
retval = nc_inq_varid(ncid,BE_INT_VARNAME,&be_int_varid);
|
||||
retval = nc_inq_varid(ncid,LE_DBL_VARNAME,&le_dbl_varid);
|
||||
retval = nc_inq_varid(ncid,BE_DBL_VARNAME,&be_dbl_varid);
|
||||
|
||||
printf("\tLittle-Endian Float...\t");
|
||||
retval = nc_inq_var_endian(ncid,le_float_varid,&ed);
|
||||
@ -98,6 +120,14 @@ int main() {
|
||||
retval = nc_inq_var_endian(ncid,be_int_varid,&ed);
|
||||
if(ed == NC_ENDIAN_BIG) printf("passed\n"); else {printf("failed\n"); failures++;}
|
||||
|
||||
printf("\tLittle-Endian Double...\t");
|
||||
retval = nc_inq_var_endian(ncid,le_dbl_varid,&ed);
|
||||
if(ed == NC_ENDIAN_LITTLE) printf("passed\n"); else {printf("failed\n"); failures++;}
|
||||
|
||||
printf("\tBig-Endian Double...\t");
|
||||
retval = nc_inq_var_endian(ncid,be_dbl_varid,&ed);
|
||||
if(ed == NC_ENDIAN_BIG) printf("passed\n"); else {printf("failed\n"); failures++;}
|
||||
|
||||
retval = nc_close(ncid);
|
||||
}
|
||||
|
||||
|
213
ncdap_test/testauth.old
Executable file
213
ncdap_test/testauth.old
Executable file
@ -0,0 +1,213 @@
|
||||
#!/bin/sh
|
||||
|
||||
#NOEMBED=1
|
||||
#NOLOCAL=1
|
||||
#NOHOME=1
|
||||
#NOENV=1
|
||||
|
||||
#DBG=1
|
||||
#SHOW=1
|
||||
|
||||
# Choose at most 1
|
||||
#GDB=1
|
||||
#VG=1
|
||||
|
||||
NFL=1
|
||||
|
||||
WD=`pwd`
|
||||
|
||||
NETRCFILE=$WD/test_auth_netrc
|
||||
# This is the control variable
|
||||
NETRC=$NETRCFILE
|
||||
|
||||
COOKIES="${WD}/test_auth_cookies"
|
||||
|
||||
RC=.daprc
|
||||
|
||||
NCLOGFILE=stderr
|
||||
if test "x$DBG" = x1 ; then
|
||||
SHOW=1
|
||||
fi
|
||||
|
||||
# Major parameters
|
||||
|
||||
BASICCOMBO="tiggeUser:tigge"
|
||||
URLSERVER="remotetest.unidata.ucar.edu"
|
||||
URLPATH="thredds/dodsC/restrict/testData.nc"
|
||||
|
||||
# See if we need to override
|
||||
if test "x$URS" != "x" ; then
|
||||
#https://54.86.135.31/opendap/data/nc/fnoc1.nc.dds
|
||||
URLSERVER="54.86.135.31"
|
||||
URLPATH="opendap/data/nc/fnoc1.nc"
|
||||
BASICCOMBO="$URS"
|
||||
NOEMBED=1
|
||||
NETRC=$NETRCFILE
|
||||
else
|
||||
NETRC=
|
||||
fi
|
||||
|
||||
if test "x$DBG" = x1 ; then
|
||||
URLPATH="${URLPATH}#log&show=fetch"
|
||||
fi
|
||||
|
||||
# Split the combo
|
||||
BASICUSER=`echo $BASICCOMBO | cut -d: -f1`
|
||||
BASICPWD=`echo $BASICCOMBO | cut -d: -f2`
|
||||
|
||||
NCDUMP=
|
||||
for o in ./.libs/ncdump.exe ./.libs/ncdump ./ncdump.exe ./ncdump ; do
|
||||
if test -f $o ; then
|
||||
NCDUMP=$o
|
||||
break;
|
||||
fi
|
||||
done
|
||||
if test "x$NCDUMP" = x ; then
|
||||
echo "no ncdump"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test "x$SHOW" = x ; then
|
||||
OUTPUT="> /dev/null"
|
||||
else
|
||||
OUTPUT=
|
||||
fi
|
||||
|
||||
if test "x$TEMP" = x ; then
|
||||
TEMP="/tmp"
|
||||
fi
|
||||
TEMP=`echo "$TEMP" | sed -e "s|/$||"`
|
||||
|
||||
LOCALRC=./$RC
|
||||
HOMERC=${HOME}/$RC
|
||||
HOMERC=`echo "$HOMERC" | sed -e "s|//|/|g"`
|
||||
ENVRC="$TEMP/$RC"
|
||||
|
||||
cd `pwd`
|
||||
builddir=`pwd`
|
||||
# Hack for CYGWIN
|
||||
cd $srcdir
|
||||
srcdir=`pwd`
|
||||
cd ${builddir}
|
||||
|
||||
function createrc {
|
||||
if test "x$1" != x ; then
|
||||
RCP=$1
|
||||
|
||||
rm -f $RCP
|
||||
echo "Creating rc file $RCP"
|
||||
if test "x${DBG}" != x ; then
|
||||
echo "HTTP.VERBOSE=1" >>$RCP
|
||||
fi
|
||||
echo "HTTP.COOKIEJAR=${COOKIES}" >>$RCP
|
||||
if test "x${URS}" = x ; then
|
||||
echo "HTTP.CREDENTIALS.USERPASSWORD=${BASICCOMBO}" >>$RCP
|
||||
fi
|
||||
if test "x${NETRC}" != x && test "x$NFL" = x ; then
|
||||
echo "HTTP.NETRC=${NETRC}" >>$RCP
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function createnetrc {
|
||||
if test "x$1" != x ; then
|
||||
rm -f $1
|
||||
echo "Creating netrc file $1"
|
||||
echo "machine uat.urs.earthdata.nasa.gov login $BASICUSER password $BASICPWD" >>$1
|
||||
#echo "machine 54.86.135.31 login $BASICUSER password $BASICPWD" >>$1
|
||||
fi
|
||||
}
|
||||
|
||||
# Forcibly remove all and do not restore with save
|
||||
function reset {
|
||||
for f in ./$RC $HOMERC $ENVRC $COOKIES $NETRC ; do
|
||||
rm -f ${f}
|
||||
done
|
||||
}
|
||||
|
||||
# Restore from .save files
|
||||
function restore {
|
||||
for f in ./$RC $HOMERC $ENVRC $COOKIES $NETRC ; do
|
||||
rm -f ${f}
|
||||
if test -f ${f}.save ; then
|
||||
echo "restoring old ${f}"
|
||||
cp ${f}.save ${f}
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function save {
|
||||
for f in ./$RC $HOMERC $ENVRC $COOKIES $NETRC ; do
|
||||
if test -f $f ; then
|
||||
if test -f ${f}.save ; then
|
||||
ignore=1
|
||||
else
|
||||
echo "saving $f"
|
||||
cp ${f} ${f}.save
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
export LD_LIBRARY_PATH="../liblib/.libs:/usr/local/lib:/usr/lib64:$LD_LIBRARY_PATH"
|
||||
|
||||
if test "x$GDB" = x1 ; then
|
||||
NCDUMP="gdb --args $NCDUMP"
|
||||
fi
|
||||
if test "x$VG" = x1 ; then
|
||||
NCDUMP="valgrind --leak-check=full $NCDUMP"
|
||||
fi
|
||||
|
||||
# Initialize
|
||||
save
|
||||
reset
|
||||
|
||||
if test "x$NOEMBED" != x1 ; then
|
||||
echo "***Testing rc file with embedded user:pwd"
|
||||
URL="https://${BASICCOMBO}@${URLSERVER}/$URLPATH"
|
||||
# Invoke ncdump to extract a file from the URL
|
||||
echo "command: ${NCDUMP} -h $URL ${OUTPUT}"
|
||||
${NCDUMP} -h "$URL" ${OUTPUT}
|
||||
fi
|
||||
|
||||
URL="https://${URLSERVER}/$URLPATH"
|
||||
if test "x$NOLOCAL" != x1 ; then
|
||||
echo "***Testing rc file in local directory"
|
||||
# Create the rc file and (optional) netrc file in ./
|
||||
reset
|
||||
createnetrc $NETRC
|
||||
createrc $LOCALRC
|
||||
|
||||
# Invoke ncdump to extract a file the URL
|
||||
echo "command: ${NCDUMP} -h $URL ${OUTPUT}"
|
||||
${NCDUMP} -h "$URL" ${OUTPUT}
|
||||
fi
|
||||
|
||||
if test "x$NOHOME" != x1 ; then
|
||||
echo "***Testing rc file in home directory"
|
||||
# Create the rc file and (optional) netrc fil in ./
|
||||
reset
|
||||
createnetrc $NETRC
|
||||
createrc $HOMERC
|
||||
|
||||
# Invoke ncdump to extract a file the URL
|
||||
echo "command: ${NCDUMP} -h $URL ${OUTPUT}"
|
||||
${NCDUMP} -h "$URL" ${OUTPUT}
|
||||
fi
|
||||
|
||||
if test "x$NOENV" != x1 ; then
|
||||
echo "*** Testing rc file from env variable"
|
||||
# Create the rc file and (optional) netrc file
|
||||
reset
|
||||
createnetrc $NETRC
|
||||
export NCRCFILE=$ENVRC
|
||||
createrc $NCRCFILE
|
||||
|
||||
# Invoke ncdump to extract a file the URL
|
||||
echo "command: ${NCDUMP} -h $URL ${OUTPUT}"
|
||||
${NCDUMP} -h "$URL" ${OUTPUT}
|
||||
fi
|
||||
|
||||
set +x
|
||||
#restore
|
||||
|
@ -1,12 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
#NOEMBED=1
|
||||
#NOLOCAL=1
|
||||
#NOHOME=1
|
||||
#NOENV=1
|
||||
RCEMBED=1
|
||||
RCLOCAL=1
|
||||
RCHOME=1
|
||||
RCENV=1
|
||||
RCPREC=1
|
||||
|
||||
# Not currently testable in netcdf
|
||||
#RCSPEC=1
|
||||
|
||||
#DBG=1
|
||||
#SHOW=1
|
||||
#DBG=1
|
||||
|
||||
# Choose at most 1
|
||||
#GDB=1
|
||||
@ -17,14 +21,14 @@ NFL=1
|
||||
WD=`pwd`
|
||||
|
||||
NETRCFILE=$WD/test_auth_netrc
|
||||
# This is the control variable
|
||||
NETRC=$NETRCFILE
|
||||
# This is the control variable; set when needed
|
||||
unset NETRC
|
||||
|
||||
COOKIES="${WD}/test_auth_cookies"
|
||||
|
||||
RC=.daprc
|
||||
|
||||
NCLOGFILE=stderr
|
||||
OCLOGFILE=stderr
|
||||
if test "x$DBG" = x1 ; then
|
||||
SHOW=1
|
||||
fi
|
||||
@ -32,8 +36,11 @@ fi
|
||||
# Major parameters
|
||||
|
||||
BASICCOMBO="tiggeUser:tigge"
|
||||
BADCOMBO="tiggeUser:xxxxx"
|
||||
URLSERVER="remotetest.unidata.ucar.edu"
|
||||
#http://remotetest.unidata.ucar.edu/thredds/dodsC/restrict/testData.nc.html
|
||||
URLPATH="thredds/dodsC/restrict/testData.nc"
|
||||
PROTO=http
|
||||
|
||||
# See if we need to override
|
||||
if test "x$URS" != "x" ; then
|
||||
@ -41,10 +48,9 @@ if test "x$URS" != "x" ; then
|
||||
URLSERVER="54.86.135.31"
|
||||
URLPATH="opendap/data/nc/fnoc1.nc"
|
||||
BASICCOMBO="$URS"
|
||||
NOEMBED=1
|
||||
RCEMBED=0
|
||||
NETRC=$NETRCFILE
|
||||
else
|
||||
NETRC=
|
||||
PROTO=https
|
||||
fi
|
||||
|
||||
if test "x$DBG" = x1 ; then
|
||||
@ -55,23 +61,30 @@ fi
|
||||
BASICUSER=`echo $BASICCOMBO | cut -d: -f1`
|
||||
BASICPWD=`echo $BASICCOMBO | cut -d: -f2`
|
||||
|
||||
xf() { case $- in *[x]*) set +x; XP=1;; *) XP=0;; esac }
|
||||
xo() { case $XP in 1) set -x;; *) set +x;; esac }
|
||||
|
||||
xf
|
||||
NCDUMP=
|
||||
for o in ./.libs/ncdump.exe ./.libs/ncdump ./ncdump.exe ./ncdump ; do
|
||||
if test -f $o ; then
|
||||
NCDUMP=$o
|
||||
break;
|
||||
fi
|
||||
for d in "$WD/../ncdump" "$WD" ; do
|
||||
for o in $d/.libs/ncdump.exe $d/.libs/ncdump $d/ncdump.exe $d/ncdump ; do
|
||||
if test -f $o ; then
|
||||
NCDUMP=$o
|
||||
break;
|
||||
fi
|
||||
done
|
||||
if test "x$NCDUMP" != x; then break; fi
|
||||
done
|
||||
xo
|
||||
|
||||
if test "x$NCDUMP" = x ; then
|
||||
echo "no ncdump"
|
||||
exit 1
|
||||
else
|
||||
echo "NCDUMP=$NCDUMP"
|
||||
fi
|
||||
|
||||
if test "x$SHOW" = x ; then
|
||||
OUTPUT="> /dev/null"
|
||||
else
|
||||
OUTPUT=
|
||||
fi
|
||||
OUTPUT="./.output"
|
||||
|
||||
if test "x$TEMP" = x ; then
|
||||
TEMP="/tmp"
|
||||
@ -81,7 +94,8 @@ TEMP=`echo "$TEMP" | sed -e "s|/$||"`
|
||||
LOCALRC=./$RC
|
||||
HOMERC=${HOME}/$RC
|
||||
HOMERC=`echo "$HOMERC" | sed -e "s|//|/|g"`
|
||||
ENVRC="$TEMP/$RC"
|
||||
SPECRC="$TEMP/temprc"
|
||||
ENVRC="$WD/envrc"
|
||||
|
||||
cd `pwd`
|
||||
builddir=`pwd`
|
||||
@ -91,44 +105,91 @@ srcdir=`pwd`
|
||||
cd ${builddir}
|
||||
|
||||
function createrc {
|
||||
if test "x$1" != x ; then
|
||||
RCP=$1
|
||||
|
||||
rm -f $RCP
|
||||
echo "Creating rc file $RCP"
|
||||
if test "x${DBG}" != x ; then
|
||||
echo "HTTP.VERBOSE=1" >>$RCP
|
||||
fi
|
||||
echo "HTTP.COOKIEJAR=${COOKIES}" >>$RCP
|
||||
if test "x${URS}" = x ; then
|
||||
echo "HTTP.CREDENTIALS.USERPASSWORD=${BASICCOMBO}" >>$RCP
|
||||
fi
|
||||
if test "x${NETRC}" != x && test "x$NFL" = x ; then
|
||||
echo "HTTP.NETRC=${NETRC}" >>$RCP
|
||||
fi
|
||||
fi
|
||||
xf
|
||||
RCP="$1" ; shift
|
||||
unset NOPWD
|
||||
unset BADPWD
|
||||
while [[ $# > 0 ]] ; do
|
||||
case "$1" in
|
||||
nopwd) NOPWD=1 ;;
|
||||
badpwd) BADPWD=1 ;;
|
||||
*) ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
xo
|
||||
if test "x$RCP" != x ; then
|
||||
rm -f $RCP
|
||||
echo "Creating rc file $RCP"
|
||||
else
|
||||
echo "createrc: no rc specified"
|
||||
exit 1
|
||||
fi
|
||||
if test "x${DBG}" != x ; then
|
||||
echo "HTTP.VERBOSE=1" >>$RCP
|
||||
fi
|
||||
echo "HTTP.COOKIEJAR=${COOKIES}" >>$RCP
|
||||
if test "x${URS}" = x ; then
|
||||
if test "x${NOPWD}" = x ; then
|
||||
if test "x${BADPWD}" = x ; then
|
||||
echo "HTTP.CREDENTIALS.USERPASSWORD=${BASICCOMBO}" >>$RCP
|
||||
else
|
||||
echo "HTTP.CREDENTIALS.USERPASSWORD=${BADCOMBO}" >>$RCP
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "x${NETRC}" != x && test "x$NFL" = x ; then
|
||||
echo "HTTP.NETRC=${NETRC}" >>$RCP
|
||||
fi
|
||||
}
|
||||
|
||||
function createnetrc {
|
||||
if test "x$1" != x ; then
|
||||
rm -f $1
|
||||
echo "Creating netrc file $1"
|
||||
echo "machine uat.urs.earthdata.nasa.gov login $BASICUSER password $BASICPWD" >>$1
|
||||
#echo "machine 54.86.135.31 login $BASICUSER password $BASICPWD" >>$1
|
||||
fi
|
||||
xf
|
||||
NCP="$1" ; shift
|
||||
unset NOPWD
|
||||
unset BADPWD
|
||||
while [[ $# > 0 ]] ; do
|
||||
case "$1" in
|
||||
nopwd) NOPWD=1 ;;
|
||||
badpwd) BADPWD=1 ;;
|
||||
*) ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
xo
|
||||
if test "x$NCP" != x ; then
|
||||
rm -f $NCP
|
||||
echo "Creating netrc file $NCP"
|
||||
else
|
||||
echo "createnetrc: no rc specified"
|
||||
exit 1
|
||||
fi
|
||||
if test "x$URS" != x ; then
|
||||
echo "machine uat.urs.earthdata.nasa.gov login $BASICUSER password $BASICPWD" >>$NCP
|
||||
#echo "machine 54.86.135.31 login $BASICUSER password $BASICPWD" >>$1
|
||||
else
|
||||
echo -n "${PROTO}://$URLSERVER/$URLPATH" >>$NCP
|
||||
if test "x$NOPWD" = x ; then
|
||||
if test "x$BADPWD" = x ; then
|
||||
echo -n " login $BASICUSER password $BASICPWD" >>$NCP
|
||||
else
|
||||
echo -n " login $BASICUSER password xxxxxx" >>$NCP
|
||||
fi
|
||||
fi
|
||||
echo "" >>$NCP
|
||||
fi
|
||||
}
|
||||
|
||||
# Forcibly remove all and do not restore with save
|
||||
function reset {
|
||||
for f in ./$RC $HOMERC $ENVRC $COOKIES $NETRC ; do
|
||||
rm -f ${f}
|
||||
done
|
||||
for f in ./$RC $HOME/$RC $SPECRC $ENVRC $COOKIES $NETRC $OUTPUT ; do
|
||||
rm -f ${f}
|
||||
done
|
||||
unset DAPRCFILE
|
||||
}
|
||||
|
||||
# Restore from .save files
|
||||
function restore {
|
||||
for f in ./$RC $HOMERC $ENVRC $COOKIES $NETRC ; do
|
||||
rm -f ${f}
|
||||
reset
|
||||
for f in ./$RC $HOME/$RC $SPECRC $ENVRC $COOKIES $NETRC ; do
|
||||
if test -f ${f}.save ; then
|
||||
echo "restoring old ${f}"
|
||||
cp ${f}.save ${f}
|
||||
@ -137,7 +198,7 @@ function restore {
|
||||
}
|
||||
|
||||
function save {
|
||||
for f in ./$RC $HOMERC $ENVRC $COOKIES $NETRC ; do
|
||||
for f in ./$RC $HOME/$RC $SPECRC $ENVRC $COOKIES $NETRC ; do
|
||||
if test -f $f ; then
|
||||
if test -f ${f}.save ; then
|
||||
ignore=1
|
||||
@ -149,65 +210,118 @@ function save {
|
||||
done
|
||||
}
|
||||
|
||||
export LD_LIBRARY_PATH="../liblib/.libs:/usr/local/lib:/usr/lib64:$LD_LIBRARY_PATH"
|
||||
function show {
|
||||
if test "x$SHOW" = x1 ; then cat $OUTPUT; fi
|
||||
if test "x$OUTPUT" != "x"; then rm -f $OUTPUT; fi
|
||||
}
|
||||
|
||||
# Assemble the ncdump command
|
||||
if test "x$DBG" = x1; then
|
||||
NCDUMP="$NCDUMP -D1"
|
||||
fi
|
||||
|
||||
if test "x$GDB" = x1 ; then
|
||||
NCDUMP="gdb --args $NCDUMP"
|
||||
NCDUMP="gdb --args $NCDUMP"
|
||||
fi
|
||||
if test "x$VG" = x1 ; then
|
||||
NCDUMP="valgrind --leak-check=full $NCDUMP"
|
||||
fi
|
||||
|
||||
# Initialize
|
||||
xf
|
||||
save
|
||||
reset
|
||||
xo
|
||||
|
||||
if test "x$NOEMBED" != x1 ; then
|
||||
echo "***Testing rc file with embedded user:pwd"
|
||||
URL="https://${BASICCOMBO}@${URLSERVER}/$URLPATH"
|
||||
# Invoke ncdump to extract a file from the URL
|
||||
echo "command: ${NCDUMP} -h $URL ${OUTPUT}"
|
||||
${NCDUMP} -h "$URL" ${OUTPUT}
|
||||
if test "x$RCEMBED" = x1 ; then
|
||||
echo "***Testing rc file with embedded user:pwd"
|
||||
URL="${PROTO}://${BASICCOMBO}@${URLSERVER}/$URLPATH"
|
||||
unset NETRC
|
||||
# Invoke ncdump to extract a file the URL
|
||||
echo "command: ${NCDUMP} -h $URL > $OUTPUT"
|
||||
${NCDUMP} -h "$URL" > $OUTPUT
|
||||
show
|
||||
fi
|
||||
|
||||
URL="https://${URLSERVER}/$URLPATH"
|
||||
if test "x$NOLOCAL" != x1 ; then
|
||||
echo "***Testing rc file in local directory"
|
||||
# Create the rc file and (optional) netrc file in ./
|
||||
# Rest of tests assume these defaults
|
||||
URL="${PROTO}://${URLSERVER}/$URLPATH"
|
||||
NETRC=$NETRCFILE
|
||||
|
||||
if test "x$RCLOCAL" = x1 ; then
|
||||
echo "***Testing rc file in local directory"
|
||||
# Create the rc file and (optional) netrc fil in ./
|
||||
xf; reset; xo
|
||||
createnetrc $NETRC
|
||||
createrc $LOCALRC
|
||||
|
||||
# Invoke ncdump to extract a file using the URL
|
||||
echo "command: ${NCDUMP} -h $URL > $OUTPUT"
|
||||
${NCDUMP} -h "$URL" > $OUTPUT
|
||||
show
|
||||
fi
|
||||
|
||||
if test "x$RCHOME" = x1 ; then
|
||||
echo "***Testing rc file in home directory"
|
||||
# Create the rc file and (optional) netrc file in ./
|
||||
xf; reset; xo
|
||||
createnetrc $NETRC
|
||||
createrc $HOMERC
|
||||
|
||||
# Invoke ncdump to extract a file the URL
|
||||
echo "command: ${NCDUMP} -h $URL > $OUTPUT"
|
||||
${NCDUMP} -h "$URL" > $OUTPUT
|
||||
show
|
||||
fi
|
||||
|
||||
if test "x$RCSPEC" == x1 ; then
|
||||
echo "*** Testing rc file in specified directory"
|
||||
# Create the rc file and (optional) netrc file
|
||||
xf; reset; xo
|
||||
createnetrc $NETRC
|
||||
createrc $SPECRC
|
||||
|
||||
# Invoke ncdump to extract a file the URL
|
||||
echo "command: ${NCDUMP} -h $URL > $OUTPUT"
|
||||
${NCDUMP} -h "$URL" > $OUTPUT
|
||||
show
|
||||
fi
|
||||
|
||||
if test "x$RCENV" = x1 ; then
|
||||
echo "*** Testing rc file using env variable"
|
||||
# Create the rc file and (optional) netrc file
|
||||
xf; reset; xo
|
||||
createnetrc $NETRC
|
||||
echo "ENV: export DAPRCFILE=$ENVRC"
|
||||
export DAPRCFILE=$ENVRC
|
||||
createrc $DAPRCFILE
|
||||
|
||||
# Invoke ncdump to extract a file the URL
|
||||
echo "command: ${NCDUMP} -h $URL > $OUTPUT"
|
||||
${NCDUMP} -h "$URL" > $OUTPUT
|
||||
show
|
||||
export DAPRCFILE=
|
||||
fi
|
||||
|
||||
# Test that .daprc overrides netcrc for password
|
||||
URL="${PROTO}://${URLSERVER}/$URLPATH"
|
||||
NETRC=$NETRCFILE
|
||||
if test "x$RCPREC" = x1 ; then
|
||||
echo "***Testing rc vs netrc file precedence"
|
||||
# Create the rc file and (optional) netrc file in ./
|
||||
xf; reset; xo
|
||||
createnetrc $NETRC badpwd
|
||||
createrc $LOCALRC
|
||||
|
||||
# Invoke ncdump to extract a file using the URL
|
||||
echo "command: ${NCDUMP} -h $URL > $OUTPUT"
|
||||
${NCDUMP} -h "$URL" > $OUTPUT
|
||||
show
|
||||
fi
|
||||
|
||||
xf
|
||||
reset
|
||||
createnetrc $NETRC
|
||||
createrc $LOCALRC
|
||||
restore
|
||||
xo
|
||||
|
||||
# Invoke ncdump to extract a file the URL
|
||||
echo "command: ${NCDUMP} -h $URL ${OUTPUT}"
|
||||
${NCDUMP} -h "$URL" ${OUTPUT}
|
||||
fi
|
||||
|
||||
if test "x$NOHOME" != x1 ; then
|
||||
echo "***Testing rc file in home directory"
|
||||
# Create the rc file and (optional) netrc fil in ./
|
||||
reset
|
||||
createnetrc $NETRC
|
||||
createrc $HOMERC
|
||||
|
||||
# Invoke ncdump to extract a file the URL
|
||||
echo "command: ${NCDUMP} -h $URL ${OUTPUT}"
|
||||
${NCDUMP} -h "$URL" ${OUTPUT}
|
||||
fi
|
||||
|
||||
if test "x$NOENV" != x1 ; then
|
||||
echo "*** Testing rc file from env variable"
|
||||
# Create the rc file and (optional) netrc file
|
||||
reset
|
||||
createnetrc $NETRC
|
||||
export NCRCFILE=$ENVRC
|
||||
createrc $NCRCFILE
|
||||
|
||||
# Invoke ncdump to extract a file the URL
|
||||
echo "command: ${NCDUMP} -h $URL ${OUTPUT}"
|
||||
${NCDUMP} -h "$URL" ${OUTPUT}
|
||||
fi
|
||||
|
||||
set +x
|
||||
#restore
|
||||
exit
|
||||
|
||||
|
1630
oc2/daptab.c
1630
oc2/daptab.c
File diff suppressed because it is too large
Load Diff
88
oc2/daptab.h
88
oc2/daptab.h
@ -1,19 +1,19 @@
|
||||
/* A Bison parser, made by GNU Bison 3.0. */
|
||||
/* A Bison parser, made by GNU Bison 2.5. */
|
||||
|
||||
/* Bison interface for Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
|
||||
|
||||
|
||||
Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
@ -26,62 +26,54 @@
|
||||
special exception, which will cause the skeleton and the resulting
|
||||
Bison output files to be licensed under the GNU General Public
|
||||
License without this special exception.
|
||||
|
||||
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
#ifndef YY_DAP_DAP_TAB_H_INCLUDED
|
||||
# define YY_DAP_DAP_TAB_H_INCLUDED
|
||||
/* Debug traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG 1
|
||||
#endif
|
||||
#if YYDEBUG
|
||||
extern int dapdebug;
|
||||
#endif
|
||||
|
||||
/* Token type. */
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
enum yytokentype
|
||||
{
|
||||
SCAN_ALIAS = 258,
|
||||
SCAN_ARRAY = 259,
|
||||
SCAN_ATTR = 260,
|
||||
SCAN_BYTE = 261,
|
||||
SCAN_CODE = 262,
|
||||
SCAN_DATASET = 263,
|
||||
SCAN_DATA = 264,
|
||||
SCAN_ERROR = 265,
|
||||
SCAN_FLOAT32 = 266,
|
||||
SCAN_FLOAT64 = 267,
|
||||
SCAN_GRID = 268,
|
||||
SCAN_INT16 = 269,
|
||||
SCAN_INT32 = 270,
|
||||
SCAN_MAPS = 271,
|
||||
SCAN_MESSAGE = 272,
|
||||
SCAN_SEQUENCE = 273,
|
||||
SCAN_STRING = 274,
|
||||
SCAN_STRUCTURE = 275,
|
||||
SCAN_UINT16 = 276,
|
||||
SCAN_UINT32 = 277,
|
||||
SCAN_URL = 278,
|
||||
SCAN_PTYPE = 279,
|
||||
SCAN_PROG = 280,
|
||||
WORD_WORD = 281,
|
||||
WORD_STRING = 282
|
||||
};
|
||||
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||||
know about them. */
|
||||
enum yytokentype {
|
||||
SCAN_ALIAS = 258,
|
||||
SCAN_ARRAY = 259,
|
||||
SCAN_ATTR = 260,
|
||||
SCAN_BYTE = 261,
|
||||
SCAN_CODE = 262,
|
||||
SCAN_DATASET = 263,
|
||||
SCAN_DATA = 264,
|
||||
SCAN_ERROR = 265,
|
||||
SCAN_FLOAT32 = 266,
|
||||
SCAN_FLOAT64 = 267,
|
||||
SCAN_GRID = 268,
|
||||
SCAN_INT16 = 269,
|
||||
SCAN_INT32 = 270,
|
||||
SCAN_MAPS = 271,
|
||||
SCAN_MESSAGE = 272,
|
||||
SCAN_SEQUENCE = 273,
|
||||
SCAN_STRING = 274,
|
||||
SCAN_STRUCTURE = 275,
|
||||
SCAN_UINT16 = 276,
|
||||
SCAN_UINT32 = 277,
|
||||
SCAN_URL = 278,
|
||||
SCAN_PTYPE = 279,
|
||||
SCAN_PROG = 280,
|
||||
WORD_WORD = 281,
|
||||
WORD_STRING = 282
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Value type. */
|
||||
|
||||
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef int YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
int dapparse (DAPparsestate* parsestate);
|
||||
|
||||
#endif /* !YY_DAP_DAP_TAB_H_INCLUDED */
|
||||
|
@ -170,7 +170,7 @@ ocset_curlflag(OCstate* state, int flag)
|
||||
{
|
||||
struct OCSSL* ssl = &state->ssl;
|
||||
CHECK(state, CURLOPT_SSL_VERIFYPEER, (OPTARG)(ssl->verifypeer?1L:0L));
|
||||
CHECK(state, CURLOPT_SSL_VERIFYHOST, (OPTARG)(ssl->verifyhost?2L:0L));
|
||||
CHECK(state, CURLOPT_SSL_VERIFYHOST, (OPTARG)(ssl->verifyhost?1L:0L));
|
||||
if(ssl->certificate)
|
||||
CHECK(state, CURLOPT_SSLCERT, ssl->certificate);
|
||||
if(ssl->key)
|
||||
|
@ -238,7 +238,7 @@ ocdata_read(OCstate* state, OCdata* data, size_t start, size_t count,
|
||||
{
|
||||
int stat = OC_NOERR;
|
||||
XXDR* xdrs;
|
||||
OCtype etype, octype;
|
||||
OCtype etype;
|
||||
int isscalar;
|
||||
size_t elemsize, totalsize, countsize;
|
||||
OCnode* pattern;
|
||||
@ -251,8 +251,7 @@ ocdata_read(OCstate* state, OCdata* data, size_t start, size_t count,
|
||||
assert(memsize > 0);
|
||||
|
||||
pattern = data->pattern;
|
||||
octype = pattern->octype;
|
||||
assert(octype == OC_Atomic);
|
||||
assert(pattern->octype == OC_Atomic);
|
||||
etype = pattern->etype;
|
||||
|
||||
isscalar = (pattern->array.rank == 0 ? 1 : 0);
|
||||
|
@ -611,7 +611,8 @@ ocset_curlproperties(OCstate* state)
|
||||
/* If no cookie file was defined, define a default */
|
||||
char tmp[OCPATHMAX+1];
|
||||
int stat;
|
||||
snprintf(tmp,sizeof(tmp)-1,"%s/%s/",ocglobalstate.tempdir,OCDIR);
|
||||
pid_t pid = getpid();
|
||||
snprintf(tmp,sizeof(tmp)-1,"%s/%s.%ld/",ocglobalstate.tempdir,OCDIR,(long)pid);
|
||||
#ifdef _MSC_VER
|
||||
stat = mkdir(tmp);
|
||||
#else
|
||||
|
@ -13,6 +13,8 @@
|
||||
#include "ocdebug.h"
|
||||
#include "oclog.h"
|
||||
|
||||
#define OCRCFILEENV "DAPRCFILE"
|
||||
|
||||
#define RTAG ']'
|
||||
#define LTAG '['
|
||||
|
||||
@ -366,12 +368,14 @@ ocrc_load(void)
|
||||
|
||||
/* locate the configuration files in the following order:
|
||||
1. specified by set_rcfile
|
||||
2. set by OCRCFILE env variable
|
||||
2. set by DAPRCFILE env variable
|
||||
3. '.'
|
||||
4. $HOME
|
||||
*/
|
||||
if(ocglobalstate.rc.rcfile != NULL) { /* always use this */
|
||||
path = strdup(ocglobalstate.rc.rcfile);
|
||||
} else if(getenv(OCRCFILEENV) != NULL && strlen(getenv(OCRCFILEENV)) > 0) {
|
||||
path = strdup(getenv(OCRCFILEENV));
|
||||
} else {
|
||||
char** rcname;
|
||||
int found = 0;
|
||||
|
@ -593,12 +593,10 @@ ocuridecodeparams(OCURI* ocuri)
|
||||
int nparams;
|
||||
char* params = NULL;
|
||||
char** plist;
|
||||
size_t len;
|
||||
|
||||
if(ocuri == NULL) return 0;
|
||||
if(ocuri->params == NULL) return 1;
|
||||
|
||||
len = strlen(ocuri->params);
|
||||
params = strdup(ocuri->params);
|
||||
if(params == NULL)
|
||||
return 0; /* no memory */
|
||||
|
Loading…
x
Reference in New Issue
Block a user