devfs permissions wierdness
Louis LeBlanc
FreeBSD at keyslapper.net
Wed Jul 6 21:48:13 GMT 2005
On 07/06/05 04:11 PM, Louis LeBlanc sat at the `puter and typed:
> I have my devfs config set up to allow certain devices to be mounted
> by users in the cdusers group as follows:
>
> own da1 root:cdusers
> perm da1 0660
> own da1a root:cdusers
> perm da1a 0660
> own da1c root:cdusers
> perm da1c 0660
> own da1s1 root:cdusers
> perm da1s1 0660
>
> Problem is it doesn't work unless I go in as root and manually restart
> the devfs facility with `/etc/rc.d/devfs restart`
>
> Here's what I see:
>
> <root># ls -l /dev/da1*
> crw-r----- 1 root operator 4, 27 Jun 26 23:02 /dev/da1
> crw-r----- 1 root operator 4, 29 Jun 26 23:02 /dev/da1a
> crw-r----- 1 root operator 4, 30 Jun 26 23:02 /dev/da1c
> crw-r----- 1 root operator 4, 31 Jun 26 23:02 /dev/da1cs1
> crw-r----- 1 root operator 4, 28 Jun 26 23:02 /dev/da1s1
> <root># /etc/rc.d/devfs restart
> <root># ls -l /dev/da1*
> crw-rw---- 1 root cdusers 4, 27 Jun 26 23:02 /dev/da1
> crw-rw---- 1 root cdusers 4, 29 Jun 26 23:02 /dev/da1a
> crw-rw---- 1 root cdusers 4, 30 Jun 26 23:02 /dev/da1c
> crw-r----- 1 root operator 4, 31 Jun 26 23:02 /dev/da1cs1
> crw-rw---- 1 root cdusers 4, 28 Jun 26 23:02 /dev/da1s1
> <root>#
>
> Seems like this resets itself every now and again to the
> root:operator/640 permissions too, and not just on reboot.
>
> Anyone know what I'm missing?
Well, I've uncovered a little more of this. The devices are created
and destroyed each time the device is connected or disconnected. When
they are created, the default permissions are used, not those I've
configured. If I want my devfs permissions to be available, I have to
restart devfs each time I connect a USB device.
I tried setting a rule to fix this in /etc/devd.conf, but I don't
think it works right. I added the following:
attach 100 {
device-name "da[0-9]*";
action "/etc/rc.d/devfs restart";
};
I was hoping this would simply restart devfs each time I connected a
/dev/da* device, but this didn't work. I then tried changing the
action to an explicit devfs rule command, as follows:
action "devfs rule add path da* mode 660 group cdusers";
but this didn't do any better. Executing this action from the
commandline didn't do what I wanted either, so I obviously have the
syntax wrong. Since the first attempt didn't work, I suspect there
are other errors in the config block that cause the whole thing to be
skipped.
Any pointers would be appreciated.
Lou
--
Louis LeBlanc FreeBSD-at-keyslapper-DOT-net
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
Please send off-list email to: leblanc at keyslapper d.t net
Key fingerprint = C5E7 4762 F071 CE3B ED51 4FB8 AF85 A2FE 80C8 D9A2
Cheops' Law:
Nothing ever gets built on schedule or within budget.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20050706/5f9b5ac0/attachment.bin
More information about the freebsd-questions
mailing list