Running MSVC via CMake using ssh in Cygwin works if you use a password to log in, but not with a public key

We have a Windows 7 desktop that we hope to use to run automated Windows port tests of our C ++ code. It successfully uses the CMake build system, compiling with Visual Studio 10.0 if it is registered locally. The automated test system we use requires ssh for build machines using public key authentication, so I installed Cygwin and ran sshd as a service in a separate account (cyg_server). I can connect to it well by logging into the build account using my password and run the build without any problems. However, if I then add public key authentication, I can still log in, but the assembly failed, even if I logged in and started the assembly manually, so this is an interactive bash shell, just like the working case! Error message

3>LINK : fatal error LNK1101: incorrect MSPDB100.DLL version; recheck installation of this product 

for each link stage.

What could be different in an environment between password and public key authentication that causes this? Note that everything else is identical between the working and the failed cases - only the authentication method has changed, and this is repeatable, so it does not work, it builds in a certain sequence that is to blame.

+4
source share
2 answers

You may need to run cyglsa-config in the Cygwin bash shell and then reboot the system. You may need to start the shell by right-clicking the Cygwin shell shortcut and selecting "Run as administrator", otherwise cyglsa-config may fail with a permission error. I had the same problem (with a different version of Visual C ++) and cyglsa-config fixed it.

The following Cygwin documentation page explains Windows security issues:

http://cygwin.com/cygwin-ug-net/ntsec.html

Relevant materials begin in the section "Switching the user context." It specifically mentions that the default approach has problems with Visual C ++.

+3
source

I answer the question if someone else is stuck with this problem, although my "solution" is not perfect, so I will not accept the answer if someone with a better approach meets this.

Since the machine we are logging into is used only for automatic tests, so we only need ssh in one account, I reconfigured the ssh service to run under this account, ensuring that it has the required permissions and also has ownership of the files in / etc and / var, previously owned by the cyg_server account. This then allows the assembly to work when using public key authentication. This gives the assembly assembly more privileges than we would like!

0
source

Source: https://habr.com/ru/post/1494564/


All Articles