rpms/ncftp/FC-4 ncftp-3.1.9-dirlist.patch, NONE, 1.1 ncftp.spec, 1.5, 1.6

Matthias Saou (thias) fedora-extras-commits at redhat.com
Fri May 12 11:15:15 UTC 2006


Author: thias

Update of /cvs/extras/rpms/ncftp/FC-4
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15590/FC-4

Modified Files:
	ncftp.spec 
Added Files:
	ncftp-3.1.9-dirlist.patch 
Log Message:
Fix directory listing crash (#187605).


ncftp-3.1.9-dirlist.patch:

--- NEW FILE ncftp-3.1.9-dirlist.patch ---
diff -u -r ncftp-3.1.9/ncftp/ls.c ncftp-3.1.9.fix/ncftp/ls.c
--- ncftp-3.1.9/ncftp/ls.c	Sat Jan  1 15:23:38 2005
+++ ncftp-3.1.9.fix/ncftp/ls.c	Wed May 10 15:39:23 2006
@@ -53,13 +53,13 @@
 	struct tm lt;
 	int i;
 
+	memset(gLsMon, 0, sizeof(gLsMon));
 	(void) Localtime(0, &lt);
 	lt.tm_mday = 15;
 	lt.tm_hour = 12;
 	for (i=0; i<12; i++) {
 		lt.tm_mon = i;
-		(void) strftime(gLsMon[i], sizeof(gLsMon[i]), "%b", &lt);
-		gLsMon[i][sizeof(gLsMon[i]) - 1] = '\0';
+		(void) strftime(gLsMon[i], sizeof(gLsMon[i]) - 1, "%b", &lt);
 	}
 	(void) strcpy(gLsMon[i], "BUG");
 }	/* InitLsMonths */
@@ -251,26 +251,36 @@
  * old (or future) date string (i.e. "Oct 27  1996").
  */
 void
-LsDate(char *dstr, time_t ts)
+LsDate(char *dstr, size_t dsiz, time_t ts)
 {
 	struct tm t;
 
 	if (ts == kModTimeUnknown) {
-		(void) strcpy(dstr, "            ");
+		(void) Strncpy(dstr, "            ", dsiz);
 		return;
 	}
 	if (Localtime(ts, &t) == NULL) {
-		(void) strcpy(dstr, "Jan  0  1900");
+		(void) Strncpy(dstr, "Jan  0  1900", dsiz);
 		return;
 	}
 	if ((ts > gNowPlus1Hr) || (ts < gNowMinus6Mon)) {
-		(void) sprintf(dstr, "%s %2d  %4d",
+#ifdef HAVE_SNPRINTF
+		(void) snprintf(dstr, dsiz,
+#else
+		(void) sprintf(dstr,
+#endif
+			"%s %2d  %4d",
 			gLsMon[t.tm_mon],
 			t.tm_mday,
 			t.tm_year + 1900
 		);
 	} else {
-		(void) sprintf(dstr, "%s %2d %02d:%02d",
+#ifdef HAVE_SNPRINTF
+		(void) snprintf(dstr, dsiz,
+#else
+		(void) sprintf(dstr,
+#endif
+			"%s %2d %02d:%02d",
 			gLsMon[t.tm_mon],
 			t.tm_mday,
 			t.tm_hour,
@@ -292,7 +302,7 @@
 	char fTail[2];
 	int fType;
 	const char *l1, *l2;
-	char datestr[16];
+	char datestr[32];
 	char sizestr[32];
 	char plugspec[16];
 	char plugstr[64];
@@ -353,7 +363,7 @@
 			l2 = "";
 		}
 
-		LsDate(datestr, diritemp->mdtm);
+		LsDate(datestr, sizeof(datestr), diritemp->mdtm);
 
 		if (diritemp->size == kSizeUnknown) {
 			*sizestr = '\0';
diff -u -r ncftp-3.1.9/ncftp/ls.h ncftp-3.1.9.fix/ncftp/ls.h
--- ncftp-3.1.9/ncftp/ls.h	Tue Jan  6 15:39:45 2004
+++ ncftp-3.1.9.fix/ncftp/ls.h	Wed May 10 15:38:54 2006
@@ -22,7 +22,7 @@
 void InitLs(void);
 void FlushLsCache(void);
 int LsCacheLookup(const char *const);
-void LsDate(char *, time_t);
+void LsDate(char *, size_t, time_t);
 void LsL(FTPFileInfoListPtr, int, int, FILE *);
 void Ls1(FTPFileInfoListPtr, int, FILE *);
 void Ls(const char *const, int, const char *const, FILE *);


Index: ncftp.spec
===================================================================
RCS file: /cvs/extras/rpms/ncftp/FC-4/ncftp.spec,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ncftp.spec	2 May 2005 18:56:41 -0000	1.5
+++ ncftp.spec	12 May 2006 11:15:15 -0000	1.6
@@ -1,7 +1,7 @@
 Summary: Improved console FTP client
 Name: ncftp
 Version: 3.1.9
-Release: 1
+Release: 4%{?dist}
 Epoch: 2
 License: Distributable
 Group: Applications/Internet
@@ -15,6 +15,7 @@
 Patch6: ncftp-3.1.5-ncursesw.patch
 Patch7: ncftp-3.1.6-rh1.patch
 Patch8: ncftp-3.1.8-epsv.patch
+Patch9: ncftp-3.1.9-dirlist.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 BuildRequires: ncurses-devel
 
@@ -34,22 +35,23 @@
 %patch6 -p1 -b .ncursesw
 #patch7 -p1 -b .ask_save
 %patch8 -p1 -b .epsv
+%patch9 -p1 -b .dirlist
 
 
 %build
 %configure --enable-signals --enable-ipv6
-make STRIPFLAG=""
-rm -f README.v6.ipv6
+%{__make} STRIPFLAG=""
+%{__rm} -f README.v6.ipv6
 
 
 %install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}{%{_bindir},%{_mandir}/man1}
+%{__rm} -rf %{buildroot}
+%{__mkdir_p} %{buildroot}{%{_bindir},%{_mandir}/man1}
 %makeinstall BINDIR=%{buildroot}%{_bindir}
 
 
 %clean
-rm -rf %{buildroot}
+%{__rm} -rf %{buildroot}
 
 
 %files
@@ -71,6 +73,16 @@
 
 
 %changelog
+* Fri May 12 2006 Matthias Saou <http://freshrpms.net/> 2:3.1.9-4
+- Include dirlist patch from Mike Gleason to fix bug #187605 reported by
+  Lauri Nurmi when using fi_FI.UTF-8 locale.
+
+* Mon Mar  6 2006 Matthias Saou <http://freshrpms.net/> 2:3.1.9-3
+- FC5 rebuild.
+
+* Thu Feb  9 2006 Matthias Saou <http://freshrpms.net/> 2:3.1.9-2
+- Rebuild for new gcc/glibc.
+
 * Thu Apr 21 2005 Matthias Saou <http://freshrpms.net/> 2:3.1.9-1
 - Update to 3.1.9.
 - Update IPv6 KAME patch to ncftp-319-v6-20050419.diff.




More information about the fedora-extras-commits mailing list