summaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-18 00:24:27 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-18 00:24:27 +0000
commitb9558d5f86c471a125abf1fb3a3882fb053b1f8c (patch)
tree707b53ec64e740a7da87d5f36485e3cd9b1c794e /fs/open.c
parentb3ac367c7a3e6047abe74817db27e34e759f279f (diff)
Merge with Linux 2.3.41.
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/open.c b/fs/open.c
index 82260bd5d..8aa828088 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -306,11 +306,12 @@ asmlinkage long sys_access(const char * filename, int mode)
struct dentry * dentry;
int old_fsuid, old_fsgid;
kernel_cap_t old_cap;
- int res = -EINVAL;
+ int res;
+
+ if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
+ return -EINVAL;
lock_kernel();
- if (mode != (mode & S_IRWXO)) /* where's F_OK, X_OK, W_OK, R_OK? */
- goto out;
old_fsuid = current->fsuid;
old_fsgid = current->fsgid;
old_cap = current->cap_effective;
@@ -337,7 +338,7 @@ asmlinkage long sys_access(const char * filename, int mode)
current->fsuid = old_fsuid;
current->fsgid = old_fsgid;
current->cap_effective = old_cap;
-out:
+
unlock_kernel();
return res;
}