version 1.1, 2012/02/21 23:47:52
|
version 1.1.1.4, 2013/10/14 08:02:46
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| PHP Version 5 | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1997-2012 The PHP Group | | | Copyright (c) 1997-2013 The PHP Group | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 3.01 of the PHP license, | |
| This source file is subject to version 3.01 of the PHP license, | |
| that is bundled with this package in the file LICENSE, and is | |
| that is bundled with this package in the file LICENSE, and is | |
Line 190 Finished:
|
Line 190 Finished:
|
return NULL; |
return NULL; |
} |
} |
|
|
TSRM_API int tsrm_win32_access(const char *pathname, int mode) | TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC) |
{ |
{ |
time_t t; |
time_t t; |
HANDLE thread_token; | HANDLE thread_token = NULL; |
PSID token_sid; |
PSID token_sid; |
SECURITY_INFORMATION sec_info = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION; |
SECURITY_INFORMATION sec_info = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION; |
GENERIC_MAPPING gen_map = { FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_GENERIC_EXECUTE, FILE_ALL_ACCESS }; |
GENERIC_MAPPING gen_map = { FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_GENERIC_EXECUTE, FILE_ALL_ACCESS }; |
Line 208 TSRM_API int tsrm_win32_access(const char *pathname, i
|
Line 208 TSRM_API int tsrm_win32_access(const char *pathname, i
|
realpath_cache_bucket * bucket = NULL; |
realpath_cache_bucket * bucket = NULL; |
char * real_path = NULL; |
char * real_path = NULL; |
|
|
TSRMLS_FETCH(); |
|
|
|
if (mode == 1 /*X_OK*/) { |
if (mode == 1 /*X_OK*/) { |
DWORD type; |
DWORD type; |
return GetBinaryType(pathname, &type) ? 0 : -1; |
return GetBinaryType(pathname, &type) ? 0 : -1; |
Line 365 Finished_Impersonate:
|
Line 363 Finished_Impersonate:
|
} |
} |
|
|
Finished: |
Finished: |
|
if(thread_token != NULL) { |
|
CloseHandle(thread_token); |
|
} |
if(real_path != NULL) { |
if(real_path != NULL) { |
free(real_path); |
free(real_path); |
real_path = NULL; |
real_path = NULL; |
Line 448 static HANDLE dupHandle(HANDLE fh, BOOL inherit) {
|
Line 449 static HANDLE dupHandle(HANDLE fh, BOOL inherit) {
|
|
|
TSRM_API FILE *popen(const char *command, const char *type) |
TSRM_API FILE *popen(const char *command, const char *type) |
{ |
{ |
return popen_ex(command, type, NULL, NULL); | TSRMLS_FETCH(); |
| |
| return popen_ex(command, type, NULL, NULL TSRMLS_CC); |
} |
} |
|
|
TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env) | TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env TSRMLS_DC) |
{ |
{ |
FILE *stream = NULL; |
FILE *stream = NULL; |
int fno, type_len = strlen(type), read, mode; |
int fno, type_len = strlen(type), read, mode; |
Line 469 TSRM_API FILE *popen_ex(const char *command, const cha
|
Line 472 TSRM_API FILE *popen_ex(const char *command, const cha
|
HANDLE token_user = NULL; |
HANDLE token_user = NULL; |
BOOL asuser = TRUE; |
BOOL asuser = TRUE; |
|
|
TSRMLS_FETCH(); |
|
|
|
if (!type) { |
if (!type) { |
return NULL; |
return NULL; |
} |
} |
Line 624 TSRM_API int shmget(int key, int size, int flags)
|
Line 625 TSRM_API int shmget(int key, int size, int flags)
|
shm->info = info_handle; |
shm->info = info_handle; |
shm->descriptor = MapViewOfFileEx(shm->info, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); |
shm->descriptor = MapViewOfFileEx(shm->info, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); |
|
|
if (created) { | if (NULL != shm->descriptor && created) { |
shm->descriptor->shm_perm.key = key; |
shm->descriptor->shm_perm.key = key; |
shm->descriptor->shm_segsz = size; |
shm->descriptor->shm_segsz = size; |
shm->descriptor->shm_ctime = time(NULL); |
shm->descriptor->shm_ctime = time(NULL); |
Line 638 TSRM_API int shmget(int key, int size, int flags)
|
Line 639 TSRM_API int shmget(int key, int size, int flags)
|
shm->descriptor->shm_perm.mode = shm->descriptor->shm_perm.seq = 0; |
shm->descriptor->shm_perm.mode = shm->descriptor->shm_perm.seq = 0; |
} |
} |
|
|
if (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz ) { | if (NULL != shm->descriptor && (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz)) { |
CloseHandle(shm->segment); | if (NULL != shm->segment) { |
| CloseHandle(shm->segment); |
| } |
UnmapViewOfFile(shm->descriptor); |
UnmapViewOfFile(shm->descriptor); |
CloseHandle(shm->info); |
CloseHandle(shm->info); |
return -1; |
return -1; |