gpg2.exe和gpg.exe退出代码255

时间:2012-05-31 16:28:49

标签: gnupg

我有以下系统配置:

带有Service Pack 1的Windows 2008 Server 64位

Gpg4win,版本2.1.0

版本2.1.0中包含的Gpg4win组件是:

GnuPG:          2.0.17
Kleopatra:      2.1.0 (2011-02-04)
GPA:            0.9.1-svn1024
GpgOL:          1.1.2
GpgEX:          0.9.7
Claws-Mail:     3.7.8cvs47
Kompendium DE:  3.0.0
Kompendium EN:  3.0.0-beta1

我要做的是使用GnuPG和.NET 3.5 Web服务中的Process.Start解密本地文件。

当从该计算机上的cmd.exe运行时,下面的命令工作正常。

"c:\Program Files (x86)\GNU\GnuPG\pub\" --charset utf8 --no-tty --output c:\decrypted_file.txt" --batch -r "name_for_secret_key" --passphrase-file "C:\path_to_passphrase_file.txt" --decrypt "c:\encrypted_file.gpg"

但是,从IIS 7.5下部署的Web服务执行时,它无法正常工作。 尝试以下方法:

- impersonated user with admin rights (in the application pool or in the code itself) to run the process under
- ran the cmd.exe process directly with Process.Start and passed in the arguments as described above (by redirecting standard input)

结果

- exit code for gpg2.exe is 255 and nothing else happened
- in event viewer / application found errors like: Faulting application gpg2.exe, version 0.0.0.0, time stamp 0x4d6e6194, faulting module unknown, version 0.0.0.0, time stamp 0x00000000, exception code 0xc0000005, fault offset 0x00000000, process id 0x1a914, application start time 0x01cd3f46059b0031.
- by redirecting standarderror I only got the same 255 exit code
- ran Process Monitor on that machine but that hasn't helped either, there were some "Name Not Found" issues, no access denied problems and both gpg.exe and gpg2.exe results were SUCCESS and exit codes were 255.
- DEP has default settings, it's on on essential windows programs and services

你能想到一些与我已经尝试过的不同的东西吗?

0 个答案:

没有答案