usermode-cachemgr-open-mode-checking-fix-20010605
authorJeff Riegel <riegel@almaden.ibm.com>
Tue, 5 Jun 2001 15:11:01 +0000 (15:11 +0000)
committerDerrick Brashear <shadow@dementia.org>
Tue, 5 Jun 2001 15:11:01 +0000 (15:11 +0000)
default to read mode when opening

src/afs/UKERNEL/afs_usrops.c

index 2d93e7c..0c1e9eb 100644 (file)
@@ -2678,6 +2678,7 @@ int uafs_open_r(
            if (flags & (O_WRONLY|O_RDWR)) {
                fileMode |= VWRITE;
            }
+           if (!fileMode) fileMode = VREAD;  /* since O_RDONLY is 0 */
            code = afs_access(fileP, fileMode, u.u_cred);
            if (code != 0) {
                VN_RELE(fileP);