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

Alexandre DERUMIER aderumier at odiso.com
Wed Jan 30 08:25:20 CET 2013


>>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)


root at kvmtest1:# touch test
root at kvmtest1:# chmod -w test
root at kvmtest1:# rm test


root at kvmtest1:# chattr +i test
root at kvmtest1:# rm test
root at kvmtest1:#rm: cannot remove `test': Operation not permitted

----- Mail original ----- 

De: "Dietmar Maurer" <dietmar at proxmox.com> 
À: "Alexandre Derumier" <aderumier at odiso.com>, pve-devel at pve.proxmox.com 
Envoyé: Mercredi 30 Janvier 2013 07:12:56 
Objet: RE: [pve-devel] [PATCH 02/48] Plugin : add volume_protect 

> + 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. 



More information about the pve-devel mailing list