Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Aug 2002 12:50:39 -0600
From:      "Kenneth D. Merry" <ken@kdm.org>
To:        =?iso-8859-1?Q?Jean-fran=E7ois_Dalbosco?= <jdalbosc@enserg.fr>
Cc:        freebsd-scsi@FreeBSD.ORG
Subject:   Re: Userland driver?
Message-ID:  <20020822125039.A9715@panzer.kdm.org>
In-Reply-To: <20020822102423.A8968@panzer.kdm.org>; from ken@kdm.org on Thu, Aug 22, 2002 at 10:24:23AM -0600
References:  <200208221210.g7MCAcIl010562@enserg.enserg.fr> <20020822102423.A8968@panzer.kdm.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Aug 22, 2002 at 10:24:23 -0600, Kenneth D. Merry wrote:
> On Thu, Aug 22, 2002 at 14:10:38 +0200, Jean-françois Dalbosco wrote:
> > hi,
> > 
> > i have written a piece of program that allow me to communicate
> > with a scsi device. To do that i just fill CAM ccb that i send to the
> > device using the passthrough driver. The problem is that i have to
> > be ROOT for that.
> > 
> > Could anyone tell me what to do to write now a program that would allow
> > any user to communicate with this device?
> 
> You've got two choices:
> 
>  - make your program setuid root (which can potentially cause other
>    security problems)
> or
>  - chmod 666 /dev/passN
> 
> The latter would probably be preferrable.  If the SCSI peripherals move
> around in the system, you might want to hardwire that particular pass
> device to the device in question.

I forgot, if you're doing any kind of device lookup (most of the cam_open_*
routines, with the exception of cam_open_pass(), do a lookup), you'll also
need to have the xpt device, /dev/xpt0, world accessible.

(Thanks to Scott Long for pointing that out.)

Opening the xpt device has additional security implications -- you can
reset and rescan busses and turn on debugging via the xpt device.

Ken
-- 
Kenneth Merry
ken@kdm.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




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