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

'exportConfig' requires an explicit filename and gives unhelpful errors #81

Open
Evmaus-MS opened this issue May 12, 2017 · 0 comments
Open
Labels

Comments

@Evmaus-MS
Copy link

If you run BinSkim's 'exportConfig' command with a folder as the output location, you get an unhelpful exception.

For example, if you run it with the desktop folder:
.\BinSkim.exe exportConfig "C:\Users{username}\Desktop"
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users{username}\Desktop'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost)
at Microsoft.CodeAnalysis.Sarif.Driver.ExportConfigurationCommandBase.Run(ExportConfigurationOptions exportOptions)


The workaround is to explicitly specify a full filename (e.x. "binskim.exe exportconfig C:\users{username}\Desktop\binskimconfig.json"). However, the current behavior isn't particularly user friendly.

Expected behavior: BinSkim should either chose a default filename to output to if given a folder (e.x. 'binskimconfig.json' or 'binskimconfig.xml'), or give a more helpful error message (e.x. "Error: Please specify a full file name, not a folder"), rather than throwing an exception.

@Evmaus-MS Evmaus-MS added the bug label Aug 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant