|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-06-05 16:43 UTC] daniele dot aluigi at semplify dot net
Description: ------------ Wrong behavior using tempnam() on an nfs v4 network filesystem. Temporary file is correctly created and returned with full path, but with wrong perms: 0000 instead of 0600, so basically it's not writeable. Works with the same mount options on the same FS but using nfs v3. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. I cannot reproduce this; the following prints 0600 for me: php -r "echo substr(sprintf('%o', fileperms(tempnam('/mnt/nfs/', 'z'))), -4);" maybe your mount or export options are to blame?Thanks, Output of the command: php -r "echo substr(sprintf('%o', fileperms(tempnam('/mnt/nfs/', 'z'))), -4);" on our system, produce: 0000, the wrong permission. nfs4_getfacl returns an empty resultset. I don't think it's an NFS v4 options issue, because: $tmp = tempnam('/nfs/vhosts/test/', 'z'); chmod($tmp,0600); echo substr(sprintf('%o', fileperms($tmp)), -4); is working fine, like all other filesystem functions, like: fopen. In this case nfs4_getfacl returns: A::OWNER@:rwatTnNcCy A:g:GROUP@:tcy A::EVERYONE@:tcy as expected. We also tried the same tempnam test scripts on an nfs v3 mount point, obviously with the same options, and here it works fine. Deeply investigating, we reproduced the same issue using the "C" function used by php: mkstemp(fname) Here again the same wrong behavior on nfs v4. Just to be clear, these are the nfs options we used for both mount points: rw,noatime,hard,intr,nfsvers=4