title: Running process 'as root' with setuid bit not working as expected - operation not permitted?
body: <p>I have a program that captures network traffic off a network interface. (It's a C program sitting on <code>libpcap</code>.)</p>
  
  <p>I'm running Fedora 26.</p>
  
  <p>When I run the program as <code>root</code>, things look great:</p>
  
  <pre><code>[craig ~]$ sudo su -
  [root ~]$ /home/craig/mybinary
  (output is as expected)
  </code></pre>
  
  <p>But, when I run the program as myself (<code>craig</code>), it fails:</p>
  
  <pre><code>[craig ~]$ /home/craig/mybinary
  Operation not permitted
  [craig ~]$ echo $?
  1
  </code></pre>
  
  <p><strong>What I want</strong> is any user who runs this program to run it "as root". I <em>think</em> I set the <code>setuid</code> bit and owner/group appropriately:</p>
  
  <pre><code>[root@localhost ~]# chmod 6774 /home/craig/mybinary
  [root@localhost ~]# ls -lah /home/craig/mybinary
  -rwsrwsr--. 1 root  root  1.3M Mar  7  2017 mybinary
  </code></pre>
  
  <p>But the behavior is unchanged - when I run this process as <code>craig</code>, it fails with permission-related errors.</p>
  
  <p>Am I missing a step/setting?</p>