summaryrefslogtreecommitdiff
path: root/nfs/ops.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-04-02 16:23:38 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-04-02 16:23:38 +0000
commit94e7f872772fe00e82142c6935fb53fb6ebd5234 (patch)
tree361bdce6bf61b2a8ecdfaddbf3dd4505ae876f07 /nfs/ops.c
parent1686ccfe45e5afc2d7eaf2d986b7b52172a37532 (diff)
(netfs_report_access): Oops.
Diffstat (limited to 'nfs/ops.c')
-rw-r--r--nfs/ops.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/nfs/ops.c b/nfs/ops.c
index 92095648..775d8a92 100644
--- a/nfs/ops.c
+++ b/nfs/ops.c
@@ -959,21 +959,21 @@ netfs_report_access (struct netcred *cred,
here we err on the side of denying access, and that we always
have to check everything. */
+ *types = 0;
+
len = 1;
err = netfs_attempt_read (cred, np, 0, &len, &byte);
if (err)
- {
- *types = 0;
- return;
- }
-
+ return;
assert (len == 1 || len == 0);
+ *types |= O_READ | O_EXEC;
+
if (len == 1)
{
err = netfs_attempt_write (cred, np, 0, &len, &byte);
- if (err)
- *types &= ~O_WRITE;
+ if (!err)
+ *types |= O_WRITE;
}
else
{
@@ -984,8 +984,8 @@ netfs_report_access (struct netcred *cred,
check this and not just return a presumptive error. */
byte = 0;
err = netfs_attempt_write (cred, np, 0, &len, &byte);
- if (err)
- *types &= ~O_WRITE;
+ if (!err)
+ *types |= O_WRITE;
netfs_attempt_set_size (cred, np, 0);
}
}