mxc icon indicating copy to clipboard operation
mxc copied to clipboard

[IsolationSession] A `process.env` entry without `=` is set as an empty variable

Open adpa-ms opened this issue 4 weeks ago • 0 comments

Relevant area(s)

Windows

Brief description of your issue

The IsolationSession backend passes a process.env entry that has no =, such as FOO, as the variable FOO with an empty value (src/mxc-sdk/src/backends/isolation_session/common/process_options.rs :: build_process_options). Bubblewrap, ProcessContainer, Seatbelt and WSLc drop such an entry because it names no variable, as the shared src/mxc-sdk/src/core/mxc_common/default_env.rs :: env_pairs does.

Steps to reproduce

Read from the code at d22e3515; not run.

  1. build_process_options splits each entry at its first = and gives an entry without one an empty value, so FOO and FOO= both become ("FOO", "").
  2. The backend accepts process.env only with process.inheritDefaultEnv: true, which layers the entries over the default environment.
  3. build_pty_process_options starts from build_process_options, so PTY runs do the same.

Expected behavior

A bare entry leaves the process's environment unchanged, as on Bubblewrap, ProcessContainer, Seatbelt and WSLc.

Actual behavior

The process gets the variable with an empty value, so a bare entry that names a default variable, such as TEMP, empties it.

adpa-ms avatar Nov 03 '26 19:11 adpa-ms