Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] importer.ReadManifest() attempts to read from relative path #3550

Open
Xiol opened this issue Sep 17, 2024 · 1 comment · May be fixed by #3551
Open

[BUG] importer.ReadManifest() attempts to read from relative path #3550

Xiol opened this issue Sep 17, 2024 · 1 comment · May be fixed by #3551

Comments

@Xiol
Copy link

Xiol commented Sep 17, 2024

Describe the bug
I'm trying to use importer.Import() in my own application, with the VerifyManifest option set to true.

importer.ReadManifest() appears to take the path to an .ovf file, gets the file from that path using filepath.Base(), then changes the extension of that file to .mf in order to find the manifest.

However, at no point is the absolute path added back onto the resulting filename, so the reads will be done relative to the current working directory of the application.

To Reproduce
Steps to reproduce the behavior:

  1. Have your application set to a working directory different from where your OVF is stored.
  2. Call Import with an absolute path to an OVF and VerifyManifest set to true.
  3. The import will fail with an error saying it cannot find the file specified, with a relative path. For example:
error importing OVF application 'foo' from 'C:\\Users\\SomeUser\\AppData\\Local\\Temp\\foo_704290563\\foo.ovf': manifest %!q(<nil>): open foo.mf: The system cannot find the file specified.

Expected behavior
Manifest verification should succeed regardless of the current working directory of the application and where the manifest file is located.

Affected version
v0.43.0

Screenshots/Debug Output
N/A

Additional context
N/A

Copy link
Contributor

Howdy 🖐   Xiol ! Thank you for your interest in this project. We value your feedback and will respond soon.

If you want to contribute to this project, please make yourself familiar with the CONTRIBUTION guidelines.

Xiol added a commit to Xiol/govmomi that referenced this issue Sep 18, 2024
Xiol added a commit to Xiol/govmomi that referenced this issue Sep 18, 2024
@Xiol Xiol linked a pull request Sep 18, 2024 that will close this issue
11 tasks
Xiol added a commit to Xiol/govmomi that referenced this issue Sep 18, 2024
Xiol added a commit to Xiol/govmomi that referenced this issue Sep 18, 2024
Xiol added a commit to Xiol/govmomi that referenced this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant