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

Re: Permissions for kernel device and /proc/



Hi,

I'm not expert in these matters, but since nobody answered, I'll give it
a try.

Hynek Hanke <hanke@brailcom.org> wrote:

> I have no direct controll over /dev/softsynth and /proc/speakup as
> they are not created by my package.

Sounds like the crucial point to me. As for /proc/speakup, I think the
owner and permissions should be set in the kernel patch that creates
this file. As for /dev/softsynth, I believe you have to make sure the
owner/perms are set correctly in those two places:
  - MAKEDEV
  - udev

The former should be done in package 'makedev'. Concerning the latter,
probably the package shipping the kernel patch you mentioned should
provide something under /etc/udev ("udev rules") to ensure proper owner
and perms.

I don't think these jobs should be done in the package shipping the
userspace app, especially if the kernel interfaces you mentioned are of
more general use than this only userspace app.

> I could just write it in the README that my package expects such and
> such permissions on the devices, but this will confuse many users (the
> application won't work just after it is installed).

Documenting, if done properly, cannot harm. But if the owner/perms are
set correctly in the right place (the package providing the interface
files in /proc and /dev), I think all you'll have to document in the end
is that users have to be in $group in order to use the userspace app.

> I can change the ownership of /dev/softsynth from the package install
> scripts, but this is of little help if /dev/softsynth is dynamically
> created. How to do it properly?

I believe the answer is writing appropriate udev rules. But making sure
MAKEDEV Does The Right Thing is probably a good idea too.

HTH,

-- 
Florent



Reply to: