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

JSON save error when using custom port #137

Open
wildporg opened this issue Jul 17, 2023 · 1 comment
Open

JSON save error when using custom port #137

wildporg opened this issue Jul 17, 2023 · 1 comment

Comments

@wildporg
Copy link

Describe the bug
When connecting to a server with a custom port, the json file does not save because the filename contains a colon

To Reproduce
Steps to reproduce the behavior:
Run an instance with a custom port, e.g. :
./OpenDirectoryDownloader -u "http://185.203.56.37:2096/" -j

Expected behavior

[ERR] Error saving session to JSON System.UnauthorizedAccessException: Access to the path '/home/pi/Scans/http:__185.203.56.37:2096_.json' is denied. ---> System.IO.IOException: Permission denied --- End of inner exception stack trace --- at Interop.ThrowExceptionForIoErrno(ErrorInfo, String, Boolean) at Interop.CheckIo(Error, String , Boolean ) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String, OpenFlags, Int32, Func`4) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String, FileMode, FileAccess, FileShare, FileOptions, Int64, UnixFileMode, Int64& , UnixFileMode& , Func`4 ) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String, FileMode, FileAccess, FileShare, FileOptions, Int64, Nullable`1 , Func`4 ) at System.IO.Strategies.OSFileStreamStrategy..ctor(String, FileMode, FileAccess, FileShare, FileOptions, Int64, Nullable`1) at System.IO.Strategies.UnixFileStreamStrategy..ctor(String, FileMode, FileAccess, FileShare, FileOptions, Int64, Nullable`1) at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String, FileMode, FileAccess, FileShare, FileOptions, Int64, Nullable`1) at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream, String, FileMode, FileAccess, FileShare, Int32, FileOptions, Int64, Nullable`1) at System.IO.FileStream..ctor(String, FileMode, FileAccess, FileShare, Int32, FileOptions, Int64) at System.IO.FileStream..ctor(String, FileMode, FileAccess, FileShare, Int32, FileOptions) at System.IO.FileStream..ctor(String, FileMode, FileAccess, FileShare, Int32, Boolean) at System.IO.FileStream..ctor(String, FileMode, FileAccess, FileShare, Int32) at System.IO.StreamWriter.ValidateArgsAndOpenPath(String, Boolean, Encoding, Int32) at System.IO.StreamWriter..ctor(String, Boolean, Encoding, Int32) at System.IO.StreamWriter..ctor(String) at OpenDirectoryDownloader.Library.SaveSessionJson(Session session, String filePath) at OpenDirectoryDownloader.OpenDirectoryIndexer.<>c__DisplayClass71_0.<b__0>d.MoveNext()

Desktop:

  • OS: Raspbian
  • Version: Debian GNU/Linux 11 (bullseye) 64Bit
@KoalaBear84
Copy link
Owner

Oh, why did I reply so late again! 😅

Hmm, this is strange, as the invalid chars are stripped/replaced with underscores. So it looks like that isn't working for this flavor or unix. Which is strange because the list is provided by .NET itself.

Need to find a way to reproduce it over here, hope to do that soon.

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

No branches or pull requests

2 participants