com, Kalle)
- Fixed bug #38091 (Mail() does not use FQDN when sending SMTP helo).
(Kalle, Rick Yorgason)
-- Fixed bug #28038 (Sent incorrect RCPT TO commands to SMTP server) (Garrett)
+- Fixed bug #28038 (Sent incorrect RCPT TO commands to SMTP server) (Garrett)
+- Fixed bug #27051 (Impersonation with FastCGI does not exec process as
+ impersonated user). (Pierre)
30 Jun 2009, PHP 5.3.0
- Upgraded bundled PCRE to version 7.9. (Nuno)
SECURITY_ATTRIBUTES security;
HANDLE in, out;
DWORD dwCreateFlags = 0;
+ BOOL res;
process_pair *proc;
char *cmd;
int i;
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
- if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process)) {
- free(cmd);
- return NULL;
+ if(TWG(impersonation_token) == NULL) {
+ res = CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
+ } else {
+ res = CreateProcessAsUser(TWG(impersonation_token), NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
}
free(cmd);
+ if (!res) {
+ return NULL;
+ }
+
CloseHandle(process.hThread);
proc = process_get(NULL TSRMLS_CC);