[pve-devel] [PATCH 8/8] add setup_blockdev_mounts to pve-mount hook

Alexandre DERUMIER aderumier at odiso.com
Sun Aug 16 08:59:04 CEST 2015


Oh,it's just that storage.cfg is only readable by root and www-data group.

user at kvmtest1:~$ cat /etc/pve/storage.cfg
cat: /etc/pve/storage.cfg: Permission denied

root at kvmtest1 ~ # ls -lah /etc/pve/storage.cfg
-rw-r----- 1 root www-data 163 Aug 14 12:12 /etc/pve/storage.cfg


(cfs_read_file("storage.cfg"), return default values like like when the file don't exist).

I think it should not be a security problem to make the storage.cfg world readable, they are no criticital infos inside.

I can't use chmod in /etc/pve/, seem that it's manage in pmxcfs.c (cfs_fuse_getattr).
Could you make a patch to have storage.cfg with -rw-r--r--, like in /etc/pve/lxc/  ?
 

----- Mail original -----
De: "dietmar" <dietmar at proxmox.com>
À: "aderumier" <aderumier at odiso.com>
Cc: "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Samedi 15 Août 2015 20:18:20
Objet: Re: [pve-devel] [PATCH 8/8] add setup_blockdev_mounts to pve-mount hook

> But I need to find the /dev/... device to expose the device to guest and mount 
> the share 
> So in this case, I need to read storage.cfg, to parse the volid, and find the 
> correct device. 
> 
> But I don't known why,if I read storage.cfg from lxc-pve-mount-hook 
> 
> 

Take a look at how I read the pct config: 

https://git.proxmox.com/?p=pve-container.git;a=blob;f=src/lxc-pve-mount-hook;h=f5f08679b7cd1739feee5b627923fc0c58d0188c;hb=HEAD#l72 

Note: PVE::INotify::nodename() returns wrong value when run inside container 
mount hook. 

Maybe there is a similar permission/env problem with the storage config? 



More information about the pve-devel mailing list