[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cannot get immutable to work

From: Paul Eggert
Subject: Re: Cannot get immutable to work
Date: Sun, 12 Jun 2022 20:38:13 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

On 6/8/22 20:31, mg wrote:
# Note: There is a typo in the online HTML manual; missing f after -c

Thanks for reporting that. I fixed it by installing the attached patch.

mkdir t &&
     cd t &&
     echo foo > bar &&
     sudo chattr +i bar &&
     echo Can make bar immutable &&
     lsattr &&
     # sudo tar cf j.tar --xattrs --xattrs-include=user.* bar &&
     sudo tar --xattrs -cf j.tar bar &&
     mkdir t1 &&
     cd t1 &&
     echo "Cannot restore. Try 4 ways." &&
     sudo tar xf ../j.tar --xattrs --xattrs-include=user.* &&
     lsattr &&
     sudo tar xf ../j.tar --xattrs-include=user.* &&
     lsattr &&
     sudo tar xf ../j.tar --xattrs &&
     lsattr &&
     sudo tar xf ../j.tar &&

I don't have easy access to a file system that supports attributes, so the above is a bit cryptic to me. Perhaps you can help by running this command:

   sudo env LC_ALL=C strace -o /tmp/tar.trace tar xf ../j.tar --xattrs

and seeing which system calls fail in the trace. If it's not too large, please gzip -9 /tmp/tar.trace and email it as an attachment.

As a general comment, I will note that if I do backup (-c) and restore (-x), I 
would expect there would be no differences. Why wouldn't you make that strategy 
the default?

There is an argument for the current default: when you unpack a random tarball from someone you don't know, you don't get files with weird attributes. At this point it might be a bit late to change the default as people are most likely depending on it.

Attachment: 0001-Fix-doc-c-typo.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]