-
Notifications
You must be signed in to change notification settings - Fork 731
convert posix path back to windows #4285
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
Conversation
|
Thanks for the update here, @JoeyShapiro. It looks like your commits just need to have the DCO |
Signed-off-by: Joseph Shapiro <[email protected]>
Signed-off-by: Joseph Shapiro <[email protected]>
Signed-off-by: Joseph Shapiro <[email protected]>
3bc903d to
46c6fa8
Compare
Signed-off-by: Joseph Shapiro <[email protected]>
|
ok. I did a sign off. and I also made get_xid cross platform |
|
|
||
| f, err := os.Open(usablePath) | ||
| if err != nil { | ||
| // TODO: it may be that the file is inaccessible, however, this is not an error or a warning. In the future we need to track these as known-unknowns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this would be good to do as part of this PR, since we're introducing a function that we have full control over, e.g. return this error and have this returned as an "unknown" error, which can be reported in the SBOM. I can have a look at making this change, if you like
Signed-off-by: Joseph Shapiro <[email protected]>
|
I did the close and log part, but im not sure how to make an unknown error. I am fine doing it myself if you give me a hint of some kind |
|
I haven't quite worked out all the details, but we will want to collect all the errors, for example in the errPaths and we will want to get all these path errors added to the Unknowns section of the SBOM. This is something many people probably don't know about, but we capture many errors and surface these with the file that the error originated from. Maybe we could add an option and get a reference to these path errors around here, it would probably require type asserting the file resolver to a new interface that has a |
|
I can try it out. I have had some experience with the unknowns. That is how I found this problem in the first place. It might have to wait until later today though, as I am currently at work. Especially if it would require some more work to add in the interfaces |
|
I can confirm that this fixes #4271 |
|
We can always get this merged as-is and worry about the unknowns later, I didn't mean to add a large ask here. I think I'm going to merge this, and if you do feel like contributing updates to handle unknowns, that would be great but can come as a new PR 👍 |
|
yeah, I didn't get a chance to look at it yesterday. I can always make another PR, or someone else can if they beat me to it. thanks for helping get this pulled in |
* main: chore(deps): update tools to latest versions (#4302) chore(deps): bump github.com/github/go-spdx/v2 from 2.3.3 to 2.3.4 (#4301) chore(deps): bump github/codeql-action from 4.30.8 to 4.30.9 (#4299) support universal (fat) mach-o binary files (#4278) chore(deps): bump sigstore/cosign-installer from 3.10.0 to 4.0.0 (#4296) chore(deps): bump anchore/sbom-action from 0.20.7 to 0.20.8 (#4297) convert posix path back to windows (#4285) Remove duplicate image source providers (#4289) chore(deps): bump anchore/sbom-action from 0.20.6 to 0.20.7 (#4293) feat: add option to fetch remote licenses for pnpm-lock.yaml files (#4286) Add PDM parser (#4234) chore(deps): update tools to latest versions (#4291) fix: panic during java archive maven resolution (#4290) Extract zip archive with multiple entries (#4283) chore: update to use old configuration on new cosign (#4287) chore(deps): update anchore dependencies (#4282) chore(deps): bump github.com/mholt/archives from 0.1.3 to 0.1.5 (#4280) add docs to configs (#4281)
Description
This is a fix to allow windows to properly open and get the MIME type of a file during an FS scan. This was a PR to stereoscope, but it was decided to move it here. It also moves in a function and test from there that is only used for syft.
This allows this function to properly use the
windowspackage to check and convert back to a windows path, so the file can be opened.The function moved in still calls to stereoscope, because it requires structs and functions that are heavily integrated into that package.
Type of change