Skip to content

Commit

Permalink
pipe: F_SETPIPE_SZ should return -EPERM for non-root
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Axboe committed May 24, 2010
1 parent e36f724 commit 0191f86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0191f86

Please sign in to comment.