X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=fs%2Fopen.c;h=1e06e443a5651adca7e114aeebb02044b7e24803;hb=b97d4c424e362ebf88fd9aa1b7ad82e3a28c26d3;hp=9af548fb841b00aa5f5c9eb34f7e36150e090cfd;hpb=b85cac574592b843c4be93c83303feeee0c4dc25;p=linux-2.6-microblaze.git diff --git a/fs/open.c b/fs/open.c index 9af548fb841b..1e06e443a565 100644 --- a/fs/open.c +++ b/fs/open.c @@ -1010,6 +1010,10 @@ inline int build_open_flags(const struct open_how *how, struct open_flags *op) if (how->resolve & ~VALID_RESOLVE_FLAGS) return -EINVAL; + /* Scoping flags are mutually exclusive. */ + if ((how->resolve & RESOLVE_BENEATH) && (how->resolve & RESOLVE_IN_ROOT)) + return -EINVAL; + /* Deal with the mode. */ if (WILL_CREATE(flags)) { if (how->mode & ~S_IALLUGO) @@ -1292,7 +1296,7 @@ EXPORT_SYMBOL(filp_close); */ SYSCALL_DEFINE1(close, unsigned int, fd) { - int retval = __close_fd(current->files, fd); + int retval = close_fd(fd); /* can't restart close syscall because file table entry was cleared */ if (unlikely(retval == -ERESTARTSYS ||