From:             [EMAIL PROTECTED]
Operating system: Redhat Linux
PHP version:      4.2.3
PHP Bug Type:     Filesystem function related
Bug description:  move_uploaded_file() behavior gives inconsistant file permissions

move_uploaded_file() preserves permissions when the source   
& destination are on the same filesystem, but if they are   
on different filesystems sets them to (0777 & ~umask).    
    
In ext/standard/basic_functions.c move_uploaded_file()  
tries to use rename() which preserves permissions, but if  
that fails it uses php_copy_file() then unlink() which  
does not preserve the permissions.    
    
I believe that the behaviour should be consistant whether    
the source and destination are on the same filesystem or    
not (eg if php_copy_file() is used the destination should    
be chmod()ed to match the source's permissions after the   
copy)    
    
    
-- 
Edit bug report at http://bugs.php.net/?id=21032&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=21032&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=21032&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=21032&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=21032&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=21032&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=21032&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=21032&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=21032&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=21032&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=21032&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21032&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=21032&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=21032&r=isapi

Reply via email to