Curious Behavior doing routine redirection of ping output to (selinux: message 2 of 12) file...
Russell Coker
russell at coker.com.au
Thu Feb 23 00:35:27 UTC 2006
On Wednesday 04 January 2006 06:11, Gregory Maxwell <gmaxwell at gmail.com>
wrote:
> Would it be inappropriate add a compile time flag to bash to cause
> such redirection to always bounce through the shell? Obviously there
> would be a performance hit... but the mysterious failure is probably
> worse...
Mysterious failures are a bad thing. But the performance hit of proxying the
data would also be bad.
Also note that there are some unusual features that some programs may rely on,
for example when you see the following you may think that the file is
append-only:
program > output
However that is not the case. The program can seek in the file, EG it can
seek back to 0 to re-write the file if it wishes.
program < input
The above command permits seeking in the input file to read from different
locations.
Some programs rely on this type of functionality, for example the mpg123
program to play MP3 files would do exactly that. Commands such as
"zcat file.mp3.gz | mpg123 -" didn't work because seeks failed on the pipe. I
wrote a patch for mpg123 that used fopen() and fseek() as the stdio buffers
were large enough to allow the 100 byte reverse seeks that mpg123 relied on.
Tracking down many programs that are similarly buggy and writing work-arounds
for them would not be fun.
--
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/ Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/ My home page
More information about the fedora-selinux-list
mailing list