On Friday, 09 December, 2011 17:40:27 Stefan Behrens wrote:
> An ioctl interface is added to get the device statistic counters.
> A second ioctl is added to atomically get and reset these counters.

[...]

> 
> +static long btrfs_ioctl_get_device_stats(struct btrfs_root *root,
> +                                      void __user *arg, int reset_after_read)
> +{
> +     struct btrfs_ioctl_get_device_stats *sa;
> +     int ret;
> +
> +     if (!capable(CAP_SYS_ADMIN))
> +             return -EPERM;
> +

I agree that the BTRFS_IOC_GET_AND_RESET_DEVICE_STATS should be a privileged 
operation. But I think that the BTRFS_IOC_GET_DEVICE_STATS should be allowed 
to everyone. Think about a daemon which look at the error, and then send an 
email to warn about possible defect. Allowing BTRFS_IOC_GET_DEVICE_STATS to 
everyone, prevent to run the deamon with root privileges.

BR
G.Baroncelli


[...]
-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <[email protected]>
Key fingerprint = 4769 7E51 5293 D36C 814E  C054 BF04 F161 3DC5 0512
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to