]> git.pld-linux.org Git - packages/util-linux.git/blame - util-linux-more-CLOEXEC.patch
- 'without audit' bcond added
[packages/util-linux.git] / util-linux-more-CLOEXEC.patch
CommitLineData
5545a732
JR
1
2When you view a file with the more command and run a shell, the file descriptor
3for reading the file is leaked to that process.
4
5To test, more any file. Then do !/bin/sh. At the prompt do "ls -l /proc/$$/fd"
6and you'll see the leaked fd.
7
8From: Steve Grubb <sgrubb@redhat.com>
9
10--- util-linux-2.13-pre7/text-utils/more.c.cloexec 2006-12-14 14:05:31.000000000 +0100
11+++ util-linux-2.13-pre7/text-utils/more.c 2006-12-14 14:04:57.000000000 +0100
12@@ -478,6 +478,7 @@
13 }
14 if (magic(f, fs))
15 return((FILE *)NULL);
16+ fcntl(fileno(f), F_SETFD, FD_CLOEXEC );
17 c = Getc(f);
18 *clearfirst = (c == '\f');
19 Ungetc (c, f);
This page took 0.063576 seconds and 4 git commands to generate.