Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Rainer Weikusat Newsgroups: comp.os.linux.development.system Subject: Re: need to block changes to a file Date: Wed, 13 Apr 2011 11:16:31 +0100 Lines: 13 Message-ID: <874o62e9s0.fsf@sapphire.mobileactivedefense.com> References: <32cc0688-fab0-411f-bd2b-261e7eef98b0@l2g2000prg.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net ootNo8hdoRxvNRUr4NEBWQJ2GSRhig8JS+QPQGpNTeRTQ/2PQ= Cancel-Lock: sha1:JEOPlPzmRzmnfCTDAhAE9s8pef4= sha1:TmEmt395+hB+opIKQYsjelEmcjo= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Xref: x330-a1.tempe.blueboxinc.net comp.os.linux.development.system:82 zix writes: > I have a file which I want to block any > changes onto it. How may I accomplish that in kernel space through a > module? lets for example, I have some data in /var/carddetails.txt, > which I dont want any user to not to delete that. He should be able to > read/write, but not delete, move etc. Can anybody suggest me ways to > do in linux? Provided that append-only write access was ok for you and you are using a filesystem which supports this, you could set the 'append only' filesystem attribute for it. The userspace tools for these attributes are lsattr and chattr. Judging from strace output, this is implemtented via ioctl.