From: "Luis R. Rodriguez" <mcgrof@kernel.org>
To: "Luis R. Rodriguez" <mcgrof@kernel.org>
Cc: Nikolay Borisov <nborisov@suse.com>,
"Darrick J. Wong" <darrick.wong@oracle.com>,
Eric Sandeen <sandeen@sandeen.net>,
linux-xfs@vger.kernel.org,
Laurent Bonnaud <Laurent.Bonnaud@inpg.fr>,
Tso Ted <tytso@mit.edu>, Flex Liu <fliu@suse.com>,
Jake Norris <jake.norris@suse.com>, Jan Kara <jack@suse.cz>
Subject: Re: [RFC] xfs_repair: clear file / directory attribute on symlinks
Date: Fri, 27 Oct 2017 21:56:19 +0200 [thread overview]
Message-ID: <20171027195619.GC22894@wotan.suse.de> (raw)
In-Reply-To: <20171027170339.GA22894@wotan.suse.de>
On Fri, Oct 27, 2017 at 07:03:39PM +0200, Luis R. Rodriguez wrote:
> > > file = argv[2];
> > >
> > > fd = open(file, open_flags);
> > > if (!fd) {
> > > printf("Could not open file for operation: %s\n", cmd_str);
> > > usage();
> > > }
>
> This open() will though.
That's because the special mushrooms I took the day I wrote the above
code made me forget to instead check for:
if (fd < 0)
That will always fail.
So open() on a dangling symlink will fail as well.
So it seems we can't set these attributes via userspace, unless you
use xfs_db and as noted by Darrick that's not a valid use case, it'd
be fuzzing.
Luis
prev parent reply other threads:[~2017-10-27 19:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-26 22:50 [RFC] xfs_repair: clear file / directory attribute on symlinks Luis R. Rodriguez
2017-10-26 23:48 ` Eric Sandeen
2017-10-27 0:11 ` Darrick J. Wong
2017-10-27 0:28 ` Luis R. Rodriguez
2017-10-27 6:18 ` Nikolay Borisov
2017-10-27 17:03 ` Luis R. Rodriguez
2017-10-27 19:56 ` Luis R. Rodriguez [this message]
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=20171027195619.GC22894@wotan.suse.de \
--to=mcgrof@kernel.org \
--cc=Laurent.Bonnaud@inpg.fr \
--cc=darrick.wong@oracle.com \
--cc=fliu@suse.com \
--cc=jack@suse.cz \
--cc=jake.norris@suse.com \
--cc=linux-xfs@vger.kernel.org \
--cc=nborisov@suse.com \
--cc=sandeen@sandeen.net \
--cc=tytso@mit.edu \
/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