ports/131645: [UPDATE] ftp/pure-ftpd 1.0.21_2 to portrevision 3 - fix UTIME bug
Yar Odin
yarodin at gmai.com
Fri Feb 13 15:30:03 UTC 2009
>Number: 131645
>Category: ports
>Synopsis: [UPDATE] ftp/pure-ftpd 1.0.21_2 to portrevision 3 - fix UTIME bug
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Fri Feb 13 15:30:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Yar Odin
>Release: 6.4-p3
>Organization:
>Environment:
6.4-RELEASE-p3
>Description:
Pure-ftpd supports the "SITE UTIME" command, which allows the client to set the modification time of a file to a particular timestamp, expressed in UTC.
However, pure-ftpd passes the UTC timestamp directly to the operating system's utime() function, which is a bug, because utime() requires that the timestamp be in local time instead of UTC.
For example for server with MSK localtime:
> ---> MDTM cuba2008_1.mpeg.stat
> <--- 213 20090106074437
> ---> SITE UTIME cuba2008_1.mpeg.stat 20090106104437 20090106104437 20090106104437 UTC
> <--- 250 UTIME OK
http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg570090.html
http://www.smartftp.com/support/kb/pureftpd-utime-bug-f2615.html
>How-To-Repeat:
How to apply:
1) Put patch-mod_geoip.txt to /usr/ports/www/
2) cd /usr/ports/www/ && patch -E -p <patch-mod_geoip.txt && find /usr/ports/www/mod_geoip/ -type f -name "*.orig" -exec rm -f {} \;
>Fix:
Patch attached with submission follows:
diff -ruN pure-ftpd.orig/Makefile pure-ftpd/Makefile
--- pure-ftpd.orig/Makefile 2008-02-16 08:57:37.000000000 +0300
+++ pure-ftpd/Makefile 2009-02-13 17:59:31.000000000 +0300
@@ -7,7 +7,7 @@
PORTNAME= pure-ftpd
PORTVERSION= 1.0.21
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= ftp ipv6
MASTER_SITES= http://download.pureftpd.org/pub/pure-ftpd/releases/ \
ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/ \
diff -ruN pure-ftpd.orig/files/patch-src_ftpd.c pure-ftpd/files/patch-src_ftpd.c
--- pure-ftpd.orig/files/patch-src_ftpd.c 2008-02-14 14:55:22.000000000 +0300
+++ pure-ftpd/files/patch-src_ftpd.c 2009-02-13 17:56:30.000000000 +0300
@@ -1,6 +1,15 @@
---- src/ftpd.c 2006-02-21 14:14:49.000000000 +0100
-+++ src/ftpd.c 2007-12-20 14:53:56.000000000 +0100
-@@ -3439,14 +3439,14 @@ void dofeat(void)
+--- src/ftpd.c.orig 2006-02-21 16:14:49.000000000 +0300
++++ src/ftpd.c 2009-02-13 17:55:48.000000000 +0300
+@@ -2541,7 +2541,7 @@
+ tm.tm_mon--;
+ tm.tm_year -= 1900;
+ if (tm.tm_mon < 0 || tm.tm_year <= 0 ||
+- (ts = mktime(&tm)) == (time_t) -1) {
++ (ts = timegm(&tm)) == (time_t) -1) {
+ addreply_noformat(501, MSG_TIMESTAMP_FAILURE);
+ return;
+ }
+@@ -3439,14 +3439,14 @@
# define FEAT_UTF8 ""
#endif
@@ -17,5 +26,3 @@
}
#endif
addreply_noformat(0, feat);
-
-
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list