[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Write protect access on USB port

On Lu, 26 nov 12, 21:47:36, Amit wrote:
> Yes the above would work in most cases but in the case I am dealing
> with, the filesystem is not mounted yet. For example, I plug in a USB
> drive.  Before it is mounted, there is a /dev/sd[x] node. I can open
> this node and write anything I want, thereby corrupting the filesystem
> on that device.

Not unless you are 'root' or member of group 'floppy':

$ ls -l /dev/sdb1
brw-rw---T 1 root floppy 8, 17 nov 27 00:14 /dev/sdb1

You could just tweak the relevant udev rule to create the device nodes 
as root:root or root:disk (like hard drives), since root would be able 
to circumvent any protection and 'disk' is almost the same as 'root'.

Kind regards,
Offtopic discussions among Debian users and developers:

Attachment: signature.asc
Description: Digital signature

Reply to: