cvs: php4 /ext/standard file.c filestat.c /main win95nt.h
| From: | Zeev Suraski | Date: | Tue, 31 Oct 2000 18:05:19 +0000 |
| Subject: | cvs: php4 /ext/standard file.c filestat.c /main win95nt.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2386@lists.php.net to get a copy of this message | ||
zeev Tue Oct 31 10:05:19 2000 EDT
Modified files:
/php4/ext/standard file.c filestat.c
/php4/main win95nt.h
Log:
mode_t fixes
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.120 php4/ext/standard/file.c:1.121
--- php4/ext/standard/file.c:1.120 Sun Oct 29 01:14:53 2000
+++ php4/ext/standard/file.c Tue Oct 31 10:05:19 2000
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.120 2000/10/29 09:14:53 thies Exp $ */
+/* $Id: file.c,v 1.121 2000/10/31 18:05:19 zeev Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -1278,7 +1278,8 @@
PHP_FUNCTION(mkdir)
{
pval **arg1, **arg2;
- int ret,mode;
+ int ret;
+ mode_t mode;
PLS_FETCH();
if (ARG_COUNT(ht) != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) {
@@ -1286,11 +1287,11 @@
}
convert_to_string_ex(arg1);
convert_to_long_ex(arg2);
- mode = (*arg2)->value.lval;
+ mode = (mode_t) (*arg2)->value.lval;
if (PG(safe_mode) &&(!php_checkuid((*arg1)->value.str.val, NULL, 3))) {
RETURN_FALSE;
}
- ret = V_MKDIR((*arg1)->value.str.val,mode);
+ ret = V_MKDIR((*arg1)->value.str.val, mode);
if (ret < 0) {
php_error(E_WARNING,"MkDir failed (%s)", strerror(errno));
RETURN_FALSE;
Index: php4/ext/standard/filestat.c
diff -u php4/ext/standard/filestat.c:1.47 php4/ext/standard/filestat.c:1.48
--- php4/ext/standard/filestat.c:1.47 Sun Oct 29 01:14:53 2000
+++ php4/ext/standard/filestat.c Tue Oct 31 10:05:19 2000
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: filestat.c,v 1.47 2000/10/29 09:14:53 thies Exp $ */
+/* $Id: filestat.c,v 1.48 2000/10/31 18:05:19 zeev Exp $ */
#include "php.h"
#include "safe_mode.h"
@@ -324,7 +324,8 @@
PHP_FUNCTION(chmod)
{
pval **filename, **mode;
- int ret,imode;
+ int ret;
+ mode_t imode;
PLS_FETCH();
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2,&filename,&mode)==FAILURE) {
@@ -341,7 +342,7 @@
if (php_check_open_basedir((*filename)->value.str.val))
RETURN_FALSE;
- imode = (*mode)->value.lval;
+ imode = (mode_t) (*mode)->value.lval;
/* in safe mode, do not allow to setuid files.
Setuiding files could allow users to gain privileges
that safe mode doesn't give them.
Index: php4/main/win95nt.h
diff -u php4/main/win95nt.h:1.8 php4/main/win95nt.h:1.9
--- php4/main/win95nt.h:1.8 Mon Aug 21 02:57:13 2000
+++ php4/main/win95nt.h Tue Oct 31 10:05:19 2000
@@ -10,7 +10,6 @@
#include <sys/types.h>
typedef int uid_t;
typedef int gid_t;
-typedef int mode_t;
typedef char * caddr_t;
#define lstat(x, y) stat(x, y)
#define _IFIFO 0010000 /* fifo */