Bob,
With full respect...can you please go through my previous mail in this thread...info given by you is not relevant hereOn Saturday, May 23, 2015, Bob Gustafson <bobgus@xxxxxxx> wrote:
For compiling and testing, I usually do:
./a.out 2>&1 | tee tofile.txt
The 2>&1 takes the stderr and pushes it out along with the stdout.
The 'tee' provides a way to see the output on the screen as well as store it to disk (tofile.txt)
Have fun
Bob G
On 05/23/2015 06:19 AM, Bhuvan Gupta wrote:
MORE INFO
content of Test.cpp#include<stdio>int main(void) {fprintf(stderr,"error/n");return 0;}
compile it and now./a.outprint error to console
./a.out 2> errprint to err file
sandbox ./a.out 2>errnothing gets printed on console or in err file.Is sandbox is eating it up ?
ThanksBhuvan
On Sat, May 23, 2015 at 4:02 PM, Bhuvan Gupta <bhuvangu@xxxxxxxxx> wrote:
EXTRA INFO:
even if i runsandbox ./a.out
Even then it doesnt print floating point error on console
On Sat, May 23, 2015 at 3:40 PM, Bhuvan Gupta <bhuvangu@xxxxxxxxx> wrote:
Hello All,
I have an Test.cpp which is run under sandbox(RHEL7):
Test.cpp content:#include<stdio>int main(void) {int a = 1/0;return 0;}
compile it using gcc(4.8) Test.cpp which produces the a.outNow running a.out prints floating pointing exception on console
Now i thought that if i redirect stderr to a file, i expect the error to be printed in file.But that is not the case it still continue to print in console.Googling reveal that under such exception the program is terminated immediately and if you capture the stderr of bash then it should redirect.So i runsu -c ./a.out 2>errBingo error get printed in err file.
Now the MAIN GAME STARTSi want to run it under sandboxso i run:su -c 'sandbox ./a.out 1>out 2>err'But there is nothing printed in err file or in console.
How to capture stdout and stderr under such situation ?
ThanksBhuvan
-- selinux mailing list selinux@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/selinux
-- selinux mailing list selinux@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/selinux