From bbbfe0f4ec4d131a7c40ca817dc0e67b0d7f2d41 Mon Sep 17 00:00:00 2001 From: cvsdist Date: Sep 09 2004 04:19:26 +0000 Subject: auto-import changelog data from dos2unix-3.1-10.src.rpm Thu Feb 28 2002 Trond Eivind Glomsr�d 3.1-10 - Build in new environment Thu Jan 17 2002 Bernhard Rosenkraenzer - Fix bug #57700 (segfault) - Add the mac2unix symlink recommended in README - Fix compiler warnings Wed Jan 09 2002 Tim Powers - automated rebuild --- diff --git a/dos2unix-3.1-segfault.patch b/dos2unix-3.1-segfault.patch new file mode 100644 index 0000000..7c8391b --- /dev/null +++ b/dos2unix-3.1-segfault.patch @@ -0,0 +1,93 @@ +--- dos2unix-3.1/dos2unix.c.segf Thu Jan 17 17:27:42 2002 ++++ dos2unix-3.1/dos2unix.c Thu Jan 17 17:28:07 2002 +@@ -147,9 +147,9 @@ + * RetVal: NULL if failure + * file stream otherwise + */ +-FILE* OpenOutFile(char *ipFN) ++FILE* OpenOutFile(int fd) + { +- return (fopen(ipFN, W_CNTRL)); ++ return (fdopen(fd, W_CNTRL)); + } + + +@@ -260,14 +260,17 @@ + char TempPath[16]; + struct stat StatBuf; + struct utimbuf UTimeBuf; ++ int fd; + + /* retrieve ipInFN file date stamp */ + if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) + RetVal = -1; + +- strcpy (TempPath, "./d2utmp"); +- strcat (TempPath, "XXXXXX"); +- mkstemp (TempPath); ++ strcpy (TempPath, "./d2utmpXXXXXX"); ++ if((fd=mkstemp (TempPath))<0) { ++ perror("Failed to open output temp file"); ++ RetVal = -1; ++ } + + #ifdef DEBUG + fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath); +@@ -278,7 +281,7 @@ + RetVal = -1; + + /* can open out file? */ +- if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL)) ++ if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL)) + { + fclose (InF); + RetVal = -1; +@@ -295,6 +298,8 @@ + /* can close out file? */ + if ((TempF) && (fclose(TempF) == EOF)) + RetVal = -1; ++ if(fd>=0) ++ close(fd); + + if ((!RetVal) && (ipFlag->KeepDate)) + { +@@ -340,14 +345,17 @@ + char TempPath[16]; + struct stat StatBuf; + struct utimbuf UTimeBuf; ++ int fd; + + /* retrieve ipInFN file date stamp */ + if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf)) + RetVal = -1; + +- strcpy (TempPath, "./u2dtmp"); +- strcat (TempPath, "XXXXXX"); +- mkstemp (TempPath); ++ strcpy (TempPath, "./u2dtmpXXXXXX"); ++ if((fd=mkstemp (TempPath))<0) { ++ perror("Failed to open output temp file"); ++ RetVal = -1; ++ } + + #ifdef DEBUG + fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath); +@@ -358,7 +366,7 @@ + RetVal = -1; + + /* can open out file? */ +- if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL)) ++ if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL)) + { + fclose (InF); + RetVal = -1; +@@ -376,6 +384,9 @@ + if ((TempF) && (fclose(TempF) == EOF)) + RetVal = -1; + ++ if(fd>=0) ++ close(fd); ++ + if ((!RetVal) && (ipFlag->KeepDate)) + { + UTimeBuf.actime = StatBuf.st_atime; diff --git a/dos2unix.spec b/dos2unix.spec index a8157df..255b2f3 100644 --- a/dos2unix.spec +++ b/dos2unix.spec @@ -1,12 +1,13 @@ Summary: Text file format converter Name: dos2unix Version: 3.1 -Release: 7 +Release: 10 Group: Applications/Text -Copyright: Freely distributable +License: Freely distributable Source: %{name}-%{version}.tar.bz2 Patch0: %{name}-%{version}.patch -Buildroot: %{_tmppath}/%{name}-root +Patch1: dos2unix-3.1-segfault.patch +Buildroot: %{_tmppath}/%{name}-%{version}-root %description Dos2unix converts DOS or MAC text files to UNIX format. @@ -14,28 +15,45 @@ Dos2unix converts DOS or MAC text files to UNIX format. %prep %setup -q %patch0 -p1 -b .orig +%patch1 -p1 -b .segf +perl -pi -e 's,(#endif|#else)[^ ]*(.*),$1 /* $2 */,g' *.[ch] %build make clean make CFLAGS="$RPM_OPT_FLAGS" +make link %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1} install -m755 dos2unix $RPM_BUILD_ROOT%{_bindir} +install -m755 mac2unix $RPM_BUILD_ROOT%{_bindir} install -m444 dos2unix.1 $RPM_BUILD_ROOT%{_mandir}/man1 +install -m444 mac2unix.1 $RPM_BUILD_ROOT%{_mandir}/man1 %files %defattr(-,root,root,0755) %doc COPYRIGHT %{_bindir}/dos2unix +%{_bindir}/mac2unix %{_mandir}/*/* %clean rm -rf $RPM_BUILD_ROOT %changelog +* Thu Feb 28 2002 Trond Eivind Glomsr�d 3.1-10 +- Build in new environment + +* Thu Jan 17 2002 Bernhard Rosenkraenzer +- Fix bug #57700 (segfault) +- Add the mac2unix symlink recommended in README +- Fix compiler warnings + +* Wed Jan 09 2002 Tim Powers +- automated rebuild + * Sun Jun 24 2001 Elliot Lee - Bump release + rebuild.