Link to home
Start Free TrialLog in
Avatar of Curto123
Curto123

asked on

Access is denied when running GnuPG on Windows Server 2008

I've inherited some code that attempts to encrypt a text file by programmatically calling gpg.exe. It works fine on my WinXP Pro dev machine but will not work when I deploy to a Win Server 08 SP2 machine. The application is an ASP.NET 2.0 app in VB.NET. When I use the debugger to inspect the Process object it says the process exited with an Exit Code of 2 and the MainModule property has a value of "Access is denied". I used Process Monitor to capture some results and it seems that gpg.exe is denied access to create a pubring.gpg file in the following path:

C:\Windows\System32\config\systemprofile\AppData\Roaming\gnupg\

I've also tried passing the "homedir" argument to gpg.exe to no avail. Could this be an impersonation problem of some kind? Any ideas are appreciated.

Windows Server 2008 SP2
ASP.NET 2.0
GnuPG Version 1.4.10


Dim psi As New ProcessStartInfo(HttpContext.Current.Request.PhysicalApplicationPath & "App_Data\\gpg.exe")

psi.UseShellExecute = False
psi.CreateNoWindow = False
psi.RedirectStandardOutput = False
psi.RedirectStandardInput = True
psi.RedirectStandardError = False

psi.Arguments = " --always-trust -e -r """ & PublicKeyName & """ """ & fileLoc & """"

Dim proc As Process = Process.Start(psi)
proc.WaitForExit()
proc.Close()

Open in new window

Avatar of vb_student
vb_student
Flag of United States of America image

server 2008 is akin to vista. they added HUGE security features to vista. in fact vista runs almost all programs as a standard user. thus if you are making a change to a core file directory such as C:\windows or C:\program files you have to jump through quiet a few hoops. in fact for me to change a system file that had an error i had to manualy change it's security properties. i hope you get this working.
Avatar of Curto123
Curto123

ASKER

Hi there. Yes, I was thinking that the problem was along those lines. Win Server 08 displays all those irritating prompts like Vista does. "You must be an administrator to do this", "Are you sure you want to do this", blah blah blah. I've never run into this before as this is the first time I've deployed an app to 08. Unfortunately, my options are limited as this is a client machine and I do not have full control over it. I also do not want to turn off any important security settings and leave the server wide open.
Does anyone have experience or known good code examples to work around this type of problem in Win Server 08?
ASKER CERTIFIED SOLUTION
Avatar of Curto123
Curto123

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial