cant delete file as root?

Mathias Menzel-Nielsen matze at matzsoft.de
Wed May 17 17:13:18 PDT 2006


Pietro Cerutti wrote:
> On 5/18/06, Mathias Menzel-Nielsen <matze at matzsoft.de> wrote:
>> Hi
>
> Hello,
>
>>
>> Could someone explain me whats going on here?
>
> Who can say...
>
>>
>> 8<--8<
>> hyperkobold# rm -f /lib/libpthread.so.2
>> rm: /lib/libpthread.so.2: Operation not permitted
>>
>> hyperkobold# ls -lah /lib/libpthread.so.2
>> -r--r--r--  1 root  wheel   159K  1 Mai 23:53 /lib/libpthread.so.2
>>
>> hyperkobold# chmod u+rw /lib/libpthread.so.2
>> chmod: /lib/libpthread.so.2: Operation not permitted
>>
>> hyperkobold# stat /lib/libpthread.so.2
>> 103 1012779 -r--r--r-- 1 root wheel 4050520 162688 "May 18 01:36:33
>> 2006" "May  1 23:53:56 2006" "May  1 23:53:56 2006" "May  1 23:53:56
>> 2006" 4096 320 0x20000 /lib/libpthread.so.2
>> 8<--8<
>
> Try:
>
> # chflags nouchg /lib/libpthread.so.2
> # rm /lib/libpthread.so.2
>
> or post the output of
> $ ls -lo /lib/libpthread.so.2
>
>
Wow. immutable flags. cool! :)
chflags noschg /lib/libpthread.so.2  does the trick...

thanks a lot!


More information about the freebsd-questions mailing list