diff --git a/dos2unix-cloexec.patch b/dos2unix-cloexec.patch new file mode 100644 index 0000000..c84f5f4 --- /dev/null +++ b/dos2unix-cloexec.patch @@ -0,0 +1,37 @@ +--- dos2unix.c.orig ++++ dos2unix.c +@@ -158,8 +158,8 @@ + #define R_CNTRL "rb" + #define W_CNTRL "wb" + #else +- #define R_CNTRL "r" +- #define W_CNTRL "w" ++ #define R_CNTRL "re" ++ #define W_CNTRL "we" + #endif + + #define BINARY_FILE 0x1 +--- unix2dos.c.orig ++++ unix2dos.c +@@ -148,8 +148,8 @@ + #define R_CNTRL "rb" + #define W_CNTRL "wb" + #else +- #define R_CNTRL "r" +- #define W_CNTRL "w" ++ #define R_CNTRL "re" ++ #define W_CNTRL "we" + #endif + + #define BINARY_FILE 0x1 +--- Makefile.orig ++++ Makefile +@@ -198,7 +198,7 @@ endif + + CFLAGS = -O2 -Wall $(RPM_OPT_FLAGS) + +-EXTRA_CFLAGS = -DVER_REVISION=\"$(DOS2UNIX_VERSION)\" \ ++EXTRA_CFLAGS = -D_GNU_SOURCE -DVER_REVISION=\"$(DOS2UNIX_VERSION)\" \ + -DVER_DATE=\"$(DOS2UNIX_DATE)\" \ + -DDEBUG=$(DEBUG) \ + $(CFLAGS_OS) diff --git a/dos2unix.changes b/dos2unix.changes index 06dc84e..48a23bd 100644 --- a/dos2unix.changes +++ b/dos2unix.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat May 21 18:17:55 UTC 2011 - crrodriguez@opensuse.org + +- Open all fds with O_CLOEXEC. + ------------------------------------------------------------------- Sat May 21 16:59:14 UTC 2011 - vlado.paskov@gmail.com diff --git a/dos2unix.spec b/dos2unix.spec index a7e9454..32b1323 100644 --- a/dos2unix.spec +++ b/dos2unix.spec @@ -26,6 +26,7 @@ License: BSD3c Url: http://www.xs4all.nl/~waterlan/#DOS2UNIX Source: %{name}-%{version}.tar.gz Patch0: dos2unix-correct_ending.patch +Patch1: dos2unix-cloexec.patch Provides: unix2dos = %{version} Obsoletes: unix2dos < %{version} BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -40,6 +41,7 @@ format to DOS format and unix2dos converts from UNIX to MAC format. %prep %setup -q %patch0 -p1 +%patch1 find . -type f | xargs chmod -x %build