Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 07 Nov 2004 12:58:14 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        rodrigc@crodrigues.org
Cc:        freebsd-usb@freebsd.org
Subject:   Re: Changing permissions of /dev/usb[n] to 664?
Message-ID:  <20041107.125814.34760598.imp@bsdimp.com>
In-Reply-To: <20041107064227.GA79915@crodrigues.org>
References:  <20041107064227.GA79915@crodrigues.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20041107064227.GA79915@crodrigues.org>
            Craig Rodrigues <rodrigc@crodrigues.org> writes:
: Hi,
: 
: Is there any particular reason to leave the
: permissions of /dev/usb[n] at 660 instead of 664?
: 
: That would allow non-root users to run usbdevs
: to list the USB devices on the system.
: 
: 
: --- usb.c.orig	Sun Nov  7 01:41:43 2004
: +++ usb.c	Sun Nov  7 01:41:56 2004
: @@ -320,11 +320,11 @@
:  	/* The per controller devices (used for usb_discover) */
:  	/* XXX This is redundant now, but old usbd's will want it */
:  	sc->sc_usbdev = make_dev(&usb_cdevsw, device_get_unit(self), UID_ROOT,
: -	    GID_OPERATOR, 0660, "usb%d", device_get_unit(self));
: +	    GID_OPERATOR, 0664, "usb%d", device_get_unit(self));
:  	if (usb_ndevs++ == 0) {
:  		/* The device spitting out events */
:  		usb_dev = make_dev(&usb_cdevsw, USB_DEV_MINOR, UID_ROOT,
: -		    GID_OPERATOR, 0660, "usb");
: +		    GID_OPERATOR, 0664, "usb");
:  	}
:  #endif

This looks good, but we should audit all the ioctls to make sure the
ones that modify anything have the proper checks to make sure the fd
was opened for write.

Warner




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