NFS and CIFS use of the read-only bit
About read-only bits
The filer, along with MS-DOS and Windows, supports a per-file read-only bit that reflects whether a file is writable or read-only. This bit applies only to files and not to directories. NFS has no protocol operations that know about the per-file read-only bit. However, some software, when used both by NFS clients on UNIX systems and by CIFS clients on Windows systems, requires that the read-only bit reflects whether the file is writable.
How NFS treats the read-only bit
The following list describes how NFS treats the read-only bit:
- Any file with the read-only bit turned on is treated, for all NFS operations, as if it had no write permission bits turned on.
- If a file has at least one write permission bit turned on and an NFS client turns off all write permission bits, the filer turns on the read-only bit for that file. As described in the preceding paragraph, a file with the read-only bit turned on appears to an NFS client not to have any write permission bits turned on.
- If a file has no write permission bits turned on and an NFS client turns on any write permission bit, the filer turns off the read-only bit for that file.
- If a file's read-only bit is turned on and an NFS client attempts to find out the permission bits for the file, the actual permission bits for the file are not sent to the NFS client; instead, the filer sends the permission bits to the NFS client with the write permission bits masked off.
- If a file's read-only bit is turned on and a CIFS client turns the read-only bit off, the filer turns on the owner's write permission bit for the file.
- Files with the read-only bit turned on are writable only by the superuser.
How the filer tracks the NFS or CIFS client read-only bit
Whenever the read-only bit is turned on by a client, even if it was already on before the client did so, the filer tracks whether the client that turned on the bit was an NFS or CIFS client, as follows:
- If the bit was turned on by a CIFS client, renaming the file is not allowed. This is because file systems on MS-DOS and Windows systems do not allow renaming a file whose read-only bit has been set. NFS deletes follow NFS conventions. That is, deletes are allowed if the user has write permission in the parent directory.
- If the bit was turned on by an NFS client that turned off all write permission bits, removing or renaming the file is allowed if the user has sufficient permission to do so. This is because file systems on UNIX systems allow removing or renaming a file that has no write permission bits set.
- If the filer is using UNIX-style security, CIFS clients are also allowed to delete a file with the read-only bit set. This is required for compatibility with standard UNIX source control programs, such as RCS.
- If the filer is configured with PC-style security, the read-only bit is enforced.
Copyright © 1999, Network Appliance, Inc. All rights
reserved.
Part No. 210-02334
File: multi3.htm
Last updated: 02/24/99 12:16:17