]> granicus.if.org Git - php/commitdiff
mode_t fixes
authorZeev Suraski <zeev@php.net>
Tue, 31 Oct 2000 18:05:19 +0000 (18:05 +0000)
committerZeev Suraski <zeev@php.net>
Tue, 31 Oct 2000 18:05:19 +0000 (18:05 +0000)
ext/standard/file.c
ext/standard/filestat.c
main/win95nt.h

index 82f049f75da8fa85df0035e665d81c7b9596ac80..4a97de3c626e72bfd18e5202a0332020b22165eb 100644 (file)
@@ -1278,7 +1278,8 @@ PHP_FUNCTION(fseek)
 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 @@ PHP_FUNCTION(mkdir)
        }
        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 71b88c8e9b552b282eccc95d5c2d0ac5632289c6..fa7099015457b1ce37d7fdc96c710468537016f7 100644 (file)
@@ -324,7 +324,8 @@ PHP_FUNCTION(chown)
 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 @@ PHP_FUNCTION(chmod)
        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 a1cbd3bd1ed3f9eb0757dca9e5927aa2ab1541a6..322207fdea07fb30722a14654f80f3e42b56b0bb 100644 (file)
@@ -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 */