Artifacts Associated With Ticket 1617990fffffffff
Ticket change [d86ca1b619] (rid 107434) by decosterjos on 2006-12-18 12:48:34:
- assignee initialized to: "vincentdarley"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Hi, When running test cmdAH-16.3 on an NFS mounted file system, the 'file readable' command returned the incorrect result. Running some test with the access system call as used in the TclpObjAccess function showed the problem. This was the test program: #include <iostream> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> int main() { std::cout << "access: " << access("gorp.file", R_OK) << std::endl; struct stat st; int rt = stat("gorp.file", &st); std::cout << "stat mode: " << std::oct << st.st_mode << std::dec << std::endl; std::cout << "& S_IRUSR = " << (st.st_mode & S_IRUSR) << std::endl; return 0; } The result of running this program on the NFS mounted file system was: access: 0 ===> expected -1 stat mode: 100333 & S_IRUSR = 0 The result of running this program on the local file system was: access: -1 stat mode: 100333 & S_IRUSR = 0 access reports the NFS file incorrectly as being readable while stat always return the correct result. Kind regards, Jos. - foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "decosterjos"
- subsystem initialized to: "37. File System"
- title initialized to: "Incorrect result of access() for NFS mounted files"
- type initialized to: "Bug"
Ticket change [16ee36a31f] (rid 124796) by dkf on 2006-12-18 21:24:40:
- closedate changed to: "2006-12-18T14:24:40"
- closer changed to: "dkf"
- icomment:
Logged In: YES user_id=79902 Originator: NO Checking stat() results is not always helpful either. For example, it is possible for access() to verify that you're allowed to read a file based on any Access Control List entries attached to the file, but stat() doesn't look at those. This is a known problem when using some filesystems (e.g. AFS). That NFS is broken the other way is just unfortunate, and probably unfixable too.
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Wont Fix"
- status changed to: "Pending"
- username: "dkf"
Ticket change [e13e45a050] (rid 87414) by decosterjos on 2006-12-18 22:30:06:
- icomment:
File Added - 207717: TclpObjAccess.c Logged In: YES user_id=370749 Originator: YES Possible combination of access and stat. File Added: TclpObjAccess.c
- login: "decosterjos"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "decosterjos"
- icomment:
Add attachment "TclpObjAccess.c" [b3e409367f] (rid 124927) by decosterjos on 2006-12-18 22:30:06.
Ticket change [35587ff750] (rid 106909) by dgp on 2006-12-18 22:51:46:
- icomment:
Logged In: YES user_id=80530 Originator: NO This sounds similar to troubles we had with Linux NFS and test fCmd-18.10. For that, we created the notNetworkFilesystem constraint. Feel free to expand use of that.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [d503197b46] (rid 123545) by decosterjos on 2006-12-19 23:07:43:
- icomment:
Logged In: YES user_id=370749 Originator: YES Another option would be to skip the test on network file systems (as done in fCmd.test): testConstraint notNetworkFilesystem 0 test cmdAH-16.3 {Tcl_FileObjCmd: readable} { -constraints {unix notRoot testchmod notNetworkFilesystem} -setup {testchmod 0333 $gorpfile} -body {file reada $gorpfile} -result 0 } A file not readable for yourself is not often useful, i guess this problem come from an NFS/acess() implementation never tested for a file not readable for yourself. - login: "decosterjos"
- mimetype: "text/plain"
- username: "decosterjos"
- icomment: