The behavior of system call access on Solaris is different with Linux. Here is a snippet from the manual of access: If the process has appropriate privileges, an implementation may indicate success for X_OK even if none of the execute file permission bits are set. So for a root account, the return value for access on Solaris is different with Linux. Replace access with stat to solve the problem. Another issue hasn't been addressed: comment 5 for bug 169506: Why not just replace access with stat universally?
Created attachment 237500 [details] [diff] [review] Patch v1
brendan, why access() not stat()?
Because access is faster -- no stat buf to copy out of kernel space to userland. /be
The difference behaviors influence the file opening dialog for Firefox under Solaris. With root account or account having root privilege, the dialog disables the "open with" option. Is there any reference for the access system call to make the implementations coherent?
dougt, to provide the same functionality with Linux, I made this patch. What's your opinion on it? Besides that, I'm also a little confused by the evaluation for "isexecutable" here: http://lxr.mozilla.org/seamonkey/source/toolkit/mozapps/downloads/src/nsHelperAppDlg.js.in#430 Since we always make a temp file with permission 600 before we really open it: http://lxr.mozilla.org/seamonkey/source/uriloader/exthandler/nsExternalHelperAppService.cpp#1610, is that redundant for us to evaluate the executable permission again?
dougt, any advice on the patch? It changes the code for Solaris and makes the output of nsLocalFile::Exists consistent with Linux.
Comment on attachment 237500 [details] [diff] [review] Patch v1 This is fine. Feel free to request which ever branches you want to land this on.
Thanks. Checking in xpcom/io/nsLocalFileUnix.cpp; /cvsroot/mozilla/xpcom/io/nsLocalFileUnix.cpp,v <-- nsLocalFileUnix.cpp new revision: 1.135; previous revision: 1.134
Comment on attachment 237500 [details] [diff] [review] Patch v1 This patch makes the behaviour of nsLocalFile::Exists on Solaris consistent with Linux. It only affects the Solaris platform and with low risk. Ask for the approval for 1.8 branch.
Comment on attachment 237500 [details] [diff] [review] Patch v1 Approved for 1.8 branch, a=jay for drivers.
Checking in xpcom/io/nsLocalFileUnix.cpp; /cvsroot/mozilla/xpcom/io/nsLocalFileUnix.cpp,v <-- nsLocalFileUnix.cpp new revision: 126.96.36.199; previous revision: 188.8.131.52 done
hi alfred, since this is solaris based fix, could you test it and verify for us on the 1.8 branch? If the fix is valid, please change the keywords field from "fixed184.108.40.206" to "verified220.127.116.11" Thanks!
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:18.104.22.168pre) Gecko/20070131 BonEcho/22.214.171.124pre. =>Verified.
I just put a binary file and a .xls file on our internal web. It works fine with root user. Do we still need a test case for that?