aboutsummaryrefslogtreecommitdiffstats
path: root/fs/pipe.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2010-05-24 13:15:57 -0400
committerJens Axboe <jens.axboe@oracle.com>2010-05-24 13:15:57 -0400
commit0191f8697bbdfefcd36e7b8dc3eeddfe82893e4b (patch)
tree2be5e7911e227b46d2e7b6ba3db9795ede71d8f6 /fs/pipe.c
parente36f724b4ae70e443a7d152929b60059cbfa1a26 (diff)
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>
Diffstat (limited to 'fs/pipe.c')
-rw-r--r--fs/pipe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/pipe.c b/fs/pipe.c
index d79872eba09a..01ca9fab95fa 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -1170,7 +1170,7 @@ long pipe_fcntl(struct file *file, unsigned int cmd, unsigned long arg)
1170 switch (cmd) { 1170 switch (cmd) {
1171 case F_SETPIPE_SZ: 1171 case F_SETPIPE_SZ:
1172 if (!capable(CAP_SYS_ADMIN) && arg > pipe_max_pages) 1172 if (!capable(CAP_SYS_ADMIN) && arg > pipe_max_pages)
1173 return -EINVAL; 1173 return -EPERM;
1174 /* 1174 /*
1175 * The pipe needs to be at least 2 pages large to 1175 * The pipe needs to be at least 2 pages large to
1176 * guarantee POSIX behaviour. 1176 * guarantee POSIX behaviour.