title: How to change ownership of a binary generated through Bazel?
body: <p>Suppose I have a binary that is generated from the following rule:</p>
  <pre><code>cc_binary(
    name = &quot;script&quot;,
    srcs = [&quot;script.c&quot;],
  )
  </code></pre>
  <p>I am then using this binary in my tests:</p>
  <pre><code>cc_test(
    name = &quot;test&quot;,
    srcs = [&quot;test.cc&quot;],
    data = [&quot;:script&quot;],
  )
  </code></pre>
  <p>My question is: Is it possible to change the ownership (<code>chown root:root</code>) and permissions (<code>chmod +s</code>) of this binary through <em>bazel itself</em>?</p>
  <p>The binary contains some commands that can only be executed by root, hence the need to change ownership and permissions.</p>