summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorjoerg <joerg>2006-06-27 20:11:12 +0000
committerjoerg <joerg>2006-06-27 20:11:12 +0000
commitf7f743e35ac8e0b45786b83a63619ae951a321ad (patch)
treef14601877e160756af118eac86eabecacd9de3d9 /net
parent7906e9dfddfade4e4b39c1a81969e8b0c36d22ed (diff)
downloadpkgsrc-f7f743e35ac8e0b45786b83a63619ae951a321ad.tar.gz
Fix a possible stack overflow on architectures with MAXNAMLEN > 255,
like Solaris. Comment out some unused functions messing with the dirent interface to fix the build on DragonFly. Bump revision.
Diffstat (limited to 'net')
-rw-r--r--net/gftp/Makefile4
-rw-r--r--net/gftp/distinfo5
-rw-r--r--net/gftp/patches/patch-ae77
-rw-r--r--net/gftp/patches/patch-ag20
4 files changed, 97 insertions, 9 deletions
diff --git a/net/gftp/Makefile b/net/gftp/Makefile
index c9152afccf4..716bfabc0c5 100644
--- a/net/gftp/Makefile
+++ b/net/gftp/Makefile
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.25 2006/06/11 13:56:41 joerg Exp $
+# $NetBSD: Makefile,v 1.26 2006/06/27 20:11:12 joerg Exp $
#
.include "${.CURDIR}/Makefile.common"
COMMENT= Multithreaded GTK2+ ftp client
-PKGREVISION= 4
+PKGREVISION= 5
CONFLICTS= gftp-gtk1-[0-9]*
diff --git a/net/gftp/distinfo b/net/gftp/distinfo
index f519acfd5ba..ec0b7d731f3 100644
--- a/net/gftp/distinfo
+++ b/net/gftp/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.12 2005/10/13 16:44:59 wiz Exp $
+$NetBSD: distinfo,v 1.13 2006/06/27 20:11:12 joerg Exp $
SHA1 (gftp-2.0.18.tar.bz2) = c2468f1ff1fe978a5fab3a198e513558f3b48f5a
RMD160 (gftp-2.0.18.tar.bz2) = 0e0daea8543ae822b25635647360193362a2648d
@@ -7,5 +7,6 @@ SHA1 (patch-aa) = fe0aff2e0f8408d6a5b663e2095b61b9e92e0d84
SHA1 (patch-ab) = c95c215694e63f32924285b71c32a5b94a566864
SHA1 (patch-ac) = 862f2f5856da4f361f2cac660ffd489424a854d8
SHA1 (patch-ad) = 4024658780e23543b47901b802d0e8d7c469f7b6
-SHA1 (patch-ae) = 54e5d9370b2bfd9c410823d3c2d4f522744fa88d
+SHA1 (patch-ae) = 05d7f9a99a23a58ed3cc2ef0c9a6ac29233c4626
SHA1 (patch-af) = 99e1509d69b6e418cf383964ca71e4fef6010418
+SHA1 (patch-ag) = ed129bee0f227eaab3f182c65fb9fd14c7d90fda
diff --git a/net/gftp/patches/patch-ae b/net/gftp/patches/patch-ae
index f4ce2d9beca..607f7ae17c0 100644
--- a/net/gftp/patches/patch-ae
+++ b/net/gftp/patches/patch-ae
@@ -1,9 +1,7 @@
-$NetBSD: patch-ae,v 1.1 2005/03/14 14:50:48 rillig Exp $
+$NetBSD: patch-ae,v 1.2 2006/06/27 20:11:12 joerg Exp $
-NetBSD-1.6.2 does not know about ENOTSUP.
-
---- lib/fsplib/fsplib.c.orig Wed Jan 19 03:03:45 2005
-+++ lib/fsplib/fsplib.c Sat Mar 12 11:04:49 2005
+--- lib/fsplib/fsplib.c.orig 2005-01-19 02:03:45.000000000 +0000
++++ lib/fsplib/fsplib.c
@@ -27,6 +27,10 @@ use of this software.
#include "fsplib.h"
#include "lock.h"
@@ -15,3 +13,72 @@ NetBSD-1.6.2 does not know about ENOTSUP.
/* ************ Internal functions **************** */
/* builds filename in packet output buffer, appends password if needed */
+@@ -575,6 +579,7 @@ FSP_DIR * fsp_opendir(FSP_SESSION *s,con
+ return dir;
+ }
+
++#if 0
+ int fsp_readdir_r(FSP_DIR *dir,struct dirent *entry, struct dirent **result)
+ {
+ FSP_RDENTRY fentry,*fresult;
+@@ -632,6 +637,7 @@ int fsp_readdir_r(FSP_DIR *dir,struct di
+
+ return 0;
+ }
++#endif
+
+ /* native FSP directory reader */
+ int fsp_readdir_native(FSP_DIR *dir,FSP_RDENTRY *entry, FSP_RDENTRY **result)
+@@ -681,25 +687,25 @@ int fsp_readdir_native(FSP_DIR *dir,FSP_
+ dir->dirpos += 9;
+ /* read file name */
+ entry->name[255 + 1] = '\0';
+- strncpy(entry->name,(char *)( dir->data + dir->dirpos ),MAXNAMLEN);
+ namelen = strlen( (char *) dir->data+dir->dirpos);
++ if (namelen >= sizeof(entry->name) - 1) {
++ /* skip over file name */
++ dir->dirpos += namelen +1;
++ /* pad to 4 byte boundary */
++ entry->reclen += (4 - dir->dirpos) & 3;
++ dir->dirpos += (4 - dir->dirpos) & 3;
++ continue;
++ }
++ strncpy(entry->name,(char *)( dir->data + dir->dirpos ), sizeof(entry->name));
+ /* skip over file name */
+ dir->dirpos += namelen +1;
+
+ /* set entry namelen field */
+- if (namelen > 255)
+- entry->namlen = 255;
+- else
+- entry->namlen = namelen;
++ entry->namlen = namelen;
+ /* set record length */
+ entry->reclen = 10+namelen;
+
+- /* pad to 4 byte boundary */
+- while( dir->dirpos & 0x3 )
+- {
+- dir->dirpos++;
+- entry->reclen++;
+- }
++ dir->dirpos += (4 - dir->dirpos) & 3;
+
+ /* and return it */
+ *result=entry;
+@@ -707,6 +713,7 @@ int fsp_readdir_native(FSP_DIR *dir,FSP_
+ }
+ }
+
++#if 0
+ struct dirent * fsp_readdir(FSP_DIR *dirp)
+ {
+ static struct dirent entry;
+@@ -719,6 +726,7 @@ struct dirent * fsp_readdir(FSP_DIR *dir
+ else
+ return result;
+ }
++#endif
+
+ long fsp_telldir(FSP_DIR *dirp)
+ {
diff --git a/net/gftp/patches/patch-ag b/net/gftp/patches/patch-ag
new file mode 100644
index 00000000000..8211250eb16
--- /dev/null
+++ b/net/gftp/patches/patch-ag
@@ -0,0 +1,20 @@
+$NetBSD: patch-ag,v 1.1 2006/06/27 20:11:12 joerg Exp $
+
+--- lib/fsplib/fsplib.h.orig 2006-06-19 16:18:50.000000000 +0000
++++ lib/fsplib/fsplib.h
+@@ -153,11 +153,15 @@ int fsp_transaction(FSP_SESSION *s,FSP_P
+
+ /* directory listing commands */
+ FSP_DIR * fsp_opendir(FSP_SESSION *s,const char *dirname);
++#if 0
+ int fsp_readdir_r(FSP_DIR *dir,struct dirent *entry, struct dirent **result);
++#endif
+ long fsp_telldir(FSP_DIR *dirp);
+ void fsp_seekdir(FSP_DIR *dirp, long loc);
+ void fsp_rewinddir(FSP_DIR *dirp);
++#if 0
+ struct dirent * fsp_readdir(FSP_DIR *dirp);
++#endif
+ int fsp_readdir_native(FSP_DIR *dir,FSP_RDENTRY *entry, FSP_RDENTRY **result);
+ int fsp_closedir(FSP_DIR *dirp);
+ /* high level file i/o */