Files
container/CONTRIBUTORS.txt
T
Nandha Reddy 35a821f041 fix: vminitd incorrectly overwrites custom HOME environment variable (#136)
## Summary

The vminitd service was using `process.env.contains("HOME")` which
checks for exact string match rather than environment variables starting
with "HOME=".

Since environment variables are stored as `"KEY=value"` strings, the
condition was always false, causing vminitd to always override custom
HOME values even when explicitly provided by the client.

## Changes

- Updates the logic in `vminitd/Sources/vminitd/Server+GRPC.swift` to
use `contains(where: { $0.hasPrefix("HOME=") })` to properly detect
existing HOME environment variables
- Adds regression test `testProcessCustomHomeEnvvar()` to verify that
custom HOME environment variables are preserved when provided by the
client

## Testing

The fix has been tested with the new integration test that:
  - Sets a custom HOME environment variable (`HOME=/tmp/custom/home`)
- Runs a shell command that outputs the HOME variable on the container
runtime
- Verifies the custom HOME value is preserved and not overwritten with
the default

## Environment

  - macOS: 26.0 (25A5279m)
  - Hardware: M4 Pro
  - Xcode: 26 beta
  - Swift: 6.2-dev

Fixes #135
2025-06-17 21:51:11 -07:00

24 lines
688 B
Plaintext

This file contains a list of contributors who have made meaningful changes to this repository.
Please add your name and GitHub handle to this file as an optional step in the contribution process for attribution.
Email is not required.
### Contributors
Aditya Ramani (adityaramani)
Agam Dua (agamdua)
Danny Canter (dcantah)
Dmitry Kovba (dkovba)
Eric Ernst (egernst)
Evan Hazlett (ehazlett)
Gilbert Song (gilbert88)
Hugh Bussell (hughbussell)
John Logan (jglogan)
Kathryn Baldauf (katiewasnothere)
Madhu Venugopal (mavenugo)
Michael Crosby (crosbymichael)
Nandha Reddy (nandsha)
Sidhartha Mani (wlan0)
Tanweer Noor (tanweernoor)
Ximena Perez Diaz (ximenanperez)
Yibo Zhuang (yibozhuang)