[usb2] new usb stack and suser in CURRENT
Olivier Smedts
olivier at gid0.org
Fri Sep 19 15:34:38 UTC 2008
On Fri, Sep 19, 2008 at 04:53:22PM +0200, Olivier Smedts wrote:
> Since the suser interface has been removed from HEAD
> (http://www.freebsd.org/cgi/getmsg.cgi?fetch=284102+0+current/cvs-src)
> I use the following patch to use the new usb2 stack with
> latest CURRENT. Of course, PRIV_ROOT is not the right one to use,
> see include/sys/priv.h.
Attachment seems to have been removed. Retrying with a different content-type
and disposition (mutt is so great).
--
Olivier Smedts _
ASCII ribbon campaign ( )
e-mail: olivier at gid0.org - against HTML email & vCards X
www: http://www.gid0.org - against proprietary attachments / \
"Il y a seulement 10 sortes de gens dans le monde :
ceux qui comprennent le binaire,
et ceux qui ne le comprennent pas."
-------------- next part --------------
Index: i4b/src/sys/dev/usb2/core/usb2_dev.c
===================================================================
--- i4b/src/sys/dev/usb2/core/usb2_dev.c (r?vision 880)
+++ i4b/src/sys/dev/usb2/core/usb2_dev.c (copie de travail)
@@ -262,7 +262,7 @@
int error;
/* only super-user can set permissions */
- error = suser(curthread);
+ error = priv_check(curthread, PRIV_ROOT);
if (error) {
return (error);
}
Index: i4b/src/sys/dev/usb2/core/usb2_generic.c
===================================================================
--- i4b/src/sys/dev/usb2/core/usb2_generic.c (r?vision 880)
+++ i4b/src/sys/dev/usb2/core/usb2_generic.c (copie de travail)
@@ -878,7 +878,7 @@
(req->bRequest == UR_SET_CONFIG)) ||
((req->bmRequestType == UT_WRITE_INTERFACE) &&
(req->bRequest == UR_SET_INTERFACE))) {
- if (suser(curthread)) {
+ if (priv_check(curthread, PRIV_ROOT)) {
return (EPERM);
}
}
@@ -887,7 +887,7 @@
* not update the data toggle value in "struct usb2_pipe" !
*/
if (req->bmRequestType == UT_WRITE_ENDPOINT) {
- if (suser(curthread)) {
+ if (priv_check(curthread, PRIV_ROOT)) {
return (EPERM);
}
}
@@ -946,7 +946,7 @@
/* control endpoint only */
return (EINVAL);
}
- if (suser(curthread)) {
+ if (priv_check(curthread, PRIV_ROOT)) {
return (EPERM);
}
mtx_lock(f->priv_mtx);
@@ -1738,7 +1738,7 @@
(udev->parent_hub == NULL)) {
return (EINVAL);
}
- if (suser(curthread)) {
+ if (priv_check(curthread, PRIV_ROOT)) {
return (EPERM);
}
switch (mode) {
@@ -1805,7 +1805,7 @@
struct usb2_hub *hub;
int err;
- if (suser(curthread)) {
+ if (priv_check(curthread, PRIV_ROOT)) {
return (EPERM);
}
if (port_no == 0) {
@@ -2115,7 +2115,7 @@
case USB_IFACE_DRIVER_DETACH:
/* TODO */
- if (suser(curthread))
+ if (priv_check(curthread, PRIV_ROOT))
error = EPERM;
else
error = EINVAL;
More information about the freebsd-usb
mailing list