Ticket #2190: suid.diff

File suid.diff, 513 bytes (added by ryan, 6 years ago)

Preserve suid and guid bits on upload dirs

  • functions-post.php

     
    846846         
    847847        // Give the new dirs the same perms as wp-content. 
    848848        $stat = stat(ABSPATH . 'wp-content'); 
    849         $dir_perms = $stat['mode'] & 0000777;  // Get the permission bits. 
     849        $dir_perms = $stat['mode'] & 0007777;  // Get the permission bits. 
    850850 
    851851        // Make sure we have an uploads dir 
    852852        if ( ! file_exists( $path ) ) {