diff --git a/util-linux-2.13-more-CLOEXEC.patch b/util-linux-2.13-more-CLOEXEC.patch new file mode 100644 index 0000000..fe69e7a --- /dev/null +++ b/util-linux-2.13-more-CLOEXEC.patch @@ -0,0 +1,19 @@ + +When you view a file with the more command and run a shell, the file descriptor +for reading the file is leaked to that process. + +To test, more any file. Then do !/bin/sh. At the prompt do "ls -l /proc/$$/fd" +and you'll see the leaked fd. + +From: Steve Grubb + +--- util-linux-2.13-pre7/text-utils/more.c.cloexec 2006-12-14 14:05:31.000000000 +0100 ++++ util-linux-2.13-pre7/text-utils/more.c 2006-12-14 14:04:57.000000000 +0100 +@@ -478,6 +478,7 @@ + } + if (magic(f, fs)) + return((FILE *)NULL); ++ fcntl(fileno(f), F_SETFD, FD_CLOEXEC ); + c = Getc(f); + *clearfirst = (c == '\f'); + Ungetc (c, f); diff --git a/util-linux.spec b/util-linux.spec index 58e7f89..371d3ec 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -235,6 +235,8 @@ Patch257: util-linux-2.13-raw-raw0.patch Patch258: util-linux-2.13-mkdir_p.patch # 218915 - fdisk -b 4K Patch259: util-linux-2.13-fdisk-b-4096.patch +# leaking file descriptor +Patch260: util-linux-2.13-more-CLOEXEC.patch # When adding patches, please make sure that it is easy to find out what bug # the # patch fixes. @@ -333,6 +335,7 @@ cp %{SOURCE8} %{SOURCE9} . %patch257 -p1 %patch258 -p1 %patch259 -p1 +%patch260 -p1 %build unset LINGUAS || : @@ -744,6 +747,7 @@ exit 0 %changelog * Wed Dec 13 2006 Karel Zak 2.13-0.45 +- fix leaking file descriptor in the more command (patch by Steve Grubb) - use ncurses only - fix #218915 - fdisk -b 4K - upgrade to -pre7 release