title: SMB mount fails with execl()
body: <p>To mount CIFS presently I use system() call in source, this works. If I try to run command manually on shell it works too.</p>
  
  <pre><code>$ mount -t cifs //IP/dir /mnt -o user=name,pass=PASS,domain=mydomain,nounix
  $ mount.cifs //IP/dir /mnt -o user=name,pass=PASS,domain=mydomain,nounix
  </code></pre>
  
  <p>But if i replace the same command with exec() family i see errors.</p>
  
  <pre><code>if(fork() == 0) 
  {
    if (execl("/bin/mount", "/bin/mount", "-t", "cifs", "//IP/dir",  "/mnt", 
    "-o user=name,pass=PASS,domain=mydomain,nounix", (char*) NULL) &lt; 0)
    ...
  }
  else
    ...
  </code></pre>
  
  <p>Error: mount: mounting cifs on //IP/dir /mnt failed: No such file or directory. It looks like mount directory "/mnt" is not recognized or not seen by mount process.</p>
  
  <p>Tried below things but no luck:</p>
  
  <ul>
  <li>as suggested in forums tried using sec=ntlmv2 and other options</li>
  <li>with mount.cifs</li>
  <li>combined arguments "//IP/dir" and "/mnt" as "//ipaddr/dir  /mnt"</li>
  </ul>
  
  <p>What would be the cause here? How to see the command line parameters of the exec()'ed program ?</p>
  
  <p>Version of mount:</p>
  
  <pre><code>mount.cifs version: 1.14-x
  </code></pre>
  
  <p>Regards, - AK</p>