hal: remove block.block_size

David Zeuthen david at fubar.dk
Sun Mar 28 20:44:32 EEST 2004


On Sun, 2004-03-28 at 00:23, Robert Love wrote:
> Hi, David.
> 
> There is a FIXME associated with block.block_size:
> 
> 	"is a block always 512 bytes?? Must check kernel source"
> 
> Indeed, the block size is not always 512 bytes.  It can vary.
> 
> Unfortunately, the only way to get the block size is to open() the
> device, which is hopefully something only root can do.  Therefore, I
> suggest that we just remove this property altogether.  It is not a very
> useful property, anyhow.
> 

You're right - it's not very useful.

> The following patch removes it.  Simple enough.
> 

I've simply commented out code for setting block.[block_size,start,size]
properties since the two latter is quite useless without the former.

> If you want to do that, let me know and I will cook up a patch.  But
> neither requiring root nor touching hard drives seems HAL-like.
> 

Well, basically we use the device files a lot for e.g. stuff like
capabilities on optical drives - we also need it to poll removable
drives for media since the kernel won't do it for us (the thread on
linux-hotplug a few months back).

Therefore, we really need to have read permission to the device file and
that's why hald runs as root per default (there is some code for running
as a dedicated user but I believe this is commented out atm). Now,
setting and maintaining these permissions involves policy decisions and
is thus distribution specific and thus outside the scope of hal. 

However, it should be perfectly possible to run hald as non-root if only
the device files are accessible by the user that runs hald.

Cheers,
David





More information about the xdg mailing list