<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    What AVC's are you seeing?<br>
    <br>
    audit2allow -la<br>
    <br>
    <div class="moz-cite-prefix">On 05/23/2015 07:19 AM, Bhuvan Gupta
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAF4ab9XjeY6Hv=Rd0se65Npa_QJ_WHCd0EtvLYM=ky36k6=-dQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">MORE INFO
        <div><br>
        </div>
        <div>content of Test.cpp</div>
        <div>
          <div style="font-size:12.8000001907349px"><i>#include&lt;stdio&gt;</i></div>
          <div style="font-size:12.8000001907349px"><i> int main(void) {</i></div>
          <div style="font-size:12.8000001907349px"><i> 
              fprintf(stderr,"error/n");</i></div>
          <div style="font-size:12.8000001907349px"><i>  return 0;</i></div>
          <div style="font-size:12.8000001907349px"><i> }</i></div>
        </div>
        <div><br>
        </div>
        <div>compile it and now</div>
        <div><i>./a.out </i></div>
        <div>print error to console</div>
        <div><br>
        </div>
        <div><i>./a.out 2&gt; err</i></div>
        <div>print to err file</div>
        <div><br>
        </div>
        <div><i>sandbox ./a.out 2&gt;err</i></div>
        <div>nothing gets printed on console or in err file.</div>
        <div>Is sandbox is eating it up ?</div>
        <div><br>
        </div>
        <div>Thanks</div>
        <div>Bhuvan</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Sat, May 23, 2015 at 4:02 PM, Bhuvan
          Gupta <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:bhuvangu@gmail.com" target="_blank">bhuvangu@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">EXTRA INFO:
              <div><br>
              </div>
              <div>even if i run </div>
              <div><i>sandbox ./a.out</i></div>
              <div><i><br>
                </i></div>
              <div>Even then it doesnt print floating point error on
                console</div>
            </div>
            <div class="HOEnZb">
              <div class="h5">
                <div class="gmail_extra"><br>
                  <div class="gmail_quote">On Sat, May 23, 2015 at 3:40
                    PM, Bhuvan Gupta <span dir="ltr">&lt;<a
                        moz-do-not-send="true"
                        href="mailto:bhuvangu@gmail.com" target="_blank">bhuvangu@gmail.com</a>&gt;</span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <div dir="ltr">
                        <div>Hello All,</div>
                        <div><br>
                        </div>
                        <div>I have an Test.cpp which is run under
                          sandbox(RHEL7):<br>
                        </div>
                        <div><br>
                        </div>
                        <div>Test.cpp content:</div>
                        <div>#include&lt;stdio&gt;</div>
                        <div> int main(void) {</div>
                        <div>  int a = 1/0;</div>
                        <div>  return 0;</div>
                        <div> }</div>
                        <div><br>
                        </div>
                        <div>compile it using gcc(4.8) Test.cpp which
                          produces the a.out</div>
                        <div>Now running a.out prints floating pointing
                          exception on console</div>
                        <div><br>
                        </div>
                        <div>Now i thought that if i redirect stderr to
                          a file, i expect the error to be printed in
                          file.</div>
                        <div>But that is not the case it still continue
                          to print in console.</div>
                        <div>Googling reveal that under such exception
                          the program is terminated immediately and if
                          you capture the stderr of bash then it should
                          redirect.</div>
                        <div>So i run</div>
                        <div><i>su -c ./a.out 2&gt;err </i></div>
                        <div>Bingo error get printed in err file.</div>
                        <div><br>
                        </div>
                        <div>Now the MAIN GAME STARTS</div>
                        <div>i want to run it under sandbox </div>
                        <div>so i run:</div>
                        <div><i>su -c 'sandbox ./a.out 1&gt;out
                            2&gt;err'</i></div>
                        <div>But there is nothing printed in err file or
                          in console.</div>
                        <div><br>
                        </div>
                        <div>How to capture stdout and stderr under such
                          situation ?</div>
                        <div><br>
                        </div>
                        <div><br>
                        </div>
                        <div>Thanks</div>
                        <span><font color="#888888">
                            <div>Bhuvan</div>
                          </font></span></div>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">--
selinux mailing list
<a class="moz-txt-link-abbreviated" href="mailto:selinux@lists.fedoraproject.org">selinux@lists.fedoraproject.org</a>
<a class="moz-txt-link-freetext" href="https://admin.fedoraproject.org/mailman/listinfo/selinux">https://admin.fedoraproject.org/mailman/listinfo/selinux</a></pre>
    </blockquote>
    <br>
  </body>
</html>