On Mon 07 Nov 2016 at 21:07:45 +0100, Pascal Hambourg wrote:

> Le 07/11/2016 à 15:18, Richard Owlett a écrit :
> >>>
> >>>   tomas@rasputin:~$ ls -al /dev/sd*
> >>>   brw-rw---- 1 root disk 8, 0 Nov  7 09:06 /dev/sda
> >>>   brw-rw---- 1 root disk 8, 1 Nov  7 09:06 /dev/sda1
> >>>   brw-rw---- 1 root disk 8, 2 Nov  7 09:06 /dev/sda2
> >>>   brw-rw---- 1 root disk 8, 5 Nov  7 09:06 /dev/sda5
> >>>
> >>>So you'd have to be associated to the "disk" group to read those
> >>>things and you'd have to *be* root to write.
> >
> >Evidently not a solution. Added myself to both "disk" and "root" groups.
> >Had no effect when attempting to run either lsblk or parted.
> 
> Did you start a new session after adding yourself to the group ?
> New groups are only taken into account when opening a session.
> FWIW, adding myself to the "disk" group and starting a new session worked
> with lsblk -f. Didn't try parted.

Is the suggestion to give a user raw access to disks a serious one?

> >Off-list it was suggested I try /sbin/blkid /dev/sda. Although the man
> >page has a caution when not used as root, it seems to currently work on
> >my immediately available Debian machine.
> 
> Indeed blkid uses a cache file which is readable by everyone and is updated
> by udev.

A very useful observation. When blkid is run as root it creates the file
/run/blkid/blkid.tab. A user running blkid only gets to see the contents
of blkid.tab. There is no change to blkid.tab unless the command is run
by root again. This makes /sbin/blkid useless as a user command for the
purposes discussed in this thread.

-- 
Brian. 

Reply via email to