From: Josh Boyer <jdub@us.ibm.com>
To: Mitch Williams <mitch.a.williams@intel.com>
Cc: linux-kernel@vger.kernel.org, greg@kroah.com
Subject: Re: [PATCH 1/2] Disallow appends to sysfs files
Date: Tue, 25 Jan 2005 16:46:40 -0600 [thread overview]
Message-ID: <1106693200.6955.9.camel@weaponx.rchland.ibm.com> (raw)
In-Reply-To: <Pine.CYG.4.58.0501251429490.696@mawilli1-desk2.amr.corp.intel.com>
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@intel.com>
>
> 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
next prev parent reply other threads:[~2005-01-25 22:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-25 22:38 Mitch Williams
2005-01-25 22:46 ` Josh Boyer [this message]
2005-01-25 22:50 ` Mitch Williams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1106693200.6955.9.camel@weaponx.rchland.ibm.com \
--to=jdub@us.ibm.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mitch.a.williams@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®