title: setuid and seteuid function
body: <p>I tried to find the difference between setuid and seteuid function. At that time, many of them says the following is the difference. It
  is showed in the man page of setuid.  </p>
  
  <blockquote>
    <p>Thus, a set-user-ID-root program wishing to temporarily drop root privileges, assume the identity of  an  unprivileged  user,  and then regain root privileges afterward cannot use <code>setuid()</code>.  You can accomplish this with <code>seteuid(2)</code>.</p>
  </blockquote>
  
  <p>I have a doubt in the above man page reference. Using setuid we can set the effective user id of the process. 
  For Ex:</p>
  
  <pre><code>setuid(getuid());
  </code></pre>
  
  <p>After this statement is executed, the effective userid of the process is changed to current user. So, to regain the root 
  permission, I simply use, </p>
  
  <pre><code>setuid(0);
  </code></pre>
  
  <p>But why the man page reference shows</p>
  
  <p><code>afterward cannot use setuid().  You can accomplish this with seteuid(2)</code></p>