提交 0191f869 编写于 作者: J Jens Axboe

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: NJens Axboe <jens.axboe@oracle.com>
上级 e36f724b
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册