Skip to content

chore: clean paths in fusion driver#303

Merged
tenthirtyam merged 1 commit intomainfrom
chore/clean-paths-in-fusion-driver
May 12, 2025
Merged

chore: clean paths in fusion driver#303
tenthirtyam merged 1 commit intomainfrom
chore/clean-paths-in-fusion-driver

Conversation

@tenthirtyam
Copy link
Copy Markdown
Collaborator

Description

Introduces improvements to the VMware Fusion by enhancing path handling for better security and reliability. It ensures all file paths are sanitized and converted to absolute paths before being used in commands. Additionally, it includes minor code adjustments for compliance with the gosec static analysis tool.

Path Handling Enhancements:

  • Updated all functions (CompactDisk, CreateDisk, CreateSnapshot, IsRunning, Start, Stop, Clone) to sanitize file paths using filepath.Clean and convert them to absolute paths with filepath.Abs before passing them to commands. This prevents potential path traversal vulnerabilities and ensures consistent path handling. [1] [2] [3] [4] [5] [6]

Static Analysis Compliance:

  • Added //nolint:gosec comments to suppress false positives from static analysis tools for commands using dynamic paths. [1] [2] [3] [4] [5] [6] [7] [8]
packer-plugin-vmware on  chore/clean-paths-in-fusion-driver [!?] via 🐹 v1.24.3 
➜ make build

packer-plugin-vmware on  chore/clean-paths-in-fusion-driver [!?] via 🐹 v1.24.3 took 3.8s 
➜ make dev  
packer plugins install --path packer-plugin-vmware "github.com/hashicorp/vmware"
Successfully installed plugin github.com/hashicorp/vmware from /Users/johnsonryan/Downloads/packer-plugin-vmware/packer-plugin-vmware to /Users/johnsonryan/.packer.d/plugins/github.com/hashicorp/vmware/packer-plugin-vmware_v1.1.1-dev_x5.0_darwin_amd64

packer-plugin-vmware on  chore/clean-paths-in-fusion-driver [!?] via 🐹 v1.24.3 took 4.7s 
➜ make test 
?       github.com/hashicorp/packer-plugin-vmware       [no test files]
ok      github.com/hashicorp/packer-plugin-vmware/builder/vmware/common 6.818s
ok      github.com/hashicorp/packer-plugin-vmware/builder/vmware/iso    2.139s
ok      github.com/hashicorp/packer-plugin-vmware/builder/vmware/vmx    2.723s
?       github.com/hashicorp/packer-plugin-vmware/version       [no test files]

Signed-off-by: Ryan Johnson <ryan.johnson@broadcom.com>
@tenthirtyam tenthirtyam added this to the v1.2.0 milestone May 9, 2025
@tenthirtyam tenthirtyam self-assigned this May 9, 2025
@tenthirtyam tenthirtyam requested a review from a team as a code owner May 9, 2025 15:04
@tenthirtyam tenthirtyam requested a review from JenGoldstrich May 12, 2025 18:11
Copy link
Copy Markdown

@JenGoldstrich JenGoldstrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tenthirtyam tenthirtyam merged commit 8f23a54 into main May 12, 2025
14 checks passed
@tenthirtyam tenthirtyam deleted the chore/clean-paths-in-fusion-driver branch May 12, 2025 21:21
@github-actions
Copy link
Copy Markdown

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

chore Chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants