netcdf-c/oc2/occurlfunctions.h
Dennis Heimbigner bc9e41ae2b 1. Fix bug in ocrc.c#combinecredentials where a null user+pwd
generates garbage. This in turn interferes with using .netrc
because the garbage user+pwd can will override the
.netrc. Note that this may work ok sometimes
if the garbage happens to start with a nul character.

2. It turns out that the user:pwd combination needs to support
character escaping. One reason is the user may contain an '@' character.
The other is that modern password rules make it not unlikely that
the password will contain characters that interfere with url parsing.
So, the rule I have implemented is that all occurrences of the user:pwd
format must escape any dodgy characters. The escape format is URL escaping
of the form %XX. This applies both to user:pwd
embedded in a URL as well as the use of HTTP.CREDENTIALS.USERPASSWORD
in a .dodsrc/.daprc file. The user and password in .netrc must not
be escaped. This is now documented in docs/auth.md

The fix for #2 actually obviated #1. Now, internally, the user and pwd
are stored separately and not in the user:pwd format. They are combined
(and escaped) only when needed.
2017-08-29 14:11:15 -06:00

35 lines
897 B
C

/*
* occurlfunction.h
*
* Created on: Mar 5, 2009
* Author: rikki
*/
#ifndef _CURLFUNCTION_H_
#define _CURLFUNCTION_H_
extern OCerror ocset_curlopt(OCstate* state, int flag, void* value);
struct OCCURLFLAG* occurlflagbyflag(int flag);
struct OCCURLFLAG* occurlflagbyname(const char* name);
extern OCerror ocset_flags_perfetch(OCstate*);
extern OCerror ocset_flags_perlink(OCstate*);
extern OCerror ocset_curlflag(OCstate*,int);
extern void oc_curl_debug(OCstate* state);
extern void oc_curl_printerror(OCstate* state);
extern int ocrc_netrc_required(OCstate* state);
extern void oc_curl_protocols(struct OCGLOBALSTATE*);
/* From occurlflags.c */
extern struct OCCURLFLAG* occurlflags(void);
extern struct OCCURLFLAG* occurlflagbyname(const char*);
extern struct OCCURLFLAG* occurlflagbyflag(int);
extern char* occombinehostport(const NCURI* uri);
#endif /*_CURLFUNCTION_H_*/