mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
- MF53: fix readlink in TS SAPI
This commit is contained in:
parent
4fc0630fa5
commit
a6b40a6e88
1 changed files with 12 additions and 8 deletions
|
@ -62,6 +62,7 @@ PHP_FUNCTION(readlink)
|
||||||
char *link;
|
char *link;
|
||||||
int link_len;
|
int link_len;
|
||||||
TCHAR Path[MAXPATHLEN];
|
TCHAR Path[MAXPATHLEN];
|
||||||
|
char path_resolved[MAXPATHLEN];
|
||||||
HANDLE hFile;
|
HANDLE hFile;
|
||||||
DWORD dwRet;
|
DWORD dwRet;
|
||||||
|
|
||||||
|
@ -88,8 +89,11 @@ PHP_FUNCTION(readlink)
|
||||||
if (OPENBASEDIR_CHECKPATH(link)) {
|
if (OPENBASEDIR_CHECKPATH(link)) {
|
||||||
RETURN_FALSE;
|
RETURN_FALSE;
|
||||||
}
|
}
|
||||||
|
if (!expand_filepath(link, path_resolved TSRMLS_CC)) {
|
||||||
hFile = CreateFile(link, // file to open
|
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such file or directory");
|
||||||
|
RETURN_FALSE;
|
||||||
|
}
|
||||||
|
hFile = CreateFile(path_resolved, // file to open
|
||||||
GENERIC_READ, // open for reading
|
GENERIC_READ, // open for reading
|
||||||
FILE_SHARE_READ, // share for reading
|
FILE_SHARE_READ, // share for reading
|
||||||
NULL, // default security
|
NULL, // default security
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue