chevah/compat — pull request #30 by alibotean (2014-04-15 09:51:20+00:00)
Title: [#2055] Fix makeLink while impersonating on Windows.

Problem
-----

We were unable to grant `SE_CREATE_SYMBOLIC_LINK` on Windows when impersonating another account.

Why we got here
------

Apparently once impersonating a user token we can only adjust privileges for the current thread, and not for the whole process as impersonation acts at thread level.

Solution
------

Changed `_openProcess` to fall back on opening the current thread token if unable to open the process token.

How to test
------

reviewers @adiroiban

Please take a look at the code and tests. I have trouble getting my custom user added on AIX 5.3, all the other buildslaves pass.