]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] packet driver permission checking fix
authorPeter Osterlund <petero2@telia.com>
Fri, 20 May 2005 20:59:06 +0000 (13:59 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 20 May 2005 22:48:16 +0000 (15:48 -0700)
commit1e103376fd4f67b82fdaae8f0127a1b33d9ed405
tree8c632478e9e5c0b0a2f9601542e54d8f02250cb1
parent54302f54ecb64158846e00e9d03999bbbef55439
[PATCH] packet driver permission checking fix

If you tried to open a packet device first in read-only mode and then a
second time in read-write mode, the second open succeeded even though the
device was not correctly set up for writing.  If you then tried to write
data to the device, the writes would fail with I/O errors.

This patch prevents that problem by making the second open fail with
-EBUSY.

Signed-off-by: Peter Osterlund <petero2@telia.com>
Cc: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/block/pktcdvd.c