From nobody@FreeBSD.org  Fri Feb 13 15:22:23 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9746E10656F6
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 Feb 2009 15:22:23 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 685A38FC21
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 Feb 2009 15:22:23 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DFMM5S047360
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 13 Feb 2009 15:22:22 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n1DFMMEr047359;
	Fri, 13 Feb 2009 15:22:22 GMT
	(envelope-from nobody)
Message-Id: <200902131522.n1DFMMEr047359@www.freebsd.org>
Date: Fri, 13 Feb 2009 15:22:22 GMT
From: Yar Odin <yarodin@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [UPDATE] ftp/pure-ftpd 1.0.21_2 to portrevision 3 - fix UTIME bug
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>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:    garga
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 13 15:30:02 UTC 2009
>Closed-Date:    Mon Feb 16 11:26:22 UTC 2009
>Last-Modified:  Mon Feb 16 11:30:03 UTC 2009
>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:
Responsible-Changed-From-To: freebsd-ports-bugs->garga 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Fri Feb 13 15:30:13 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=131645 
State-Changed-From-To: open->closed 
State-Changed-By: garga 
State-Changed-When: Mon Feb 16 11:26:22 UTC 2009 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=131645 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/131645: commit references a PR
Date: Mon, 16 Feb 2009 11:26:30 +0000 (UTC)

 garga       2009-02-16 11:26:01 UTC
 
   FreeBSD ports repository
 
   Modified files:
     ftp/pure-ftpd        Makefile 
     ftp/pure-ftpd/files  patch-src_ftpd.c 
   Log:
   Fix following problem:
   
   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
   
   PR:             ports/131645
   Submitted by:   Yar Odin <yarodin@gmai.com>
   
   Revision  Changes    Path
   1.61      +1 -1      ports/ftp/pure-ftpd/Makefile
   1.2       +12 -5     ports/ftp/pure-ftpd/files/patch-src_ftpd.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
