Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 May 2007 20:52:42 +0200
From:      Roland Smith <rsmith@xs4all.nl>
To:        Jim Stapleton <stapleton.41@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: /etc/devfs.conf not working properly
Message-ID:  <20070515185242.GA59938@slackbox.xs4all.nl>
In-Reply-To: <80f4f2b20705151053n8c87790td21ab8fb8a3f4b24@mail.gmail.com>
References:  <80f4f2b20705151053n8c87790td21ab8fb8a3f4b24@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--sdtB3X0nJg68CQEu
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, May 15, 2007 at 01:53:47PM -0400, Jim Stapleton wrote:
>  I have my /etc/devfs.conf file set to make some of my files
>  mountable/readable directly for normal users (specifically CD/DVD
>  devices). However, the original permissions are being retained. Am I
>  doing something wrong in the setup? (I have rebooted the machine since
>  these entries were created)
>  devfs.conf:
>  =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>  link    acd0    cdrom
>  link    acd0    dvd
>=20
>  link    acd0    dvd0
>  link    acd1    dvd1
>=20
>  link    acd0    cdrom0
>  link    acd1    cdrom1
>=20
>  own     acd0    root:operator
>  own     acd1    root:operator
>  own     dvd     root:operator
>  own     cdrom   root:operator
>  own     dvd0    root:operator
>  own     dvd1    root:operator
>  own     cdrom0  root:operator
>  own     cdrom1  root:operator
>=20
>  perm    acd0    0770
>  perm    acd1    0770
>  perm    dvd     0770
>  perm    cdrom   0770
>  perm    dvd0    0770
>  perm    dvd1    0770
>  perm    cdrom0  0770
>  perm    cdrom0  0770
<snip>
>  the majority of the relevant files look like this:
>  =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>  sjss@elrond 13:51:03 (0) /etc  > ls -l /dev | grep cd
>  crwxrwx---  1 root  operator    0,  89 May 10 05:31 acd0
>  crwxrwx---  1 root  operator    0,  90 May 10 05:31 acd1
>  lrwxr-xr-x  1 root  wheel            4 May 10 05:32 cdrom -> acd0
>  lrwxr-xr-x  1 root  wheel            4 May 10 05:32 cdrom0 -> acd0
>  lrwxr-xr-x  1 root  wheel            4 May 10 05:32 cdrom1 -> acd1
>  lrwxr-xr-x  1 root  wheel            4 May 10 05:32 dvd -> acd0
>  lrwxr-xr-x  1 root  wheel            4 May 10 05:32 dvd0 -> acd0
>  lrwxr-xr-x  1 root  wheel            4 May 10 05:32 dvd1 -> acd1
>  =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>=20
>=20
>  Their permssions are not correct at all, except for acd0/acd1. Any
>  suggestions on what would cause this one?

You cannot set permissions on symbolic links. Check out the relevant code in
/etc/rc.d/devfs:=20

                        p*)     for device in ${devicelist}; do
                                        if [ -c ${device} ]; then
                                                chmod ${parameter} ${device}
                                        fi
                                done
                                ;;

Without the '-h' argument to chmod, it changes the permissions
on the device, not on the link! Changing permissions on a symbolic link
doesn't seem to accomplish anything, btw. If I create a link to a
regular file and chmod it to 000, I can still read/write the linked file.

If you want all users to have access to the cdrom, use this:

own     cd0     root:cdrom
perm    cd0     0666

A bit less open would be:

own     cd0     root:cdrom
perm    cd0     0660

which restricts access to the cdrom to members of the cdrom group.
AFAIK, you don't need to set execute bits on devices.

Roland
--=20
R.F.Smith                                   http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914  B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)

--sdtB3X0nJg68CQEu
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.3 (FreeBSD)

iD8DBQFGSgF6EnfvsMMhpyURAlY6AKCaXtgs9CaJW1PcaxKwmRyT6aEUTQCfQYLj
pAPLk5ManoMlAFP2ueFTDWE=
=J7/m
-----END PGP SIGNATURE-----

--sdtB3X0nJg68CQEu--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070515185242.GA59938>