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

Illegal Characters in Path #66

Open
ChrisTruncer opened this issue Sep 29, 2023 · 0 comments
Open

Illegal Characters in Path #66

ChrisTruncer opened this issue Sep 29, 2023 · 0 comments

Comments

@ChrisTruncer
Copy link

I ran into an issue where I specified an output directory (it exists), but for some reason when sharphound ran, it gave an "Illegal Characters in Path" error and died. Rohan said to file a bug and thinks it relates to the following code:

`public string ResolveFileName(string filename, string extension, bool addTimestamp)
{
var finalFilename = filename;
if (!filename.EndsWith(extension))
finalFilename = $"{filename}.{extension}";

        if (extension is "json" or "zip" && Flags.RandomizeFilenames)
            finalFilename = $"{Path.GetRandomFileName()}";

        if (addTimestamp) finalFilename = $"{CurrentLoopTime}_{finalFilename}";

        if (OutputPrefix != null) finalFilename = $"{OutputPrefix}_{finalFilename}";

        var finalPath = Path.Combine(OutputDirectory, finalFilename);

        return finalPath;
    }`
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

1 participant