简体   繁体   中英

IIS 7.5 with process idenity set to user has wrong USERPROFILE

First of all, this is my third question on the similar topic.. and still I have no answer, maybe only approaching it (see first , second ).

My web application (ASP.NET MVC3 under IIS 7.5) runs git to access some github repositories. After I upgraded my workstation to Windows SP1 it stopped to work. The reason was that as soon as git started, it actually runs ssh.exe to communicate with github. The ssh.exe appears to hangs up, so all application hangs.

The application pool used by that application use the same process identity as myself. But using ProcessHacker I can see following picture:

w3wp流程环境

Because of USERPROFILE is pointed to /system32/config/systemprofile ssh.exe is expecting to have .ssh folder, that contains public/private keys. Since keys are not there it hangs.

But keys are typically in ~/.ssh (in my case c:\\users\\alexander.beletsky.ssh). As soon as I copied keys into /system32/config/systemprofile application started to work as expected.

My question is, why does w3wp.exe thinks that its profile in /system32/config/systemprofile? is it possible to change that? it is expected behaviour for application pool or just issue of my machine?

Waiting for any clues!

EDIT

Load User Profile property of Application Pool is set to TRUE.

ssh.exe is actually using HOME environment variable. Check if it set correctly.

As my machine on which this works has the same value in enviroment page of process hacker, and still

Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) has value of my user appData, and I have SP1, I think that it should not be related to it, but to something in your configuration that could have been changed. Check if your inetmgr has properly set identity for your application. Open C:\\inetpub\\temp\\appPools\\yourAppPoolName\\yourAppPoolName.config and check if this setting exists:

<configuration>
    ....
  <system.applicationHost>
    <sites>
      <site name="Default Web Site" id="1" serverAutoStart="true">
       <application path="/yourAppPath" applicationPool="yourAppPoolName">
                <virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot\yourAppPath" userName="yourUserName" password="[enc:AesProvider:someHashHere=:enc]" />
       </application>
       ...
      </site>
    </sites>
  <system.applicationHost>

<configuration>

If not, you can configure it there (put password in plain text or you can configure it using inetmgr like I described in my answer to your other question).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM