diff options
42 files changed, 152 insertions, 152 deletions
@@ -1384,7 +1384,7 @@ 2001-04-03 Daniel Beulshausen <daniel@php4win.de> - * ext/exif/exif.c: use V_STAT + * ext/exif/exif.c: use VCWD_STAT * ext/exif/exif.c: resolve realpath if in v-dir mode diff --git a/TSRM/tsrm_virtual_cwd.h b/TSRM/tsrm_virtual_cwd.h index b47159a0ff..82dcc5765e 100644 --- a/TSRM/tsrm_virtual_cwd.h +++ b/TSRM/tsrm_virtual_cwd.h @@ -154,59 +154,59 @@ typedef struct _virtual_cwd_globals { #ifdef VIRTUAL_DIR -#define V_GETCWD(buff, size) virtual_getcwd(buff,size) -#define V_FOPEN(path, mode) virtual_fopen(path, mode) -/* The V_OPEN macro will need to be used as V_OPEN((path, flags, ...)) */ -#define V_OPEN(open_args) virtual_open open_args -#define V_CREAT(path, mode) virtual_creat(path, mode) -#define V_CHDIR(path) virtual_chdir(path) -#define V_CHDIR_FILE(path) virtual_chdir_file(path, virtual_chdir) -#define V_GETWD(buf) -#define V_REALPATH(path,real_path) virtual_realpath(path,real_path) -#define V_RENAME(oldname,newname) virtual_rename(oldname,newname) -#define V_STAT(path, buff) virtual_stat(path, buff) +#define VCWD_GETCWD(buff, size) virtual_getcwd(buff,size) +#define VCWD_FOPEN(path, mode) virtual_fopen(path, mode) +/* The VCWD_OPEN macro will need to be used as VCWD_OPEN((path, flags, ...)) */ +#define VCWD_OPEN(open_args) virtual_open open_args +#define VCWD_CREAT(path, mode) virtual_creat(path, mode) +#define VCWD_CHDIR(path) virtual_chdir(path) +#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, virtual_chdir) +#define VCWD_GETWD(buf) +#define VCWD_REALPATH(path,real_path) virtual_realpath(path,real_path) +#define VCWD_RENAME(oldname,newname) virtual_rename(oldname,newname) +#define VCWD_STAT(path, buff) virtual_stat(path, buff) #ifdef TSRM_WIN32 -#define V_LSTAT(path, buff) virtual_stat(path, buff) +#define VCWD_LSTAT(path, buff) virtual_stat(path, buff) #else -#define V_LSTAT(path, buff) virtual_lstat(path, buff) +#define VCWD_LSTAT(path, buff) virtual_lstat(path, buff) #endif -#define V_UNLINK(path) virtual_unlink(path) -#define V_MKDIR(pathname, mode) virtual_mkdir(pathname, mode) -#define V_RMDIR(pathname) virtual_rmdir(pathname) -#define V_OPENDIR(pathname) virtual_opendir(pathname) -#define V_POPEN(command, type) virtual_popen(command, type) +#define VCWD_UNLINK(path) virtual_unlink(path) +#define VCWD_MKDIR(pathname, mode) virtual_mkdir(pathname, mode) +#define VCWD_RMDIR(pathname) virtual_rmdir(pathname) +#define VCWD_OPENDIR(pathname) virtual_opendir(pathname) +#define VCWD_POPEN(command, type) virtual_popen(command, type) #if HAVE_UTIME -#define V_UTIME(path,time) virtual_utime(path,time) +#define VCWD_UTIME(path,time) virtual_utime(path,time) #endif -#define V_CHMOD(path,mode) virtual_chmod(path,mode) +#define VCWD_CHMOD(path,mode) virtual_chmod(path,mode) #ifndef TSRM_WIN32 -#define V_CHOWN(path,owner,group) virtual_chown(path,owner,group) +#define VCWD_CHOWN(path,owner,group) virtual_chown(path,owner,group) #endif #else -#define V_GETCWD(buff, size) getcwd(buff,size) -#define V_FOPEN(path, mode) fopen(path, mode) -#define V_OPEN(open_args) open open_args -#define V_CREAT(path, mode) creat(path, mode) -#define V_RENAME(oldname,newname) rename(oldname,newname) -#define V_CHDIR(path) chdir(path) -#define V_CHDIR_FILE(path) virtual_chdir_file(path, chdir) -#define V_GETWD(buf) getwd(buf) -#define V_STAT(path, buff) stat(path, buff) -#define V_LSTAT(path, buff) lstat(path, buff) -#define V_UNLINK(path) unlink(path) -#define V_MKDIR(pathname, mode) mkdir(pathname, mode) -#define V_RMDIR(pathname) rmdir(pathname) -#define V_OPENDIR(pathname) opendir(pathname) -#define V_POPEN(command, type) popen(command, type) -#define V_REALPATH(path,real_path) realpath(path,real_path) +#define VCWD_GETCWD(buff, size) getcwd(buff,size) +#define VCWD_FOPEN(path, mode) fopen(path, mode) +#define VCWD_OPEN(open_args) open open_args +#define VCWD_CREAT(path, mode) creat(path, mode) +#define VCWD_RENAME(oldname,newname) rename(oldname,newname) +#define VCWD_CHDIR(path) chdir(path) +#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, chdir) +#define VCWD_GETWD(buf) getwd(buf) +#define VCWD_STAT(path, buff) stat(path, buff) +#define VCWD_LSTAT(path, buff) lstat(path, buff) +#define VCWD_UNLINK(path) unlink(path) +#define VCWD_MKDIR(pathname, mode) mkdir(pathname, mode) +#define VCWD_RMDIR(pathname) rmdir(pathname) +#define VCWD_OPENDIR(pathname) opendir(pathname) +#define VCWD_POPEN(command, type) popen(command, type) +#define VCWD_REALPATH(path,real_path) realpath(path,real_path) #if HAVE_UTIME -#define V_UTIME(path,time) utime(path,time) +#define VCWD_UTIME(path,time) utime(path,time) #endif -#define V_CHMOD(path,mode) chmod(path,mode) +#define VCWD_CHMOD(path,mode) chmod(path,mode) #ifndef TSRM_WIN32 -#define V_CHOWN(path,owner,group) chown(path,owner,group) +#define VCWD_CHOWN(path,owner,group) chown(path,owner,group) #endif #endif diff --git a/ext/com/COM.c b/ext/com/COM.c index 9ed09eb8d4..1526b09e8a 100644 --- a/ext/com/COM.c +++ b/ext/com/COM.c @@ -205,7 +205,7 @@ static PHP_INI_MH(OnTypelibFileChange) #endif - if (!new_value || (typelib_file=V_FOPEN(new_value, "r"))==NULL) { + if (!new_value || (typelib_file=VCWD_FOPEN(new_value, "r"))==NULL) { return FAILURE; } diff --git a/ext/db/db.c b/ext/db/db.c index d49d6f6c47..80e19d47ae 100644 --- a/ext/db/db.c +++ b/ext/db/db.c @@ -120,7 +120,7 @@ static int php_dbm_key_exists(DBM *dbf, datum key_datum) { #define DBM_CREATE_MODE "a+b" #define DBM_NEW_MODE "w+b" #define DBM_DEFAULT_MODE "r" -#define DBM_OPEN(filename, mode) V_FOPEN(filename, mode) +#define DBM_OPEN(filename, mode) VCWD_FOPEN(filename, mode) #define DBM_CLOSE(dbf) fclose(dbf) #define DBM_STORE(dbf, key, value, mode) flatfile_store(dbf, key, value, mode) #define DBM_FETCH(dbf, key) flatfile_fetch(dbf, key) @@ -322,7 +322,7 @@ dbm_info *php_dbm_open(char *filename, char *mode) { strcat(lockfn, ".lck"); #if NFS_HACK - while((last_try = V_STAT(lockfn,&sb))==0) { + while((last_try = VCWD_STAT(lockfn,&sb))==0) { retries++; php_sleep(1); if (retries>30) break; @@ -336,7 +336,7 @@ dbm_info *php_dbm_open(char *filename, char *mode) { } #else /* NFS_HACK */ - lockfd = V_OPEN((lockfn,O_RDWR|O_CREAT,0644)); + lockfd = VCWD_OPEN((lockfn,O_RDWR|O_CREAT,0644)); if (lockfd) { flock(lockfd,LOCK_EX); @@ -396,7 +396,7 @@ dbm_info *php_dbm_open(char *filename, char *mode) { #if NFS_HACK if (lockfn) { - V_UNLINK(lockfn); + VCWD_UNLINK(lockfn); } #endif if (lockfn) efree(lockfn); @@ -432,10 +432,10 @@ int php_dbm_close(zend_rsrc_list_entry *rsrc) { dbf = info->dbf; #if NFS_HACK - V_UNLINK(info->lockfn); + VCWD_UNLINK(info->lockfn); #else if (info->lockfn) { - lockfd = V_OPEN((info->lockfn,O_RDWR,0644)); + lockfd = VCWD_OPEN((info->lockfn,O_RDWR,0644)); flock(lockfd,LOCK_UN); close(lockfd); } diff --git a/ext/dba/dba_cdb.c b/ext/dba/dba_cdb.c index 93abec5934..ab54d12da6 100644 --- a/ext/dba/dba_cdb.c +++ b/ext/dba/dba_cdb.c @@ -71,7 +71,7 @@ DBA_OPEN_FUNC(cdb) cdb = malloc(sizeof *cdb); memset(cdb, 0, sizeof *cdb); - cdb->fd = V_OPEN((info->path, gmode)); + cdb->fd = VCWD_OPEN((info->path, gmode)); if(cdb->fd < 0) { free(cdb); return FAILURE; diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c index d79e62ed42..2c6fcb8ace 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 : - V_STAT(info->path, &check_stat) ? DB_BTREE : DB_UNKNOWN; + VCWD_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 5d3cd69606..e0832a86a0 100644 --- a/ext/dba/dba_db3.c +++ b/ext/dba/dba_db3.c @@ -63,7 +63,7 @@ DBA_OPEN_FUNC(db3) type = info->mode == DBA_READER ? DB_UNKNOWN : info->mode == DBA_TRUNC ? DB_BTREE : - V_STAT(info->path, &check_stat) ? DB_BTREE : DB_UNKNOWN; + VCWD_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_dbm.c b/ext/dba/dba_dbm.c index a9df5452c1..ede05a47ca 100644 --- a/ext/dba/dba_dbm.c +++ b/ext/dba/dba_dbm.c @@ -47,7 +47,7 @@ #define TRUNC_IT(extension, mode) \ snprintf(buf, MAXPATHLEN, "%s" extension, info->path); \ buf[MAXPATHLEN-1] = '\0'; \ - if((fd = V_OPEN((buf, O_CREAT | mode | O_WRONLY, filemode))) == -1) \ + if((fd = VCWD_OPEN((buf, O_CREAT | mode | O_WRONLY, filemode))) == -1) \ return FAILURE; \ close(fd); diff --git a/ext/dbase/dbase.c b/ext/dbase/dbase.c index 9cb8325b74..63312f47b6 100644 --- a/ext/dbase/dbase.c +++ b/ext/dbase/dbase.c @@ -598,7 +598,7 @@ PHP_FUNCTION(dbase_create) { RETURN_FALSE; } - if ((fd = V_OPEN((Z_STRVAL_P(filename), O_BINARY|O_RDWR|O_CREAT, 0644))) < 0) { + if ((fd = VCWD_OPEN((Z_STRVAL_P(filename), O_BINARY|O_RDWR|O_CREAT, 0644))) < 0) { php_error(E_WARNING, "Unable to create database (%d): %s", errno, strerror(errno)); RETURN_FALSE; } diff --git a/ext/dbase/dbf_head.c b/ext/dbase/dbf_head.c index c92a29ba3a..b99c1a1acd 100644 --- a/ext/dbase/dbf_head.c +++ b/ext/dbase/dbf_head.c @@ -227,10 +227,10 @@ dbhead_t *dbf_open(char *dp, int o_flags) dbhead_t *dbh; cp = dp; - if ((fd = V_OPEN((cp, o_flags|O_BINARY))) < 0) { + if ((fd = VCWD_OPEN((cp, o_flags|O_BINARY))) < 0) { cp = (char *)malloc(256); strcpy(cp, dp); strcat(cp, ".dbf"); - if ((fd = V_OPEN((cp, o_flags))) < 0) { + if ((fd = VCWD_OPEN((cp, o_flags))) < 0) { perror("open"); return NULL; } diff --git a/ext/exif/exif.c b/ext/exif/exif.c index e84322e751..fce8281d95 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -973,7 +973,7 @@ int ReadJpegFile(ImageInfoType *ImageInfo, Section_t *Sections, int ret; char *tmp; - infile = V_FOPEN(FileName, "rb"); /* Unix ignores 'b', windows needs it. */ + infile = VCWD_FOPEN(FileName, "rb"); /* Unix ignores 'b', windows needs it. */ if (infile == NULL) { php_error(E_ERROR, "Unable to open '%s'", FileName); @@ -1002,7 +1002,7 @@ int ReadJpegFile(ImageInfoType *ImageInfo, Section_t *Sections, { /* Store file date/time. */ struct stat st; - if (V_STAT(FileName, &st) >= 0) { + if (VCWD_STAT(FileName, &st) >= 0) { ImageInfo->FileDateTime = st.st_mtime; ImageInfo->FileSize = st.st_size; } else { diff --git a/ext/fdf/fdf.c b/ext/fdf/fdf.c index 0e883469b6..590df50d50 100644 --- a/ext/fdf/fdf.c +++ b/ext/fdf/fdf.c @@ -748,7 +748,7 @@ SAPI_POST_HANDLER_FUNC(fdf_post_handler) } FDFClose(theFDF); - V_UNLINK((const char *)filename); + VCWD_UNLINK((const char *)filename); efree(filename); if(name) efree(name); diff --git a/ext/filepro/filepro.c b/ext/filepro/filepro.c index 915e4f3de8..85a24cadfb 100644 --- a/ext/filepro/filepro.c +++ b/ext/filepro/filepro.c @@ -214,7 +214,7 @@ PHP_FUNCTION(filepro) RETURN_FALSE; } - if (!(fp = V_FOPEN(workbuf, "r"))) { + if (!(fp = VCWD_FOPEN(workbuf, "r"))) { php_error(E_WARNING, "filePro: cannot open map: [%d] %s", errno, strerror(errno)); RETURN_FALSE; @@ -313,7 +313,7 @@ PHP_FUNCTION(filepro_rowcount) RETURN_FALSE; } - if (!(fp = V_FOPEN(workbuf, "r"))) { + if (!(fp = VCWD_FOPEN(workbuf, "r"))) { php_error(E_WARNING, "filePro: cannot open key: [%d] %s", errno, strerror(errno)); RETURN_FALSE; @@ -538,7 +538,7 @@ PHP_FUNCTION(filepro_retrieve) RETURN_FALSE; } - if (!(fp = V_FOPEN(workbuf, "r"))) { + if (!(fp = VCWD_FOPEN(workbuf, "r"))) { php_error(E_WARNING, "filePro: cannot open key: [%d] %s", errno, strerror(errno)); fclose(fp); diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index 8f74068eac..2dcbdbda3e 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -592,9 +592,9 @@ PHP_FUNCTION(ftp_get) } #ifdef PHP_WIN32 - if ((outfp = V_FOPEN(Z_STRVAL_P(arg2), "wb")) == NULL) { + if ((outfp = VCWD_FOPEN(Z_STRVAL_P(arg2), "wb")) == NULL) { #else - if ((outfp = V_FOPEN(Z_STRVAL_P(arg2), "w")) == NULL) { + if ((outfp = VCWD_FOPEN(Z_STRVAL_P(arg2), "w")) == NULL) { #endif fclose(tmpfp); php_error(E_WARNING, "error opening %s", Z_STRVAL_P(arg2)); @@ -680,9 +680,9 @@ PHP_FUNCTION(ftp_put) XTYPE(xtype, arg4); #ifdef PHP_WIN32 - if ((infp = V_FOPEN(Z_STRVAL_P(arg3), "rb")) == NULL) { + if ((infp = VCWD_FOPEN(Z_STRVAL_P(arg3), "rb")) == NULL) { #else - if ((infp = V_FOPEN(Z_STRVAL_P(arg3), "r")) == NULL) { + if ((infp = VCWD_FOPEN(Z_STRVAL_P(arg3), "r")) == NULL) { #endif php_error(E_WARNING, "error opening %s", Z_STRVAL_P(arg3)); RETURN_FALSE; diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 3c8b963368..aacd2b9463 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -432,7 +432,7 @@ PHP_FUNCTION(imageloadfont) convert_to_string_ex(file); #ifdef PHP_WIN32 - fp = V_FOPEN(Z_STRVAL_PP(file), "rb"); + fp = VCWD_FOPEN(Z_STRVAL_PP(file), "rb"); #else fp = php_fopen_wrapper(Z_STRVAL_PP(file), "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL); #endif @@ -1138,7 +1138,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, fn = Z_STRVAL_PP(file); #ifdef PHP_WIN32 - fp = V_FOPEN(fn, "rb"); + fp = VCWD_FOPEN(fn, "rb"); #else fp = php_fopen_wrapper(fn, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL); #endif @@ -1314,7 +1314,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char RETURN_FALSE; } - fp = V_FOPEN(fn, "wb"); + fp = VCWD_FOPEN(fn, "wb"); if (!fp) { php_error(E_WARNING, "%s: unable to open '%s' for writing", get_active_function_name(), fn); RETURN_FALSE; @@ -3338,14 +3338,14 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) { } /* Open origin file */ - org = V_FOPEN(fn_org, "rb"); + org = VCWD_FOPEN(fn_org, "rb"); if (!org) { php_error (E_WARNING, "%s: unable to open '%s' for reading", get_active_function_name(), fn_org); RETURN_FALSE; } /* Open destination file */ - dest = V_FOPEN(fn_dest, "wb"); + dest = VCWD_FOPEN(fn_dest, "wb"); if (!dest) { php_error (E_WARNING, "%s: unable to open '%s' for writing", get_active_function_name(), fn_dest); RETURN_FALSE; diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c index 3e8d595c22..6fb5a08bb2 100644 --- a/ext/gd/gd_ctx.c +++ b/ext/gd/gd_ctx.c @@ -52,7 +52,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type, RETURN_FALSE; } - fp = V_FOPEN(fn, "wb"); + fp = VCWD_FOPEN(fn, "wb"); if (!fp) { php_error(E_WARNING, "%s: unable to open '%s' for writing", get_active_function_name(), fn); RETURN_FALSE; diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c index 7d75dbe026..3de4b007f5 100644 --- a/ext/gettext/gettext.c +++ b/ext/gettext/gettext.c @@ -151,9 +151,9 @@ PHP_FUNCTION(bindtextdomain) convert_to_string_ex(dir); if (strcmp((*dir)->value.str.val, "") && strcmp((*dir)->value.str.val, "0")) { - V_REALPATH((*dir)->value.str.val, dir_name); + VCWD_REALPATH((*dir)->value.str.val, dir_name); } else { - V_GETCWD(dir_name, MAXPATHLEN); + VCWD_GETCWD(dir_name, MAXPATHLEN); } retval = bindtextdomain((*domain_name)->value.str.val, dir_name); diff --git a/ext/ming/ming.c b/ext/ming/ming.c index f2203c2e59..3ac7e47cfd 100644 --- a/ext/ming/ming.c +++ b/ext/ming/ming.c @@ -245,10 +245,10 @@ PHP_FUNCTION(swfbitmap_init) if(maskname != NULL) { FILE *jpeg, *mask; - if((jpeg = V_FOPEN(filename, "rb")) == NULL) + if((jpeg = VCWD_FOPEN(filename, "rb")) == NULL) php_error(E_ERROR, "Couldn't find file %s", filename); - if((mask = V_FOPEN(maskname, "rb")) == NULL) + if((mask = VCWD_FOPEN(maskname, "rb")) == NULL) php_error(E_ERROR, "Couldn't find file %s", maskname); bitmap = newSWFJpegWithAlpha(jpeg, mask); @@ -260,7 +260,7 @@ PHP_FUNCTION(swfbitmap_init) { FILE *jpeg; - if((jpeg = V_FOPEN(filename, "rb")) == NULL) + if((jpeg = VCWD_FOPEN(filename, "rb")) == NULL) php_error(E_ERROR, "Couldn't find file %s", filename); bitmap = newSWFJpegBitmap(jpeg); @@ -272,7 +272,7 @@ PHP_FUNCTION(swfbitmap_init) { FILE *dbl; - if((dbl = V_FOPEN(filename, "rb")) == NULL) + if((dbl = VCWD_FOPEN(filename, "rb")) == NULL) php_error(E_ERROR, "Couldn't find file %s", filename); bitmap = newSWFDBLBitmap(dbl); @@ -1091,7 +1091,7 @@ PHP_FUNCTION(swffont_init) if(strcmp(Z_STRVAL_PP(zfile)+Z_STRLEN_PP(zfile)-4, ".fdb") == 0) { - file = V_FOPEN(Z_STRVAL_PP(zfile), "rb"); + file = VCWD_FOPEN(Z_STRVAL_PP(zfile), "rb"); if(!file) php_error(E_ERROR, "Couldn't find FDB file %s", Z_STRVAL_PP(zfile)); @@ -1522,7 +1522,7 @@ PHP_FUNCTION(swfmovie_save) convert_to_string_ex(x); - file = V_FOPEN(Z_STRVAL_PP(x), "wb"); + file = VCWD_FOPEN(Z_STRVAL_PP(x), "wb"); if(file == NULL) php_error(E_ERROR, "couldn't open file %s for writing", Z_STRVAL_PP(x)); @@ -1624,7 +1624,7 @@ PHP_FUNCTION(swfmovie_streamMp3) { convert_to_string_ex(zfile); - file = V_FOPEN(Z_STRVAL_PP(zfile), "rb"); + file = VCWD_FOPEN(Z_STRVAL_PP(zfile), "rb"); if(!file) php_error(E_ERROR, "Couldn't find file %s", Z_STRVAL_PP(zfile)); diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 0f994da22d..b2c4e7174f 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -2925,7 +2925,7 @@ PHP_FUNCTION(ocisavelobfile) filename = (*arg)->value.str.val; - if ((fp = V_OPEN((filename, O_RDONLY|O_BINARY))) == -1) { + if ((fp = VCWD_OPEN((filename, O_RDONLY|O_BINARY))) == -1) { php_error(E_WARNING, "Can't open file %s", filename); RETURN_FALSE; } @@ -3043,7 +3043,7 @@ PHP_FUNCTION(ociwritelobtofile) goto bail; } - if ((fp = V_OPEN((filename,O_CREAT | O_RDWR | O_BINARY | O_TRUNC, 0600))) == -1) { + if ((fp = VCWD_OPEN((filename,O_CREAT | O_RDWR | O_BINARY | O_TRUNC, 0600))) == -1) { php_error(E_WARNING, "Can't create file %s", filename); goto bail; } diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 9e9f4433d0..8e7f3b9244 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -778,7 +778,7 @@ static X509_STORE * setup_verify(zval * calist) convert_to_string_ex(item); - if (V_STAT(Z_STRVAL_PP(item), &sb) == -1) { + if (VCWD_STAT(Z_STRVAL_PP(item), &sb) == -1) { zend_error(E_WARNING, "%s() unable to stat %s", get_active_function_name(), Z_STRVAL_PP(item)); continue; } diff --git a/ext/posix/posix.c b/ext/posix/posix.c index 537ad4bf23..c562b2e2b7 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -632,7 +632,7 @@ PHP_FUNCTION(posix_getcwd) char buffer[MAXPATHLEN]; char *p; - p = V_GETCWD(buffer, MAXPATHLEN); + p = VCWD_GETCWD(buffer, MAXPATHLEN); if (!p) { php_error(E_WARNING, "posix_getcwd() failed with '%s'", strerror(errno)); diff --git a/ext/rpc/com/com_wrapper.c b/ext/rpc/com/com_wrapper.c index 9ed09eb8d4..1526b09e8a 100644 --- a/ext/rpc/com/com_wrapper.c +++ b/ext/rpc/com/com_wrapper.c @@ -205,7 +205,7 @@ static PHP_INI_MH(OnTypelibFileChange) #endif - if (!new_value || (typelib_file=V_FOPEN(new_value, "r"))==NULL) { + if (!new_value || (typelib_file=VCWD_FOPEN(new_value, "r"))==NULL) { return FAILURE; } diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index 2348f144fe..ab24ee6354 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -139,16 +139,16 @@ static void ps_files_open(ps_files *data, const char *key) data->lastkey = estrdup(key); #ifdef O_EXCL - data->fd = V_OPEN((buf, O_RDWR | O_BINARY)); + data->fd = VCWD_OPEN((buf, O_RDWR | O_BINARY)); if (data->fd == -1) { if (errno == ENOENT) { - data->fd = V_OPEN((buf, O_EXCL | O_RDWR | O_CREAT | O_BINARY, 0600)); + data->fd = VCWD_OPEN((buf, O_EXCL | O_RDWR | O_CREAT | O_BINARY, 0600)); } } else { flock(data->fd, LOCK_EX); } #else - data->fd = V_OPEN((buf, O_CREAT | O_RDWR | O_BINARY, 0600)); + data->fd = VCWD_OPEN((buf, O_CREAT | O_RDWR | O_BINARY, 0600)); if (data->fd != -1) flock(data->fd, LOCK_EX); #endif @@ -196,9 +196,9 @@ static int ps_files_cleanup_dir(const char *dirname, int maxlifetime) /* NUL terminate it and */ buf[dirname_len + entry_len + 1] = '\0'; /* check whether its last access was more than maxlifet ago */ - if (V_STAT(buf, &sbuf) == 0 && + if (VCWD_STAT(buf, &sbuf) == 0 && (now - sbuf.st_atime) > maxlifetime) { - V_UNLINK(buf); + VCWD_UNLINK(buf); nrdels++; } } @@ -301,7 +301,7 @@ PS_DESTROY_FUNC(files) ps_files_close(data); - if (V_UNLINK(buf) == -1) { + if (VCWD_UNLINK(buf) == -1) { return FAILURE; } diff --git a/ext/session/session.c b/ext/session/session.c index 013754301c..5fad364eaf 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -536,7 +536,7 @@ static char *_php_create_id(int *newlen PSLS_DC) if (PS(entropy_length) > 0) { int fd; - fd = V_OPEN((PS(entropy_file), O_RDONLY)); + fd = VCWD_OPEN((PS(entropy_file), O_RDONLY)); if (fd >= 0) { char *p; int n; @@ -652,7 +652,7 @@ static void last_modified(void) path = SG(request_info).path_translated; if (path) { - if (V_STAT(path, &sb) == -1) { + if (VCWD_STAT(path, &sb) == -1) { return; } diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 7e779a7f75..4063d78468 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -2502,11 +2502,11 @@ PHP_FUNCTION(move_uploaded_file) RETURN_FALSE; } - V_UNLINK(Z_STRVAL_PP(new_path)); + VCWD_UNLINK(Z_STRVAL_PP(new_path)); if (rename(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path))==0) { successful=1; } else if (php_copy_file(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path))==SUCCESS) { - V_UNLINK(Z_STRVAL_PP(path)); + VCWD_UNLINK(Z_STRVAL_PP(path)); successful=1; } @@ -2604,7 +2604,7 @@ PHP_FUNCTION(parse_ini_file) } convert_to_string_ex(filename); - fh.handle.fp = V_FOPEN(Z_STRVAL_PP(filename), "r"); + fh.handle.fp = VCWD_FOPEN(Z_STRVAL_PP(filename), "r"); if (!fh.handle.fp) { php_error(E_WARNING,"Cannot open '%s' for reading", Z_STRVAL_PP(filename)); return; diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 20e0a620c2..3976613a79 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -139,7 +139,7 @@ PHP_MINIT_FUNCTION(browscap) return FAILURE; } - fh.handle.fp = V_FOPEN(browscap, "r"); + fh.handle.fp = VCWD_FOPEN(browscap, "r"); if (!fh.handle.fp) { php_error(E_CORE_WARNING,"Cannot open '%s' for reading", browscap); return FAILURE; diff --git a/ext/standard/dir.c b/ext/standard/dir.c index fcb1ea7543..2e1b4605c1 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -166,7 +166,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject) dirp = emalloc(sizeof(php_dir)); - dirp->dir = V_OPENDIR((*arg)->value.str.val); + dirp->dir = VCWD_OPENDIR((*arg)->value.str.val); #ifdef PHP_WIN32 if (!dirp->dir || dirp->dir->finished) { @@ -281,7 +281,7 @@ PHP_FUNCTION(chdir) } convert_to_string_ex(arg); - ret = V_CHDIR((*arg)->value.str.val); + ret = VCWD_CHDIR((*arg)->value.str.val); if (ret != 0) { php_error(E_WARNING, "ChDir: %s (errno %d)", strerror(errno), errno); @@ -305,9 +305,9 @@ PHP_FUNCTION(getcwd) } #if HAVE_GETCWD - ret = V_GETCWD(path, MAXPATHLEN); + ret = VCWD_GETCWD(path, MAXPATHLEN); #elif HAVE_GETWD - ret = V_GETWD(path); + ret = VCWD_GETWD(path); /* * #warning is not ANSI C * #else diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 832251fbce..56f2c6481a 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -99,9 +99,9 @@ int php_Exec(int type, char *cmd, pval *array, pval *return_value) sig_handler = signal (SIGCHLD, SIG_DFL); #endif #ifdef PHP_WIN32 - fp = V_POPEN(d, "rb"); + fp = VCWD_POPEN(d, "rb"); #else - fp = V_POPEN(d, "r"); + fp = VCWD_POPEN(d, "r"); #endif if (!fp) { php_error(E_WARNING, "Unable to fork [%s]", d); @@ -117,9 +117,9 @@ int php_Exec(int type, char *cmd, pval *array, pval *return_value) sig_handler = signal (SIGCHLD, SIG_DFL); #endif #ifdef PHP_WIN32 - fp = V_POPEN(cmd, "rb"); + fp = VCWD_POPEN(cmd, "rb"); #else - fp = V_POPEN(cmd, "r"); + fp = VCWD_POPEN(cmd, "r"); #endif if (!fp) { php_error(E_WARNING, "Unable to fork [%s]", cmd); @@ -451,9 +451,9 @@ PHP_FUNCTION(shell_exec) convert_to_string_ex(cmd); #ifdef PHP_WIN32 - if ((in=V_POPEN(Z_STRVAL_PP(cmd),"rt"))==NULL) { + if ((in=VCWD_POPEN(Z_STRVAL_PP(cmd),"rt"))==NULL) { #else - if ((in=V_POPEN(Z_STRVAL_PP(cmd),"r"))==NULL) { + if ((in=VCWD_POPEN(Z_STRVAL_PP(cmd),"r"))==NULL) { #endif php_error(E_WARNING,"Unable to execute '%s'",Z_STRVAL_PP(cmd)); } diff --git a/ext/standard/file.c b/ext/standard/file.c index b8c941706e..82bfa0eba7 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -719,7 +719,7 @@ PHP_FUNCTION(popen) } tmp = php_escape_shell_cmd(buf); - fp = V_POPEN(tmp,p); + fp = VCWD_POPEN(tmp,p); efree(tmp); if (!fp) { @@ -727,7 +727,7 @@ PHP_FUNCTION(popen) RETURN_FALSE; } } else { - fp = V_POPEN((*arg1)->value.str.val, p); + fp = VCWD_POPEN((*arg1)->value.str.val, p); if (!fp) { php_error(E_WARNING,"popen(\"%s\",\"%s\") - %s",(*arg1)->value.str.val,p,strerror(errno)); efree(p); @@ -1483,7 +1483,7 @@ PHP_FUNCTION(mkdir) if (PG(safe_mode) &&(!php_checkuid((*arg1)->value.str.val, NULL, CHECKUID_ALLOW_ONLY_DIR))) { RETURN_FALSE; } - ret = V_MKDIR((*arg1)->value.str.val, mode); + ret = VCWD_MKDIR((*arg1)->value.str.val, mode); if (ret < 0) { php_error(E_WARNING,"MkDir failed (%s)", strerror(errno)); RETURN_FALSE; @@ -1508,7 +1508,7 @@ PHP_FUNCTION(rmdir) if (PG(safe_mode) &&(!php_checkuid((*arg1)->value.str.val, NULL, CHECKUID_ALLOW_FILE_NOT_EXISTS))) { RETURN_FALSE; } - ret = V_RMDIR((*arg1)->value.str.val); + ret = VCWD_RMDIR((*arg1)->value.str.val); if (ret < 0) { php_error(E_WARNING,"RmDir failed (%s)", strerror(errno)); RETURN_FALSE; @@ -1707,7 +1707,7 @@ PHP_FUNCTION(rename) if (PG(safe_mode) &&(!php_checkuid(old_name, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { RETURN_FALSE; } - ret = V_RENAME(old_name, new_name); + ret = VCWD_RENAME(old_name, new_name); if (ret == -1) { php_error(E_WARNING,"Rename failed (%s)", strerror(errno)); @@ -1736,7 +1736,7 @@ PHP_FUNCTION(unlink) RETURN_FALSE; } - ret = V_UNLINK((*filename)->value.str.val); + ret = VCWD_UNLINK((*filename)->value.str.val); if (ret == -1) { php_error(E_WARNING, "Unlink failed (%s)", strerror(errno)); RETURN_FALSE; @@ -1867,17 +1867,17 @@ PHPAPI int php_copy_file(char *src, char *dest) int ret = FAILURE; #ifdef PHP_WIN32 - if ((fd_s=V_OPEN((src,O_RDONLY|_O_BINARY)))==-1) { + if ((fd_s=VCWD_OPEN((src,O_RDONLY|_O_BINARY)))==-1) { #else - if ((fd_s=V_OPEN((src,O_RDONLY)))==-1) { + if ((fd_s=VCWD_OPEN((src,O_RDONLY)))==-1) { #endif php_error(E_WARNING,"Unable to open '%s' for reading: %s", src, strerror(errno)); return FAILURE; } #ifdef PHP_WIN32 - if ((fd_t=V_OPEN((dest,_O_WRONLY|_O_CREAT|_O_TRUNC|_O_BINARY,_S_IREAD|_S_IWRITE)))==-1) { + if ((fd_t=VCWD_OPEN((dest,_O_WRONLY|_O_CREAT|_O_TRUNC|_O_BINARY,_S_IREAD|_S_IWRITE)))==-1) { #else - if ((fd_t=V_CREAT(dest,0777))==-1) { + if ((fd_t=VCWD_CREAT(dest,0777))==-1) { #endif php_error(E_WARNING,"Unable to create '%s': %s", dest, strerror(errno)); close(fd_s); @@ -2152,7 +2152,7 @@ PHP_FUNCTION(realpath) convert_to_string_ex(path); - if (V_REALPATH((*path)->value.str.val, resolved_path_buff)) { + if (VCWD_REALPATH((*path)->value.str.val, resolved_path_buff)) { RETURN_STRING(resolved_path_buff, 1); } else { RETURN_FALSE; diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 1ea165677d..866403238e 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -260,7 +260,7 @@ PHP_FUNCTION(chgrp) if (php_check_open_basedir((*filename)->value.str.val)) RETURN_FALSE; - ret = V_CHOWN((*filename)->value.str.val, -1, gid); + ret = VCWD_CHOWN((*filename)->value.str.val, -1, gid); if (ret == -1) { php_error(E_WARNING, "chgrp failed: %s", strerror(errno)); RETURN_FALSE; @@ -308,7 +308,7 @@ PHP_FUNCTION(chown) if (php_check_open_basedir((*filename)->value.str.val)) RETURN_FALSE; - ret = V_CHOWN((*filename)->value.str.val, uid, -1); + ret = VCWD_CHOWN((*filename)->value.str.val, uid, -1); if (ret == -1) { php_error(E_WARNING, "chown failed: %s", strerror(errno)); RETURN_FALSE; @@ -350,7 +350,7 @@ PHP_FUNCTION(chmod) if(PG(safe_mode)) imode &= 0777; - ret = V_CHMOD((*filename)->value.str.val, imode); + ret = VCWD_CHMOD((*filename)->value.str.val, imode); if (ret == -1) { php_error(E_WARNING, "chmod failed: %s", strerror(errno)); RETURN_FALSE; @@ -409,9 +409,9 @@ PHP_FUNCTION(touch) } /* create the file if it doesn't exist already */ - ret = V_STAT((*filename)->value.str.val, &sb); + ret = VCWD_STAT((*filename)->value.str.val, &sb); if (ret == -1) { - file = V_FOPEN((*filename)->value.str.val, "w"); + file = VCWD_FOPEN((*filename)->value.str.val, "w"); if (file == NULL) { php_error(E_WARNING, "unable to create file %s because %s", (*filename)->value.str.val, strerror(errno)); if (newtime) efree(newtime); @@ -420,7 +420,7 @@ PHP_FUNCTION(touch) fclose(file); } - ret = V_UTIME((*filename)->value.str.val, newtime); + ret = VCWD_UTIME((*filename)->value.str.val, newtime); if (newtime) efree(newtime); if (ret == -1) { php_error(E_WARNING, "utime failed: %s", strerror(errno)); @@ -469,7 +469,7 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ #if HAVE_SYMLINK BG(lsb).st_mode = 0; /* mark lstat buf invalid */ #endif - if (V_STAT(BG(CurrentStatFile), &BG(sb)) == -1) { + if (VCWD_STAT(BG(CurrentStatFile), &BG(sb)) == -1) { if (!IS_LINK_OPERATION() && (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)); } @@ -484,7 +484,7 @@ static void php_stat(const char *filename, php_stat_len filename_length, int typ #if HAVE_SYMLINK if (IS_LINK_OPERATION() && !BG(lsb).st_mode) { /* do lstat if the buffer is empty */ - if (V_LSTAT(filename, &BG(lsb)) == -1) { + if (VCWD_LSTAT(filename, &BG(lsb)) == -1) { php_error(E_NOTICE, "lstat failed for %s (errno=%d - %s)", filename, errno, strerror(errno)); RETURN_FALSE; } diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index b437befa5e..c32ae918c9 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -198,7 +198,7 @@ PHP_FUNCTION(iptcembed) if (php_check_open_basedir((*jpeg_file)->value.str.val)) RETURN_FALSE; - if ((fp = V_FOPEN((*jpeg_file)->value.str.val,"rb")) == 0) { + if ((fp = VCWD_FOPEN((*jpeg_file)->value.str.val,"rb")) == 0) { php_error(E_WARNING, "Unable to open %s", (*jpeg_file)->value.str.val); RETURN_FALSE; } diff --git a/ext/standard/link.c b/ext/standard/link.c index 038075cffe..7e7e60697e 100644 --- a/ext/standard/link.c +++ b/ext/standard/link.c @@ -87,7 +87,7 @@ PHP_FUNCTION(linkinfo) } convert_to_string_ex(filename); - ret = V_LSTAT((*filename)->value.str.val, &sb); + ret = VCWD_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/swf/swf.c b/ext/swf/swf.c index 820d082042..b81e9f7c94 100644 --- a/ext/swf/swf.c +++ b/ext/swf/swf.c @@ -190,7 +190,7 @@ PHP_FUNCTION(swf_openfile) free_na = 0; RETURN_FALSE; } - V_UNLINK((const char *)na); + VCWD_UNLINK((const char *)na); fclose(fp); free_na = 1; SWFG(use_file) = 0; @@ -236,7 +236,7 @@ PHP_FUNCTION(swf_closefile) char buf[4096]; int b; - if ((f = V_FOPEN(SWFG(tmpfile_name), "r")) == NULL) { + if ((f = VCWD_FOPEN(SWFG(tmpfile_name), "r")) == NULL) { php_error(E_WARNING, "Cannot create temporary file for stdout support with SWF"); RETURN_NULL(); } @@ -246,7 +246,7 @@ PHP_FUNCTION(swf_closefile) fclose(f); - V_UNLINK((const char *)SWFG(tmpfile_name)); + VCWD_UNLINK((const char *)SWFG(tmpfile_name)); } } /* }}} */ diff --git a/main/SAPI.c b/main/SAPI.c index b0bb456cae..8dc5e5890a 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -574,7 +574,7 @@ SAPI_API struct stat *sapi_get_stat() if (sapi_module.get_stat) { return sapi_module.get_stat(SLS_C); } else { - if (!SG(request_info).path_translated || (V_STAT(SG(request_info).path_translated, &SG(global_stat))==-1)) { + if (!SG(request_info).path_translated || (VCWD_STAT(SG(request_info).path_translated, &SG(global_stat))==-1)) { return NULL; } return &SG(global_stat); diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index af541f417e..217d35abd9 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -232,7 +232,7 @@ static FILE *php_fopen_and_set_opened_path(const char *path, char *mode, char ** if (php_check_open_basedir((char *)path)) { return NULL; } - fp = V_FOPEN(path, mode); + fp = VCWD_FOPEN(path, mode); if (fp && opened_path) { *opened_path = expand_filepath(path,NULL); } @@ -336,7 +336,7 @@ PHPAPI FILE *php_fopen_primary_script(void) SG(request_info).path_translated = NULL; return NULL; } - fp = V_FOPEN(filename, "rb"); + fp = VCWD_FOPEN(filename, "rb"); /* refuse to open anything that is not a regular file */ if (fp && (0 > fstat(fileno(fp), &st) || !S_ISREG(st.st_mode))) { @@ -349,7 +349,7 @@ PHPAPI FILE *php_fopen_primary_script(void) return NULL; } if (!(SG(options) & SAPI_OPTION_NO_CHDIR)) { - V_CHDIR_FILE(filename); + VCWD_CHDIR_FILE(filename); } SG(request_info).path_translated = filename; @@ -406,7 +406,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char ** } snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename); if (PG(safe_mode)) { - if (V_STAT(trypath, &sb) == 0 && (!php_checkuid(trypath, mode, CHECKUID_CHECK_MODE_PARAM))) { + if (VCWD_STAT(trypath, &sb) == 0 && (!php_checkuid(trypath, mode, CHECKUID_CHECK_MODE_PARAM))) { efree(pathbuf); return NULL; } @@ -520,7 +520,7 @@ PHPAPI char *expand_filepath(const char *filepath, char *real_path) char cwd[MAXPATHLEN]; char *result; - result = V_GETCWD(cwd, MAXPATHLEN); + result = VCWD_GETCWD(cwd, MAXPATHLEN); if (!result) { cwd[0] = '\0'; } diff --git a/main/main.c b/main/main.c index 04d0c16325..43c0c68a9a 100644 --- a/main/main.c +++ b/main/main.c @@ -267,7 +267,7 @@ void php_log_err(char *log_message) return; } #endif - log_file = V_FOPEN(PG(error_log), "a"); + log_file = VCWD_FOPEN(PG(error_log), "a"); if (log_file != NULL) { time(&error_time); strftime(error_time_str, 128, "%d-%b-%Y %H:%M:%S", php_localtime_r(&error_time, &tmbuf)); @@ -1168,7 +1168,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_D if (setjmp(EG(bailout))!=0) { if (old_cwd[0] != '\0') - V_CHDIR(old_cwd); + VCWD_CHDIR(old_cwd); free_alloca(old_cwd); return EG(exit_status); } @@ -1181,8 +1181,8 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_D if (primary_file->type == ZEND_HANDLE_FILENAME && primary_file->filename) { - V_GETCWD(old_cwd, OLD_CWD_SIZE-1); - V_CHDIR_FILE(primary_file->filename); + VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1); + VCWD_CHDIR_FILE(primary_file->filename); } if (PG(auto_prepend_file) && PG(auto_prepend_file)[0]) { @@ -1206,7 +1206,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_D zend_execute_scripts(ZEND_REQUIRE CLS_CC ELS_CC, 3, prepend_file_p, primary_file, append_file_p); if (old_cwd[0] != '\0') - V_CHDIR(old_cwd); + VCWD_CHDIR(old_cwd); free_alloca(old_cwd); return EG(exit_status); diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c index c9f29d9831..6ebcb2ed0f 100644 --- a/main/php_open_temporary_file.c +++ b/main/php_open_temporary_file.c @@ -114,7 +114,7 @@ static FILE *php_do_open_temporary_file(char *path, const char *pfx, char **open #ifdef PHP_WIN32 if (GetTempFileName(path, pfx, 0, opened_path)) { - fp = V_FOPEN(opened_path, "wb"); + fp = VCWD_FOPEN(opened_path, "wb"); } else { fp = NULL; } @@ -127,7 +127,7 @@ static FILE *php_do_open_temporary_file(char *path, const char *pfx, char **open } #else if (mktemp(opened_path)) { - fp = V_FOPEN(opened_path, "wb"); + fp = VCWD_FOPEN(opened_path, "wb"); } else { fp = NULL; } diff --git a/main/rfc1867.c b/main/rfc1867.c index 6f2bb85b63..d4240d552f 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -85,7 +85,7 @@ static void register_http_post_files_variable_ex(char *var, zval *val, zval *htt static int unlink_filename(char **filename) { - V_UNLINK(*filename); + VCWD_UNLINK(*filename); return 0; } diff --git a/main/safe_mode.c b/main/safe_mode.c index cd828a71e5..0421ad2c7d 100644 --- a/main/safe_mode.c +++ b/main/safe_mode.c @@ -70,7 +70,7 @@ PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode) } if (mode != CHECKUID_ALLOW_ONLY_DIR) { - ret = V_STAT(filename, &sb); + ret = VCWD_STAT(filename, &sb); if (ret < 0) { if (mode == CHECKUID_DISALLOW_FILE_NOT_EXISTS) { php_error(E_WARNING, "Unable to access %s", filename); @@ -98,7 +98,7 @@ PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode) if (s) { *s='\0'; - ret = V_STAT(filename, &sb); + ret = VCWD_STAT(filename, &sb); *s='/'; if (ret < 0) { php_error(E_WARNING, "Unable to access %s", filename); @@ -107,11 +107,11 @@ PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode) duid = sb.st_uid; } else { char cwd[MAXPATHLEN]; - if (!V_GETCWD(cwd, MAXPATHLEN)) { + if (!VCWD_GETCWD(cwd, MAXPATHLEN)) { php_error(E_WARNING, "Unable to access current working directory"); return 0; } - ret = V_STAT(cwd, &sb); + ret = VCWD_STAT(cwd, &sb); if (ret < 0) { php_error(E_WARNING, "Unable to access %s", cwd); return 0; diff --git a/sapi/caudium/caudium.c b/sapi/caudium/caudium.c index 278024dc2b..ed04859af4 100644 --- a/sapi/caudium/caudium.c +++ b/sapi/caudium/caudium.c @@ -640,7 +640,7 @@ static void php_caudium_module_main(php_caudium_request *ureq) * isn't. Not a problem though, since it's on by default when using ZTS * which we require. */ - V_CHDIR_FILE(THIS->filename->str); + VCWD_CHDIR_FILE(THIS->filename->str); #endif file_handle.type = ZEND_HANDLE_FILENAME; diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 58090fee3c..d509757432 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -708,7 +708,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine } if (cgi && !file_handle.handle.fp) { - file_handle.handle.fp = V_FOPEN(argv0, "rb"); + file_handle.handle.fp = VCWD_FOPEN(argv0, "rb"); if(!file_handle.handle.fp) { PUTS("No input file specified.\n"); php_request_shutdown((void *) 0); diff --git a/win32/registry.c b/win32/registry.c index d18ce40b41..8ae25011b7 100644 --- a/win32/registry.c +++ b/win32/registry.c @@ -25,7 +25,7 @@ void UpdateIniFromRegistry(char *path) char drive_letter; /* get current working directory and prepend it to the path */ - if (!V_GETCWD(tmp_buf, MAXPATHLEN)) { + if (!VCWD_GETCWD(tmp_buf, MAXPATHLEN)) { efree(orig_path); return; } |