浏览代码

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>
Jens Axboe 15 年之前
父节点
当前提交
0191f8697b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fs/pipe.c

+ 1 - 1
fs/pipe.c

@@ -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.