summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-04-20 17:24:01 +0000
committerZeev Suraski <zeev@php.net>2000-04-20 17:24:01 +0000
commit883bd2b1de0afae5a3b9f36c0778ba0b08390e25 (patch)
tree55edad9c20fa7047ebc822893ca50548336f6655 /ext
parent7412bd5c849ac8b49da2ffc195110307fae2ba37 (diff)
downloadphp-git-883bd2b1de0afae5a3b9f36c0778ba0b08390e25.tar.gz
- Fix virtual cwd bug
- Add more V_STAT() V_LSTAT() changes
Diffstat (limited to 'ext')
-rw-r--r--ext/db/db.c2
-rw-r--r--ext/dba/dba_db2.c2
-rw-r--r--ext/dba/dba_db3.c2
-rw-r--r--ext/session/mod_files.c2
-rw-r--r--ext/session/session.c2
-rw-r--r--ext/standard/filestat.c6
-rw-r--r--ext/standard/link.c2
-rw-r--r--ext/zlib/zlib.c4
8 files changed, 11 insertions, 11 deletions
diff --git a/ext/db/db.c b/ext/db/db.c
index c2f666d44c..c1df8348c9 100644
--- a/ext/db/db.c
+++ b/ext/db/db.c
@@ -319,7 +319,7 @@ dbm_info *php_dbm_open(char *filename, char *mode) {
strcat(lockfn, ".lck");
#if NFS_HACK
- while((last_try = stat(lockfn,&sb))==0) {
+ while((last_try = V_STAT(lockfn,&sb))==0) {
retries++;
php_sleep(1);
if (retries>30) break;
diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c
index 4543dc8666..de68974358 100644
--- a/ext/dba/dba_db2.c
+++ b/ext/dba/dba_db2.c
@@ -61,7 +61,7 @@ DBA_OPEN_FUNC(db2)
type = info->mode == DBA_READER ? DB_UNKNOWN :
info->mode == DBA_TRUNC ? DB_BTREE :
- stat(info->path, &check_stat) ? DB_BTREE : DB_UNKNOWN;
+ V_STAT(info->path, &check_stat) ? DB_BTREE : DB_UNKNOWN;
gmode = info->mode == DBA_READER ? DB_RDONLY :
info->mode == DBA_CREAT ? DB_CREATE :
diff --git a/ext/dba/dba_db3.c b/ext/dba/dba_db3.c
index 50d1a28c35..ae1405705d 100644
--- a/ext/dba/dba_db3.c
+++ b/ext/dba/dba_db3.c
@@ -61,7 +61,7 @@ DBA_OPEN_FUNC(db3)
type = info->mode == DBA_READER ? DB_UNKNOWN :
info->mode == DBA_TRUNC ? DB_BTREE :
- stat(info->path, &check_stat) ? DB_BTREE : DB_UNKNOWN;
+ V_STAT(info->path, &check_stat) ? DB_BTREE : DB_UNKNOWN;
gmode = info->mode == DBA_READER ? DB_RDONLY :
info->mode == DBA_CREAT ? DB_CREATE :
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index 64879d5969..e9ff89212f 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -175,7 +175,7 @@ static int _ps_files_cleanup_dir(const char *dirname, int maxlifetime)
snprintf(buf, MAXPATHLEN, "%s%c%s", dirname, DIR_DELIMITER,
entry->d_name) > 0 &&
/* stat the directory entry */
- stat(buf, &sbuf) == 0 &&
+ V_STAT(buf, &sbuf) == 0 &&
/* is it expired? */
(now - sbuf.st_atime) > maxlifetime) {
unlink(buf);
diff --git a/ext/session/session.c b/ext/session/session.c
index 589759e69c..63a785139f 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -497,7 +497,7 @@ static void last_modified(void)
path = SG(request_info).path_translated;
if (path) {
- if (stat(path, &sb) == -1) {
+ if (V_STAT(path, &sb) == -1) {
return;
}
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index 81f70fdf14..dcb26d2ffc 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -385,7 +385,7 @@ PHP_FUNCTION(touch)
RETURN_FALSE;
/* create the file if it doesn't exist already */
- ret = stat((*filename)->value.str.val, &sb);
+ ret = V_STAT((*filename)->value.str.val, &sb);
if (ret == -1) {
file = V_FOPEN((*filename)->value.str.val, "w");
if (file == NULL) {
@@ -439,7 +439,7 @@ static void php_stat(const char *filename, int type, pval *return_value)
#if HAVE_SYMLINK
BG(lsb).st_mode = 0; /* mark lstat buf invalid */
#endif
- if (stat(BG(CurrentStatFile),&BG(sb))==-1) {
+ if (V_STAT(BG(CurrentStatFile),&BG(sb))==-1) {
if (type != 15 || errno != ENOENT) { /* fileexists() test must print no error */
php_error(E_NOTICE,"stat failed for %s (errno=%d - %s)",BG(CurrentStatFile),errno,strerror(errno));
}
@@ -457,7 +457,7 @@ static void php_stat(const char *filename, int type, pval *return_value)
/* do lstat if the buffer is empty */
if (!BG(lsb).st_mode) {
- if (lstat(BG(CurrentStatFile),&BG(lsb)) == -1) {
+ if (V_LSTAT(BG(CurrentStatFile),&BG(lsb)) == -1) {
php_error(E_NOTICE,"lstat failed for %s (errno=%d - %s)",BG(CurrentStatFile),errno,strerror(errno));
RETURN_FALSE;
}
diff --git a/ext/standard/link.c b/ext/standard/link.c
index d955be19a4..ad918ebca7 100644
--- a/ext/standard/link.c
+++ b/ext/standard/link.c
@@ -88,7 +88,7 @@ PHP_FUNCTION(linkinfo)
}
convert_to_string_ex(filename);
- ret = lstat((*filename)->value.str.val, &sb);
+ ret = V_LSTAT((*filename)->value.str.val, &sb);
if (ret == -1) {
php_error(E_WARNING, "LinkInfo failed (%s)", strerror(errno));
RETURN_LONG(-1L);
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index d76952fe4e..6360addd7f 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -206,7 +206,7 @@ static gzFile *php_gzopen_with_path(char *filename, char *mode, char *path, char
if(PG(doc_root)) {
snprintf(trypath, MAXPATHLEN, "%s%s", PG(doc_root), filename);
} else {
- strncpy(trypath,filename,sizeof(trypath));
+ strlcpy(trypath,filename,sizeof(trypath));
}
if (!php_checkuid(trypath,2)) {
return(NULL);
@@ -251,7 +251,7 @@ static gzFile *php_gzopen_with_path(char *filename, char *mode, char *path, char
}
snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename);
if (PG(safe_mode)) {
- if (stat(trypath,&sb) == 0 &&(!php_checkuid(trypath,2))) {
+ if (V_STAT(trypath,&sb) == 0 &&(!php_checkuid(trypath,2))) {
efree(pathbuf);
return(NULL);
}