Subject: Re: tun: add tun_flags, owner, group attributes in sysfs

From: Michael Tokarev <[email-masked]>
Date: Mon, 04 May 2009 14:36:30 +0400

David Woodhouse wrote:
> This patch adds three attribute files in /sys/class/net/$dev/ for tun
> devices; allowing userspace to obtain the information which TUNGETIFF
> offers, and more, but without having to attach to the device in question
> (which may not be possible if it's in use).
> 
[]
> +static DEVICE_ATTR(tun_flags, 0444, tun_show_flags, NULL);
> +static DEVICE_ATTR(owner, 0444, tun_show_owner, NULL);
> +static DEVICE_ATTR(group, 0444, tun_show_group, NULL);

Is there any reason why those files are not writable?

I understand flags one, sorta (but it is still useful to
be able to change some flags, like persistent, while it's
running), but for owner/group - it's just an integer that's
used to check permissions for ioctl, and can be set in sysfs
just fine.  I think anyway.

/mjt