diff options
author | joerg <joerg@pkgsrc.org> | 2007-07-14 22:57:15 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2007-07-14 22:57:15 +0000 |
commit | ca03bfb945a00d4777d725efd70fd9d79426b50c (patch) | |
tree | cd1f8f7e2ec6cdc8ca242e53e996941b49a61e35 | |
parent | 21a4cd070a04578b62b3ace25b53284255195f1a (diff) | |
download | pkgsrc-ca03bfb945a00d4777d725efd70fd9d79426b50c.tar.gz |
Merge 1.75 of lib/ftpio.c from NetBSD:
When fixing vsftpd, other FTP server were broken as they return
different error codes for unmatching glob patterns. Basically ignore the
error code and just try the other pattern. chdir errors are still
considered fatal.
Bump version to 20070715.
-rw-r--r-- | pkgtools/pkg_install/files/lib/ftpio.c | 18 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/lib/version.h | 4 |
2 files changed, 10 insertions, 12 deletions
diff --git a/pkgtools/pkg_install/files/lib/ftpio.c b/pkgtools/pkg_install/files/lib/ftpio.c index 43ec0c1a372..00a746a0f29 100644 --- a/pkgtools/pkg_install/files/lib/ftpio.c +++ b/pkgtools/pkg_install/files/lib/ftpio.c @@ -1,4 +1,4 @@ -/* $NetBSD: ftpio.c,v 1.21 2007/04/16 12:55:35 joerg Exp $ */ +/* $NetBSD: ftpio.c,v 1.22 2007/07/14 22:57:15 joerg Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -8,7 +8,7 @@ #include <sys/cdefs.h> #endif #ifndef lint -__RCSID("$NetBSD: ftpio.c,v 1.21 2007/04/16 12:55:35 joerg Exp $"); +__RCSID("$NetBSD: ftpio.c,v 1.22 2007/07/14 22:57:15 joerg Exp $"); #endif /*- @@ -655,7 +655,7 @@ ftp_expand_URL(const char *base, char *pattern) char *s, buf[MaxPathSize]; char tmpname[MaxPathSize]; char best[MaxPathSize]; - int rc, tfd, retry_tbz; + int rc, got_list, tfd, retry_tbz; retry_tbz = 0; best[0]='\0'; @@ -700,12 +700,10 @@ retry_with_tbz: } rc = ftp_cmd(buf, "\n(550|450|226).*\n"); /* catch errors */ - if (rc != 226) { - if (Verbose) - warnx("nlist failed!"); - unlink(tmpname); /* remove clutter */ - return NULL; - } + if (rc != 226) + got_list = 0; + else + got_list = 1; /* Sync - don't remove */ rc = ftp_cmd("cd .\n", "\n(550|250|257).*\n"); @@ -715,7 +713,7 @@ retry_with_tbz: return NULL; } - if (access(tmpname, R_OK)==0) { + if (got_list == 1 && access(tmpname, R_OK)==0) { int matches; FILE *f; char filename[MaxPathSize]; diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h index 173ccf1a053..739737b4d37 100644 --- a/pkgtools/pkg_install/files/lib/version.h +++ b/pkgtools/pkg_install/files/lib/version.h @@ -1,4 +1,4 @@ -/* $NetBSD: version.h,v 1.66 2007/07/14 20:19:48 adrianp Exp $ */ +/* $NetBSD: version.h,v 1.67 2007/07/14 22:57:15 joerg Exp $ */ /* * Copyright (c) 2001 Thomas Klausner. All rights reserved. @@ -33,6 +33,6 @@ #ifndef _INST_LIB_VERSION_H_ #define _INST_LIB_VERSION_H_ -#define PKGTOOLS_VERSION "20070714" +#define PKGTOOLS_VERSION "20070715" #endif /* _INST_LIB_VERSION_H_ */ |