fix port parsing error in read_secrets

This commit is contained in:
wbaumann 2009-06-05 20:08:38 +00:00
parent 4c101585b0
commit 2c93b8d9b6
2 changed files with 7 additions and 2 deletions

View File

@ -6,6 +6,8 @@ ChangeLog for davfs2
Do HEAD if no etag returned (regression in 1.4.0).
* mount_davfs.c, read_secrets:
For URLs only check port if present.
* redo the above: set port to default if not present
and check.

2009-05-31 Werner Baumann (werner.baumann@onlinehome.de)
* cache.c, cache.h, dav_coda.c, dav_fuse.c:

View File

@ -2356,6 +2356,9 @@ read_secrets(dav_args *args, const char *filename)
int port = 0;
char *path = 0;
split_uri(&scheme, &host, &port, &path, parmv[0]);
int p_port = port;
if (!port)
port = ne_uri_defaultport(scheme);

char *ccert = NULL;
if (args->clicert) {
@ -2373,7 +2376,7 @@ read_secrets(dav_args *args, const char *filename)
|| (scheme && args->scheme
&& strcmp(scheme, args->scheme) == 0
&& host && args->host && strcmp(host, args->host) == 0
&& (!port || port == args->port)
&& port == args->port
&& path && args->path
&& strcmp(path, args->path) == 0)) {

@ -2392,7 +2395,7 @@ read_secrets(dav_args *args, const char *filename)
} else if (strcmp(parmv[0], "proxy") == 0
|| (host && args->p_host
&& strcmp(host, args->p_host) == 0
&& (!port || port == args->p_port))) {
&& (!p_port || p_port == args->p_port))) {

if (args->p_user) {
memset(args->p_user, '\0', strlen(args->p_user));