summaryrefslogtreecommitdiff
path: root/nfs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-04-02 15:33:01 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-04-02 15:33:01 +0000
commit1686ccfe45e5afc2d7eaf2d986b7b52172a37532 (patch)
tree74c345b8ebecced35370db8c125f93e231293f01 /nfs
parent52014e085787404ae9299200ab8c1f9213d18ddf (diff)
(netfs_report_access): Never mind on new calling conv.
Diffstat (limited to 'nfs')
-rw-r--r--nfs/ops.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/nfs/ops.c b/nfs/ops.c
index cca10984..92095648 100644
--- a/nfs/ops.c
+++ b/nfs/ops.c
@@ -959,9 +959,6 @@ netfs_report_access (struct netcred *cred,
here we err on the side of denying access, and that we always
have to check everything. */
- if (*types == 0)
- return;
-
len = 1;
err = netfs_attempt_read (cred, np, 0, &len, &byte);
if (err)
@@ -972,27 +969,24 @@ netfs_report_access (struct netcred *cred,
assert (len == 1 || len == 0);
- if (*types & O_WRITE)
+ if (len == 1)
{
- if (len == 1)
- {
- err = netfs_attempt_write (cred, np, 0, &len, &byte);
- if (err)
- *types &= ~O_WRITE;
- }
- else
- {
- /* Oh, ugh. We have to try and write a byte and then truncate
- back. God help us if the file becomes unwritable in-between.
- But because of the use of this function (by setuid programs
- wanting to see if they should write user's files) we must
- 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;
- netfs_attempt_set_size (cred, np, 0);
- }
+ err = netfs_attempt_write (cred, np, 0, &len, &byte);
+ if (err)
+ *types &= ~O_WRITE;
+ }
+ else
+ {
+ /* Oh, ugh. We have to try and write a byte and then truncate
+ back. God help us if the file becomes unwritable in-between.
+ But because of the use of this function (by setuid programs
+ wanting to see if they should write user's files) we must
+ 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;
+ netfs_attempt_set_size (cred, np, 0);
}
}