File permission problem with NFSv3 and 2.5.20-dj4

Brent Cook
2002-06-14T22:30:02Z

Hi,

Looks like there is a problem with NFSv3 and file permissions in the DJ
kernels.

A file that is marked as executable will lose its executable flag whenever
it is written to. I suspect the proble lies in the changes to the NFS file
info cacheing in the DJ kernels at least since 2.5.20-dj1 (I was unable
to find where this change occured in the changelog).

Here is one example:

Enter NFS mount (in this case, the NFS server is a FreeBSD 4.6 machine)
Compile a simple program; gcc hello.c -o hello
Result: hello has the following permissions: -rw-r--r--
Modify the permissions manually; chmod 755 hello
Result: hello has the following permissions: -rwxr-xr-x

Here is another:

Enter NFS mount
Compile a simple program; gcc hello.c -o hello
Result: hello has the following permissions: -rw-r--r--
Unmount the NFS mount; umount /home
Remount the NFS mount; mount server:/home /home
Result: hello has the following permissions: -rwxr-xr-x

Here is the final one:

Enter NFS mount, find a file with executable permissions;
Edit a file; vi whahoo.sh
Save and close the file
Results: file has the following permissions: -rw-r--r--

So, in the process of writing a file, its executable bits are lost. Can
someone help? The problem is not present with vanilla Linux-2.5.20.

Regards,
- Brent Cook