diff --git a/ext/db/db.c b/ext/db/db.c index c1df8348c97..4ea0d09ece5 100644 --- a/ext/db/db.c +++ b/ext/db/db.c @@ -333,7 +333,7 @@ dbm_info *php_dbm_open(char *filename, char *mode) { } #else /* NFS_HACK */ - lockfd = open(lockfn,O_RDWR|O_CREAT,0644); + lockfd = V_OPEN((lockfn,O_RDWR|O_CREAT,0644)); if (lockfd) { flock(lockfd,LOCK_EX); @@ -428,7 +428,7 @@ int php_dbm_close(dbm_info *info) { unlink(info->lockfn); #else if (info->lockfn) { - lockfd = open(info->lockfn,O_RDWR,0644); + lockfd = V_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 fa38de931b0..31483e03be2 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 = open(info->path, gmode); + cdb->fd = V_OPEN((info->path, gmode)) if(cdb->fd < 0) { free(cdb); return FAILURE; diff --git a/ext/dba/dba_dbm.c b/ext/dba/dba_dbm.c index 0fab79f002d..13b7ac7d5d2 100644 --- a/ext/dba/dba_dbm.c +++ b/ext/dba/dba_dbm.c @@ -51,7 +51,7 @@ #define TRUNC_IT(extension, mode) \ snprintf(buf, PATH_MAX, "%s" extension, info->path); \ buf[PATH_MAX] = '\0'; \ - if((fd = open(buf, O_CREAT | mode | O_WRONLY, filemode)) == -1) \ + if((fd = V_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 c7222fdc9c7..110f03061a2 100644 --- a/ext/dbase/dbase.c +++ b/ext/dbase/dbase.c @@ -586,15 +586,15 @@ PHP_FUNCTION(dbase_create) { RETURN_FALSE; } - if (PG(safe_mode) && (!php_checkuid(filename->value.str.val, 2))) { + if (PG(safe_mode) && (!php_checkuid(Z_STRVAL_P(filename), 2))) { RETURN_FALSE; } - if (php_check_open_basedir(filename->value.str.val)) { + if (php_check_open_basedir(Z_STRVAL_P(filename))) { RETURN_FALSE; } - if ((fd = open(filename->value.str.val, O_BINARY|O_RDWR|O_CREAT, 0644)) < 0) { + if ((fd = V_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 1f104e3d81a..cc97330347d 100644 --- a/ext/dbase/dbf_head.c +++ b/ext/dbase/dbf_head.c @@ -226,10 +226,10 @@ dbhead_t *dbf_open(char *dp, int o_flags) dbhead_t *dbh; cp = dp; - if ((fd = open(cp, o_flags|O_BINARY)) < 0) { + if ((fd = V_OPEN((cp, o_flags|O_BINARY))) < 0) { cp = (char *)malloc(256); strcpy(cp, dp); strcat(cp, ".dbf"); - if ((fd = open(cp, o_flags)) < 0) { + if ((fd = V_OPEN((cp, o_flags))) < 0) { perror("open"); return NULL; } diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 5e6241cca80..8090f5f5782 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -2690,7 +2690,7 @@ PHP_FUNCTION(ocisavelobfile) filename = (*arg)->value.str.val; - if ((fp = open(filename, O_RDONLY)) == -1) { + if ((fp = V_OPEN((filename, O_RDONLY))) == -1) { php_error(E_WARNING, "Can't open file %s", filename); RETURN_FALSE; } @@ -2812,7 +2812,7 @@ PHP_FUNCTION(ociwritelobtofile) goto bail; } - if ((fp = open(filename,O_CREAT|O_TRUNC|O_WRONLY)) == -1) { + if ((fp = V_OPEN((filename,O_CREAT|O_TRUNC|O_WRONLY))) == -1) { php_error(E_WARNING, "Can't create file %s", filename); goto bail; } diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index e9ff89212fd..5b363a405b8 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -132,16 +132,16 @@ static void _ps_files_open(ps_files *data, const char *key) data->lastkey = estrdup(key); #ifdef O_EXCL - data->fd = open(buf, O_RDWR); + data->fd = V_OPEN((buf, O_RDWR)); if (data->fd == -1) { if (errno == ENOENT) { - data->fd = open(buf, O_EXCL | O_RDWR | O_CREAT, 0600); + data->fd = V_OPEN((buf, O_EXCL | O_RDWR | O_CREAT, 0600)); } } else { flock(data->fd, LOCK_EX); } #else - data->fd = open(buf, O_CREAT | O_RDWR, 0600); + data->fd = V_OPEN((buf, O_CREAT | O_RDWR, 0600)); if (data->fd != -1) flock(data->fd, LOCK_EX); #endif diff --git a/ext/session/session.c b/ext/session/session.c index 2b53ba712f4..726310e69cc 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -394,7 +394,7 @@ static char *_php_create_id(int *newlen PSLS_DC) if (PS(entropy_length) > 0) { int fd; - fd = open(PS(entropy_file), O_RDONLY); + fd = V_OPEN((PS(entropy_file), O_RDONLY)); if (fd >= 0) { char *p; int n;