[mythtv-users] Is there a way to make a recording"Read-Only" -- "Protect" it from deletion

Tony Lill ajlill at ajlc.waterloo.on.ca
Thu Apr 13 20:32:37 UTC 2006


Bryan Halter <bhalter at ns1.armyofpenguins.com> writes:

> Marco Nelissen wrote:
>>> That won't work. If you have write permissions to the directory, you
>>> can remove any file in it regardless of the file permissions.
>>>     
>>
>> That's why you'd set the "sticky" on that directory. That way only the
>> owner of a file will be able to delete it.
>>
>>   
> You're only mostly right about the no write privs on the file.  Yes if
> you have write privs on the directory you can still unlink the file but
> you need to use the -f option.  I don't know how Myth deletes files so
> it may do the equivalent of this.  An idea would be to change the
> ownership to root:root and mode 644.  See below:
>
> bhalter at excelsior ~ $ ls -l test.mpg
> -r--r--r--  1 bhalter root 9076672 Feb 11 12:31 test.mpg
> bhalter at excelsior ~ $ rm test.mpg
> rm: remove write-protected regular file `test.mpg'? n
> bhalter at excelsior ~ $ rm -f test.mpg
> bhalter at excelsior ~ $

That's rm that's being whiny about removing write protected
files. Mythtv just calls the unlink system call which only cares
about directory permissions.

As far as the sticky bit goes, the mythtv backend created the file, so
it's the owner, and can delete it. Plus, it's probably running as
root....
--
Tony Lill,                         Tony.Lill at AJLC.Waterloo.ON.CA
President, A. J. Lill Consultants        fax/data (519) 650 3571
539 Grand Valley Dr., Cambridge, Ont. N3H 2S2     (519) 241 2461
--------------- http://www.ajlc.waterloo.on.ca/ ----------------
"Welcome to All Things UNIX, where if it's not UNIX, it's CRAP!"


More information about the mythtv-users mailing list