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

Interpret 'nodeProcessCommandLine' as a relative path if it starts with '.' #356

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/iisnode/cmoduleconfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,19 @@ HRESULT CModuleConfiguration::GetConfig(IHttpContext* context, CModuleConfigurat

CheckError(CModuleConfiguration::ApplyYamlConfigOverrides(context, c));

if (c->nodeProcessCommandLine && c->nodeProcessCommandLine[0] == L'.')
{
LPWSTR origcmd = c->nodeProcessCommandLine;
DWORD scriptTranslatedLength = 0;
LPCWSTR scriptTranslated = context->GetScriptTranslated(&scriptTranslatedLength);
ErrorIf(NULL == (c->nodeProcessCommandLine = new WCHAR[scriptTranslatedLength + wcslen(origcmd) + 1]), ERROR_NOT_ENOUGH_MEMORY);
wcscpy(c->nodeProcessCommandLine, scriptTranslated);
while (scriptTranslatedLength > 0 && c->nodeProcessCommandLine[scriptTranslatedLength] != L'\\')
scriptTranslatedLength--;
wcscpy(c->nodeProcessCommandLine + scriptTranslatedLength + 1, origcmd);
delete [] origcmd;
}

// generate debugger related config based on debuggerVirtualDir value.
CheckError(CModuleConfiguration::GenerateDebuggerConfig(context, c));

Expand Down