[clug] /dev/port
Martijn van Oosterhout
kleptog at svana.org
Mon May 30 12:33:29 GMT 2005
On Mon, May 30, 2005 at 09:13:32PM +1000, Adrian Blake wrote:
> Using strace :
>
> open("/dev/port", O_RDWR) = -1 EPERM (Operation not permitted)
>
>
> and for the exercise here are the permissions:
>
> [adrian at mensa reva]$ ls -l /dev/port
> crw-rw-rw- 1 root root 1, 4 Jan 1 1970 /dev/port
Well, that would be caused by the following (Linux 2.4.27):
drivers/char/mem.c:
static int open_port(struct inode * inode, struct file * filp)
{
return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
}
I guess it was decided that handing out raw access to io ports is so
risky that it's only allowed for root, even if you give global wirte
access to /dev/port. In other words /dev/port is a way of accessing IO
ports from user space, but it doesn't override the protections in
place. You'll still need ioperm or root I guess...
Hope this helps,
--
Martijn van Oosterhout <kleptog at svana.org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux/attachments/20050530/ce3a5f83/attachment.bin
More information about the linux
mailing list