Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1120 (assigned defect)

Opened 3 months ago

Last modified 2 months ago

Process.execute with no environment should copy the current environment on Posix systems

Reported by: schveiguy Assigned to: schveiguy (accepted)
Priority: major Milestone: 0.99.8
Component: Core Functionality Version: 0.99.6 Jeff
Keywords: Cc:

Description (Last modified by schveiguy)

Currently, Process.execute passes null as the environment pointer to execve when no environment is specified, but in most cases, the user desires to use the current environment. In fact, on Windows, this is the behavior when passing null to CreateProcess.

The Process.execute should copy the current running environment when executing with 0 environment variables. This can be done easily by passing the 'environ' pointer instead of null to the execve function.

The only concern is that using the environ pointer is not thread-safe, but environment stuff in general is not thread safe.

Change History

05/27/08 14:38:16 changed by schveiguy

  • status changed from new to assigned.

05/27/08 14:45:38 changed by schveiguy

  • description changed.

05/27/08 14:57:13 changed by larsivi

I would advice against this as it can be useful to be able to fully control the environment (I recently experienced problems where unexpected env variables were set).

I think this ticket should be more about having an alternative that do pass the environment.

05/27/08 16:19:32 changed by schveiguy

agreed. I'll look into adding a way to specify that the environment should be copied.

In that case, the error is on the windows side, where currently the environment IS passed.

07/10/08 06:58:28 changed by larsivi

  • milestone changed from 0.99.7 to 0.99.8.