Skip to content

JSON save error when using custom port #137

@wildporg

Description

@wildporg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions