com php-src: revert the lstat part: ext/session/mod_files.c
| From: | Anatol Belski | Date: | Fri, 29 Aug 2014 15:21:02 +0000 |
| Subject: | com php-src: revert the lstat part: ext/session/mod_files.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81297@lists.php.net to get a copy of this message | ||
Commit: a9c5dab1d0a0fafa69a0d450849e95a899757a1d
Author: Anatol Belski <ab@php.net> Fri, 29 Aug 2014 17:21:02 +0200
Parents: f9b051241a227bcb3795d059ecfd8c939f4af08d
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a9c5dab1d0a0fafa69a0d450849e95a899757a1d
Log:
revert the lstat part
Changed paths:
M ext/session/mod_files.c
Diff:
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index 3f43513..bc87ef9 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -122,7 +122,7 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
{
char buf[MAXPATHLEN];
#if !defined(O_NOFOLLOW) || !defined(PHP_WIN32)
- zend_stat_t sbuf;
+ struct stat sbuf;
#endif
if (data->fd < 0 || !data->lastkey || strcmp(key, data->lastkey)) {
@@ -150,7 +150,7 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
#else
/* Check to make sure that the opened file is not outside of allowable dirs.
This is not 100% safe but it's hard to do something better without O_NOFOLLOW */
- if(PG(open_basedir) && zend_lstat(buf, &sbuf) == 0 && S_ISLNK(sbuf.st_mode)
&& php_check_open_basedir(buf TSRMLS_CC)) {
+ if(PG(open_basedir) && lstat(buf, &sbuf) == 0 && S_ISLNK(sbuf.st_mode)
&& php_check_open_basedir(buf TSRMLS_CC)) {
return;
}
data->fd = VCWD_OPEN_MODE(buf, O_CREAT | O_RDWR | O_BINARY, data->filemode);