Re: [PATCH 1/2] btrfs-progs: multidevice support for check_mounted

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

 



On Sat, Nov 21, 2009 at 03:38:38PM +0100, Andi Drebes wrote:
> +
> +/* Checks if an mntentry represents a pseudo FS */
> +int is_pseudo_fs(const struct mntent* mnt)
> +{
> +	struct stat st_buf;
> +
> +	if(stat(mnt->mnt_fsname, &st_buf) < 0) {
> +		if(errno == ENOENT)
> +			return 1;
> +		else
> +			return -errno;
> +	}
> +
> +	return 0;
> +}

 This is bad idea. The mnt_fsname field could be an arbitrary string
 include valid paths.

        # grep sysfs /proc/mounts 
        /sys /sys sysfs rw,relatime 0 0

 Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux