microsoft / IIS.ServiceMonitor

An entrypoint process for running IIS in Windows containers
MIT License
126 stars 42 forks source link

Implement a seperate function to handle special characters for AppCmd #65

Closed jhkimnew closed 4 years ago

jhkimnew commented 4 years ago

We should investigate how AppCmd.exe handles special characters. Currently we handles only single/double quotation marks, which might not be enough.

jhkimnew commented 4 years ago

Here is one example case which shows why we handles the single/double quotation marks. The problem exists on the value=''' because the single quotation mark (') was not escaped with an additional single quotation mark such as value=''''. We should investigate if other special characters can cause the same issue such as +, /, [, ].

C:\WINDOWS\system32\inetsrv\appcmd.exe set config -section:system.applicationHost/applicationPools /+"[name='DefaultAppPool'].environmentVariables.[name='DefaultAppPool'].environmentVariables.[name='foo',value=''']" /commit:apphost
jhkimnew commented 4 years ago

@sujitnayak FYI, I have verified that there is no issue with other special characters. Only single or double quotation mark characters is problematic and we have already fixed the issue. So, we don't need to create any new function. I am closing this issue.