Make WordPress Core


Ignore:
Timestamp:
01/02/2006 02:50:59 AM (21 years ago)
Author:
ryan
Message:

Preserve suid and sgid bits when creating new directories. fixes #2190

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/cache.php

    r3386 r3388  
    206206
    207207                        if (!file_exists($this->cache_dir.$make_dir."index.php")) {
     208                                $file_perms = $perms & 0000666;
    208209                                @ touch($this->cache_dir.$make_dir."index.php");
     210                                @ chmod($this->cache_dir.$make_dir."index.php", $file_perms);
    209211                        }
    210212                }
     
    269271                // Give the new dirs the same perms as wp-content.
    270272                $stat = stat(ABSPATH.'wp-content');
    271                 $dir_perms = $stat['mode'] & 0000777; // Get the permission bits.
     273                $dir_perms = $stat['mode'] & 0007777; // Get the permission bits.
     274                $file_perms = $dir_perms & 0000666; // Remove execute bits for files.
    272275
    273276                // Make the base cache dir.
     
    280283                if (!file_exists($this->cache_dir."index.php")) {
    281284                        @ touch($this->cache_dir."index.php");
     285                        @ chmod($this->cache_dir."index.php", $file_perms);
    282286                }
    283287
     
    315319                                        }
    316320                                }
     321                                @ chmod($cache_file, $file_perms);
    317322                        }
    318323                }
Note: See TracChangeset for help on using the changeset viewer.