Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Nov 2003 14:13:55 +0100 (CET)
From:      Matthias Andree <matthias.andree@gmx.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        chris@scary.beasts.org
Subject:   ports/59546: [PATCH] ftp/vsftpd: printf format string bug fix
Message-ID:  <20031121131355.645C71B929@merlin.emma.line.org>
Resent-Message-ID: <200311211320.hALDKDsA025346@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         59546
>Category:       ports
>Synopsis:       [PATCH] ftp/vsftpd: printf format string bug fix
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 21 05:20:13 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Matthias Andree
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD merlin.emma.line.org 5.1-CURRENT FreeBSD 5.1-CURRENT #1: Mon Nov  3 14:56:20 CET
>Description:
vsftpd 1.2.1 uses %030ld to print a time_t argument. This fails on machines that don't use long for time_t,
some might use long long. The patch below explicitly casts the argument to the proper type.

NOTE: THIS SHOULD BECOME PART OF FREEBSD 5.2, SO PLEASE DO COMMIT IN SPITE OF THE PORTS FREEZE!

Chris, you'll need to patch once to get the real patch, then run patch with the newly created file to patch
your source.

Port and upstream maintainer (dinoex@FreeBSD.org, chris@scary.beasts.org) are cc'd.

Generated with FreeBSD Port Tools 0.50
>How-To-Repeat:
>Fix:

--- vsftpd-1.2.1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/ftp/vsftpd/files/patch-sysutil-time_t-long /usr/home/emma/port-vsftpd/files/patch-sysutil-time_t-long
--- /usr/ports/ftp/vsftpd/files/patch-sysutil-time_t-long	Thu Jan  1 01:00:00 1970
+++ /usr/home/emma/port-vsftpd/files/patch-sysutil-time_t-long	Fri Nov 21 13:50:26 2003
@@ -0,0 +1,11 @@
+--- sysutil.c~	Tue Nov 11 02:37:16 2003
++++ sysutil.c	Fri Nov 21 13:47:12 2003
+@@ -1403,7 +1403,7 @@
+    * more recent dates appear later in the alphabet! Most notably, we must
+    * make sure we pad to the same length with 0's 
+    */
+-  snprintf(intbuf, sizeof(intbuf), "%030ld", p_stat->st_mtime);
++  snprintf(intbuf, sizeof(intbuf), "%030ld", (long)p_stat->st_mtime);
+   return intbuf;
+ }
+ 
--- vsftpd-1.2.1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031121131355.645C71B929>