The in-tree version of p5-Net-FTPServer fails at build time with
the pending Perl update.

Diff below:

- updates to 1.125 which fixes the build issue
- removes the old patches which are no longer needed
- adds new patch to fix a faulty regex
- adds new patch to raise the default memory limit (fixes some
tests and probably some runtime issues)
- port tweak: more exact license, use the MODCPAN_EXAMPLES ports
infrastructure

One test still fails out-of-memory due to the limits but
most things work and going higher than 32MB per concurrent user
seems a bit much.

Any OKs?  Anil, do you still want to be listed as maintainer?


Index: Makefile
===================================================================
RCS file: /cvs/ports/net/p5-Net-FTPServer/Makefile,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile
--- Makefile    20 Mar 2016 19:56:52 -0000      1.13
+++ Makefile    9 Feb 2019 16:57:59 -0000
@@ -4,8 +4,7 @@ COMMENT=        secure, extensible and configur
 
 MODULES=       cpan
 PKG_ARCH=      *
-DISTNAME=      Net-FTPServer-1.122
-REVISION=      2
+DISTNAME=      Net-FTPServer-1.125
 CATEGORIES=    net
 
 MAINTAINER=    Anil Madhavapeddy <a...@openbsd.org>
@@ -17,14 +16,11 @@ RUN_DEPENDS=        archivers/p5-Archive-Zip \
                devel/p5-File-Sync \
                devel/p5-IO-stringy
 
-# GPL
+# GPLv2+
 PERMIT_PACKAGE_CDROM=  Yes
 
-FAKE_FLAGS=    NOCONF=1
-CONFIG_DIR=    ${PREFIX}/share/examples/p5-Net-FTPServer
-
-post-install:
-       ${INSTALL_DATA_DIR} ${CONFIG_DIR}
-       ${INSTALL_DATA} ${WRKSRC}/ftpd.conf ${CONFIG_DIR}/ftpd.conf
+FAKE_FLAGS=            NOCONF=1
+MODCPAN_EXAMPLES=      Yes
+MODCPAN_EXAMPLES_DIST= etc
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/net/p5-Net-FTPServer/distinfo,v
retrieving revision 1.5
diff -u -p -r1.5 distinfo
--- distinfo    18 Jan 2015 03:14:45 -0000      1.5
+++ distinfo    9 Feb 2019 16:57:59 -0000
@@ -1,2 +1,2 @@
-SHA256 (Net-FTPServer-1.122.tar.gz) = 
16UlfJgu2qg7LNXBy7MZCie4+ZlrOCy6pp0sXWFx11w=
-SIZE (Net-FTPServer-1.122.tar.gz) = 127256
+SHA256 (Net-FTPServer-1.125.tar.gz) = 
FoPXF+ddec1mMwjVHO8o4S0sUklstu9Q9XCRkqyQ4MU=
+SIZE (Net-FTPServer-1.125.tar.gz) = 128458
Index: patches/patch-lib_Net_FTPServer_pm
===================================================================
RCS file: /cvs/ports/net/p5-Net-FTPServer/patches/patch-lib_Net_FTPServer_pm,v
retrieving revision 1.1
diff -u -p -r1.1 patch-lib_Net_FTPServer_pm
--- patches/patch-lib_Net_FTPServer_pm  8 Sep 2009 21:10:59 -0000       1.1
+++ patches/patch-lib_Net_FTPServer_pm  9 Feb 2019 16:57:59 -0000
@@ -1,112 +1,49 @@
-$OpenBSD: patch-lib_Net_FTPServer_pm,v 1.1 2009/09/08 21:10:59 bluhm Exp $
---- lib/Net/FTPServer.pm.orig  Fri Jul 15 12:10:22 2005
-+++ lib/Net/FTPServer.pm       Thu Aug 27 17:13:15 2009
-@@ -4228,7 +4228,7 @@ sub _archive_generator_zip
- 
-                $zip->addMember ($memb);
-                $memb->desiredCompressionMethod
--                 (&{$ {Archive::Zip::}{COMPRESSION_DEFLATED}});
-+                 (&Archive::Zip::COMPRESSION_DEFLATED);
-                $memb->desiredCompressionLevel (9);
-              }
-        },
-@@ -4260,7 +4260,7 @@ sub _archive_generator_zip
-       if ($file)
-         {
-           unlink $tmpname;
--          $zip->writeToFileHandle ($file, 1) == &{$ {Archive::Zip::}{AZ_OK}}
-+          $zip->writeToFileHandle ($file, 1) == &Archive::Zip::AZ_OK
-             or die "failed to write to zip file: $!";
-           $file->seek (0, 0);
-         }
-@@ -4269,7 +4269,7 @@ sub _archive_generator_zip
-     unless ($file)
+$OpenBSD$
+
+Hunk #1/2 - Default memory limit is too low, various tests fail with
+16MB. 32MB still has a failure in t/240abort.t but most things work
+ok and 240abort.t represents an unusual situation. (It can be made
+to work with 64MB in perl 5.28 - earlier perl needs even more).
+
+Hunk #3 - Typo found by newer perl's "Unescaped left brace in regex"
+deprecation warning.
+
+Index: lib/Net/FTPServer.pm
+--- lib/Net/FTPServer.pm.orig
++++ lib/Net/FTPServer.pm
+@@ -358,7 +358,7 @@ process and are important in avoiding denial of servic
+ attacks against the FTP server.
+ 
+  Resource         Default   Unit
+- limit memory       16384   KBytes  Amount of memory per child
++ limit memory       32768   KBytes  Amount of memory per child
+  limit nr processes    10   (none)  Number of processes
+  limit nr files        20   (none)  Number of open files
+ 
+@@ -367,7 +367,7 @@ limit to C<-1>.
+ 
+ Example:
+ 
+- limit memory:       32768
++ limit memory:       65536
+  limit nr processes:    20
+  limit nr files:        40
+ 
+@@ -2680,7 +2680,7 @@ sub run
+     # Perform normal per-process limits.
+     if ($r == 0)
        {
-       $file = new IO::Scalar;
--      $zip->writeToFileHandle ($file, 1) == &{$ {Archive::Zip::}{AZ_OK}}
-+      $zip->writeToFileHandle ($file, 1) == &Archive::Zip::AZ_OK
-         or die "failed to write to zip file: $!";
-       $file->seek (0, 0);
-       }
-@@ -8109,16 +8109,16 @@ sub _newFromFileHandle
-     $self->fileName ($filename);
-     $self->{externalFileName} = $filename;
- 
--    $self->{compressionMethod} = &{$ {Archive::Zip::}{COMPRESSION_STORED}};
-+    $self->{compressionMethod} = &Archive::Zip::COMPRESSION_STORED;
- 
-     my ($mode, $perms, $nlink, $user, $group, $size, $time) = $fileh->status;
-     $self->{compressedSize} = $self->{uncompressedSize} = $size;
-     $self->desiredCompressionMethod
-       ($self->compressedSize > 0
--       ? &{$ {Archive::Zip::}{COMPRESSION_DEFLATED}}
--       : &{$ {Archive::Zip::}{COMPRESSION_STORED}});
-+       ? &Archive::Zip::COMPRESSION_DEFLATED
-+       : &Archive::Zip::COMPRESSION_STORED);
-     $self->unixFileAttributes ($perms);
--    $self->setLastModFileDateTimeFromUnix ($time);
-+    $self->setLastModFileDateTimeFromUnix ($time) if $time;
-     $self->isTextFile (0);
- 
-     $self;
-@@ -8136,7 +8136,7 @@ sub fh
-     return $self->{fh} if $self->{fh};
- 
-     $self->{fh} = $self->{fileh}->open ("r")
--      or return &{$ {Archive::Zip::}{AZ_IO_ERROR}};
-+      or return &Archive::Zip::AZ_IO_ERROR;
- 
-     $self->{fh};
-   }
-@@ -8146,17 +8146,17 @@ sub rewindData
-     my $self = shift;
- 
-     my $status = $self->SUPER::rewindData (@_);
--    return $status if $status != &{$ {Archive::Zip::}{AZ_OK}};
-+    return $status if $status != &Archive::Zip::AZ_OK;
- 
--    return &{$ {Archive::Zip::}{AZ_IO_ERROR}} unless $self->fh;
-+    return &Archive::Zip::AZ_IO_ERROR unless $self->fh;
- 
-     # Not all personalities can seek backwards in the stream. Close
-     # the file and reopen it instead.
--    $self->endRead == &{$ {Archive::Zip::}{AZ_OK}}
--      or return &{$ {Archive::Zip::}{AZ_IO_ERROR}};
-+    $self->endRead == &Archive::Zip::AZ_OK
-+      or return &Archive::Zip::AZ_IO_ERROR;
-     $self->fh;
- 
--    return &{$ {Archive::Zip::}{AZ_OK}};
-+    return &Archive::Zip::AZ_OK;
-   }
- 
- sub _readRawChunk
-@@ -8165,12 +8165,12 @@ sub _readRawChunk
-     my $dataref = shift;
-     my $chunksize = shift;
- 
--    return (0, &{$ {Archive::Zip::}{AZ_OK}}) unless $chunksize;
-+    return (0, &Archive::Zip::AZ_OK) unless $chunksize;
- 
-     my $bytesread = $self->fh->sysread ($$dataref, $chunksize)
--      or return (0, &{$ {Archive::Zip::}{AZ_IO_ERROR}});
-+      or return (0, &Archive::Zip::AZ_IO_ERROR);
- 
--    return ($bytesread, &{$ {Archive::Zip::}{AZ_OK}});
-+    return ($bytesread, &Archive::Zip::AZ_OK);
-   }
- 
- sub endRead
-@@ -8180,10 +8180,10 @@ sub endRead
-     if ($self->{fh})
+-      my $limit = 1024 * ($self->config ("limit memory") || 16384);
++      my $limit = 1024 * ($self->config ("limit memory") || 32768);
+       $self->_set_rlimit ("RLIMIT_DATA", $limit) if $limit >= 0;
+ 
+       $limit = $self->config ("limit nr processes") || 10;
+@@ -6688,7 +6688,7 @@ sub _LANG_command
+     # (b) there are all sorts of possible libc exploits available if
+     # the user is allowed to set this to arbitrary values.
+     unless (length ($rest) <= 8 &&
+-          $rest =~ /^[A-Z]{1,8}(-[A-Z]{1-8})*$/i)
++          $rest =~ /^[A-Z]{1,8}(-[A-Z]{1,8})*$/i)
        {
-       $self->{fh}->close
--        or return &{$ {Archive::Zip::}{AZ_IO_ERROR}};
-+        or return &Archive::Zip::AZ_IO_ERROR;
-       delete $self->{fh};
-       }
--    return &{$ {Archive::Zip::}{AZ_OK}};
-+    return &Archive::Zip::AZ_OK;
-   }
- 
- 1 # So that the require or use succeeds.
+       $self->reply (504, "Incorrect language.");
+       return;

Reply via email to