pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/gftp Fix a possible stack overflow on architecture...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2c96c024e203
branches:  trunk
changeset: 515214:2c96c024e203
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Tue Jun 27 20:11:12 2006 +0000

description:
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:

 net/gftp/Makefile         |   4 +-
 net/gftp/distinfo         |   5 +-
 net/gftp/patches/patch-ae |  77 +++++++++++++++++++++++++++++++++++++++++++---
 net/gftp/patches/patch-ag |  20 ++++++++++++
 4 files changed, 97 insertions(+), 9 deletions(-)

diffs (146 lines):

diff -r 2e1e7eebcc50 -r 2c96c024e203 net/gftp/Makefile
--- a/net/gftp/Makefile Tue Jun 27 19:44:49 2006 +0000
+++ b/net/gftp/Makefile Tue Jun 27 20:11:12 2006 +0000
@@ -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 -r 2e1e7eebcc50 -r 2c96c024e203 net/gftp/distinfo
--- a/net/gftp/distinfo Tue Jun 27 19:44:49 2006 +0000
+++ b/net/gftp/distinfo Tue Jun 27 20:11:12 2006 +0000
@@ -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-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 -r 2e1e7eebcc50 -r 2c96c024e203 net/gftp/patches/patch-ae
--- a/net/gftp/patches/patch-ae Tue Jun 27 19:44:49 2006 +0000
+++ b/net/gftp/patches/patch-ae Tue Jun 27 20:11:12 2006 +0000
@@ -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 @@
  /* ************ 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 -r 2e1e7eebcc50 -r 2c96c024e203 net/gftp/patches/patch-ag
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/gftp/patches/patch-ag Tue Jun 27 20:11:12 2006 +0000
@@ -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 */



Home | Main Index | Thread Index | Old Index