Re: [pve-devel] [PATCH 02/48] Plugin : add volume_protect

2013-01-30 Thread Michael Rasmussen
On Wed, 30 Jan 2013 06:12:56 + Dietmar Maurer wrote: > > What is the advantage of 'chattr +i'? I usually use 'chmod -w' to > set a file read only. > chattr +i also prevents creating hard-links to the file which a read-only file does not guaranty against. A hard-link would effectively preven

Re: [pve-devel] [PATCH 02/48] Plugin : add volume_protect

2013-01-29 Thread Dietmar Maurer
> It's posix as far as i remember. OK, thanks. ___ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Re: [pve-devel] [PATCH 02/48] Plugin : add volume_protect

2013-01-29 Thread Stefan Priebe - Profihost AG
It's posix as far as i remember. Am 30.01.2013 um 08:30 schrieb Dietmar Maurer : What is the advantage of 'chattr +i'? I usually use 'chmod -w' to set a file read only. >> >> root can't delete/change the file with chattr +i. (and qemu,pvedaemon runs >> as root) > > But this is file sy

Re: [pve-devel] [PATCH 02/48] Plugin : add volume_protect

2013-01-29 Thread Dietmar Maurer
> >>What is the advantage of 'chattr +i'? I usually use 'chmod -w' to set > >>a file read only. > > root can't delete/change the file with chattr +i. (and qemu,pvedaemon runs > as root) But this is file system related? ___ pve-devel mailing list pve-dev

Re: [pve-devel] [PATCH 02/48] Plugin : add volume_protect

2013-01-29 Thread Alexandre DERUMIER
test root@kvmtest1:# chattr +i test root@kvmtest1:# rm test root@kvmtest1:#rm: cannot remove `test': Operation not permitted - Mail original - De: "Dietmar Maurer" À: "Alexandre Derumier" , pve-devel@pve.proxmox.com Envoyé: Mercredi 30 Janvier 2013 07:12:56 Ob

Re: [pve-devel] [PATCH 02/48] Plugin : add volume_protect

2013-01-29 Thread Dietmar Maurer
> +my $cmd = ['/usr/bin/chattr', $action, $path]; > +run_command($cmd); What is the advantage of 'chattr +i'? I usually use 'chmod -w' to set a file read only. ___ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/m

[pve-devel] [PATCH 02/48] Plugin : add volume_protect

2013-01-29 Thread Alexandre Derumier
(and also fix backing file regex parsing) for files, we protect the volume file with chattr. So we can only read it, but can't delete or move it. Signed-off-by: Alexandre Derumier --- PVE/Storage/Plugin.pm | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --gi