rpms/ncftp/devel ncftp-3.1.9-dirlist.patch, NONE, 1.1 ncftp.spec, 1.7, 1.8
Matthias Saou (thias)
fedora-extras-commits at redhat.com
Fri May 12 11:15:22 UTC 2006
- Previous message (by thread): rpms/ncftp/FC-5 ncftp-3.1.9-dirlist.patch, NONE, 1.1 ncftp.spec, 1.7, 1.8
- Next message (by thread): rpms/perl-Test-SubCalls/FC-5 .cvsignore, 1.2, 1.3 perl-Test-SubCalls.spec, 1.1, 1.2 sources, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: thias
Update of /cvs/extras/rpms/ncftp/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15590/devel
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.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", <);
- gLsMon[i][sizeof(gLsMon[i]) - 1] = '\0';
+ (void) strftime(gLsMon[i], sizeof(gLsMon[i]) - 1, "%b", <);
}
(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/devel/ncftp.spec,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ncftp.spec 6 Mar 2006 15:22:30 -0000 1.7
+++ ncftp.spec 12 May 2006 11:15:21 -0000 1.8
@@ -1,7 +1,7 @@
Summary: Improved console FTP client
Name: ncftp
Version: 3.1.9
-Release: 3%{?dist}
+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,6 +35,7 @@
%patch6 -p1 -b .ncursesw
#patch7 -p1 -b .ask_save
%patch8 -p1 -b .epsv
+%patch9 -p1 -b .dirlist
%build
@@ -71,6 +73,10 @@
%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.
- Previous message (by thread): rpms/ncftp/FC-5 ncftp-3.1.9-dirlist.patch, NONE, 1.1 ncftp.spec, 1.7, 1.8
- Next message (by thread): rpms/perl-Test-SubCalls/FC-5 .cvsignore, 1.2, 1.3 perl-Test-SubCalls.spec, 1.1, 1.2 sources, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list