title: composer gives false warning when run as a non-root user with setuid bit set
body: <p>I configured my php executable i.e /usr/local/bin/php with a <code>setuid</code> for user <code>deploy</code>. So that if any user calls that php binary it should be executed as <code>deploy</code> only. As you can see below php binary is chowned by a non-root user <code>deploy</code>. But when I execute php composer.phar as <code>root</code> why I am getting that warning <code>Do not run Composer as root/super user!</code> . I shouldn't get that warning as php binary is owned by <code>deploy</code> and setuid bit is set. </p>
  
  <pre><code>&gt; ls -al /usr/local/bin/php
   -rwxr-xr-x    1 root     root     /usr/local/bin/php
  
  &gt; chown deploy:deploy /usr/local/bin/php 
  
  &gt; chmod u+s /usr/local/bin/php
  
  &gt; ls -al /usr/local/bin/php
   -rwsr-xr-x    1 deploy   deploy   /usr/local/bin/php
  
  &gt; ls -al composer.phar 
   -rwxr-xr-x    1 deploy   1000     composer.phar
  
  &gt; whoami 
   root
  
  &gt; php composer.phar -V
  Do not run Composer as root/super user! See https://getcomposer.org/root for details
  Composer version 1.7.2 2018-08-16 16:57:12
  </code></pre>
  
  <p>However even if executing <code>php composer.phar install</code> as <code>root</code> the vendor dir created is owned by <code>deploy</code>. </p>
  
  <p>Infact the composer process ignores the setuid bit but when it creates any file/dir it obey setuid.   </p>
  
  <p>I inserted below inside the composer.phar and get the right user <code>deploy</code> but with a warning <code>Don't call as root</code> . Is it an issue of composer ?</p>
  
  <pre><code>$processUser = posix_getpwuid(posix_geteuid());
  print $processUser['name'];
  </code></pre>