From owner-freebsd-scsi Thu Aug 22 11:50:47 2002 Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BFCE637B400 for ; Thu, 22 Aug 2002 11:50:44 -0700 (PDT) Received: from panzer.kdm.org (panzer.kdm.org [216.160.178.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id CEAF243E72 for ; Thu, 22 Aug 2002 11:50:43 -0700 (PDT) (envelope-from ken@panzer.kdm.org) Received: from panzer.kdm.org (localhost [127.0.0.1]) by panzer.kdm.org (8.12.5/8.12.5) with ESMTP id g7MIodKD009773; Thu, 22 Aug 2002 12:50:39 -0600 (MDT) (envelope-from ken@panzer.kdm.org) Received: (from ken@localhost) by panzer.kdm.org (8.12.5/8.12.5/Submit) id g7MIodjZ009772; Thu, 22 Aug 2002 12:50:39 -0600 (MDT) (envelope-from ken) Date: Thu, 22 Aug 2002 12:50:39 -0600 From: "Kenneth D. Merry" To: =?iso-8859-1?Q?Jean-fran=E7ois_Dalbosco?= Cc: freebsd-scsi@FreeBSD.ORG Subject: Re: Userland driver? Message-ID: <20020822125039.A9715@panzer.kdm.org> References: <200208221210.g7MCAcIl010562@enserg.enserg.fr> <20020822102423.A8968@panzer.kdm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020822102423.A8968@panzer.kdm.org>; from ken@kdm.org on Thu, Aug 22, 2002 at 10:24:23AM -0600 Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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