On Wed, 17 Jun 2015 12:43:49 +0200
Peter Moore <
pmo...@mozilla.com> wrote:
[...]
> to create a process as a different user (I could not find a native way
> in go to create a process as a different Windows user).
[...]
There can't be a "native" way to do that because Go is cross-platform,
and the details of escalating one's privileges differ drastically
across platforms.
IMO, what you should instead do is to resort to an approach standard to
Go, and use direct Windows calls through the standard syscall package.
Contrary to how this sounds, this is not actually hard.
You can do it either by hand (as a quick example, see [1]) or use a
generator (that's what Go standard library does, and, on a simpler
scale, does the well-known ODBC package [2]).
The source code of the Go standard library is abundant with good usage
examples of the syscall package, so just look at it.
1.
http://stackoverflow.com/a/23744350/720999
2.
https://github.com/alexbrainman/odbc/tree/master/api