In the 2006-03-09 version, file "lib/exe/media.php", line 127 and 128 are:
// set the correct permission here
if($conf['fperm']) chmod($fn, $conf['fperm']);
Anyway, the bug is still there. The correct line is:
This bug is fixed in the development code, file "inc/media.php" (media_upload function moved here), from line 223:
// Set the correct permission here.
// Always chmod media because they may be saved with different permissions than expected from the php umask.
// (Should normally chmod to $conf['fperm'] only if $conf['fperm'] is set.)