Re: [RFC] xfs_repair: clear file / directory attribute on symlinks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux