mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
- Change macros from V_ to VCWD_ because of AIX name clash
This commit is contained in:
parent
96330d36bc
commit
4c823e8a89
42 changed files with 152 additions and 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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
12
ext/db/db.c
12
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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 :
|
||||
|
|
|
@ -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 :
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
10
ext/gd/gd.c
10
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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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';
|
||||
}
|
||||
|
|
10
main/main.c
10
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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue