Re: [PATCH 1/2] Disallow appends to sysfs files

From: Josh Boyer
Date: Tue Jan 25 2005 - 17:53:46 EST


On Tue, 2005-01-25 at 16:38, Mitch Williams wrote:
> This patch causes an error to be returned if the caller attempts to open a
> sysfs file in append mode.
>
> This patch applies cleanly to 2.6.11-rc1.
>
> Signed-off-by: Mitch Williams <mitch.a.williams@xxxxxxxxx>
>
> diff -urpN -X dontdiff linux-2.6.11-clean/fs/sysfs/file.c linux-2.6.11/fs/sysfs/file.c
> --- linux-2.6.11-clean/fs/sysfs/file.c 2004-12-24 13:33:50.000000000 -0800
> +++ linux-2.6.11/fs/sysfs/file.c 2005-01-24 16:26:21.000000000 -0800
> @@ -275,6 +275,11 @@ static int check_perm(struct inode * ino
> if (!ops)
> goto Eaccess;
>
> + /* Is the file is open for append? Sorry, we don't do that. */
> + if (file->f_flags & O_APPEND) {
> + goto Einval;
> + }
> +

Could you drop the braces? Coding style thing.

thx,
josh

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/