linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: Accessing usb devices with USBDEVFS
Date: Mon, 01 May 2006 19:09:19 +0000	[thread overview]
Message-ID: <20060501190919.GC8038@vrfy.org> (raw)
In-Reply-To: <44525468.5030106@ist-traffic.com>

On Mon, May 01, 2006 at 03:00:17PM -0400, Danny Budik wrote:
> 
> >>So is there a way then to read from the /dev/bus/usb? Like I  
> >>mentioned
> >>in the parent post, I am just using fopen, and the functions  
> >>provided in
> >>usbdevice_fs.h and usb.h to read data from the usb device. The  
> >>device is
> >>a proprietary sensor that my company makes. Is there a
> >>manual/documentation about how to do this the more "modern" way?
> >
> >No, that's still the correct way.  If you use libusb, none of your  
> >code
> >changes at all.   If you are using "raw" usbfs, then just open a
> >different file.
> >
> >Hope this helps,
> >
> >greg k-h
> >
> So that brings me to my next question. I guess I didn't know that  
> libusb existed and wrote my own interface functions. Is it because of  
> this that whenever I access the USB device, I must be root? Obviously  
> that's a security issue. In other words, can I read/write to my USB  
> device as a user using libusb?

That has nothing to do with the way you access the device it's not
different for libusb or a simple open(). The usual way is to change
the owner/group of the device node or add an user ACL to the
node when it appears and grant access that way to normal users.
There are several solutions out there like pam_console, resmgr, or just
putting the users in a special group.

Kay


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

  parent reply	other threads:[~2006-05-01 19:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-28 17:44 Accessing usb devices with USBDEVFS Danny Budik
2006-04-28 21:14 ` Greg KH
2006-04-29 13:06 ` Kay Sievers
2006-05-01 15:39 ` Danny Budik
2006-05-01 16:57 ` Greg KH
2006-05-01 19:00 ` Danny Budik
2006-05-01 19:06 ` Greg KH
2006-05-01 19:09 ` Kay Sievers [this message]
2006-05-05 20:45 ` Danny Budik
2006-05-05 21:02 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060501190919.GC8038@vrfy.org \
    --to=kay.sievers@vrfy.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).