diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2010-05-24 17:15:57 (GMT) |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2010-05-24 17:15:57 (GMT) |
commit | 0191f8697bbdfefcd36e7b8dc3eeddfe82893e4b (patch) | |
tree | 2be5e7911e227b46d2e7b6ba3db9795ede71d8f6 | |
parent | e36f724b4ae70e443a7d152929b60059cbfa1a26 (diff) | |
download | linux-0191f8697bbdfefcd36e7b8dc3eeddfe82893e4b.tar.xz |
pipe: F_SETPIPE_SZ should return -EPERM for non-root
If the passed in size is larger than what has been set as the
system wide limit and the user is not root, we want to return
permission denied (not invalid value).
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | fs/pipe.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1170,7 +1170,7 @@ long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg) switch (cmd) { case F_SETPIPE_SZ: if (!capable(CAP_SYS_ADMIN) && arg > pipe_max_pages) - return -EINVAL; + return -EPERM; /* * The pipe needs to be at least 2 pages large to * guarantee POSIX behaviour. |