D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20765 - Can't run processes with relative paths when specifying a working directory
Summary: Can't run processes with relative paths when specifying a working directory
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All Linux
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-04-25 05:07 UTC by Vladimir Panteleev
Modified: 2020-08-10 18:43 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Vladimir Panteleev 2020-04-25 05:07:37 UTC
//////////////////////// test.d ////////////////////////
import std.conv : octal;
import std.file;
import std.process;

void main()
{
    mkdir("dir");
    write("dir/program", "#!/bin/bash\necho Hello");
    setAttributes("dir/program", octal!700);

    spawnProcess("./program", null, Config.none, "dir");
}
////////////////////////////////////////////////////////

Fails with:
std.process.ProcessException@std/process.d(884): Not an executable file: ./program
Comment 1 Dlang Bot 2020-04-25 05:10:59 UTC
@CyberShadow created dlang/phobos pull request #7455 "Fix Issue 20765 - Can't run processes with relative paths when specif…" fixing this issue:

- Fix Issue 20765 - Can't run processes with relative paths when specifying a working directory
  
  Remove the dubious check which attempted to duplicate the operating
  system's behavior.

https://github.com/dlang/phobos/pull/7455
Comment 2 Dlang Bot 2020-08-10 18:43:51 UTC
dlang/phobos pull request #7455 "Fix Issue 20765 - Can't run processes with relative paths when specif…" was merged into master:

- 92276d0da9dec8e9cc97e5aaf5ad1964d413981a by Vladimir Panteleev:
  Fix Issue 20765 - Can't run processes with relative paths when specifying a working directory
  
  Remove the dubious check which attempted to duplicate the operating
  system's behavior.

https://github.com/dlang/phobos/pull/7455