On 2022-02-16 20:03 +0100, d...@x.org.pl wrote: > Is there an easy method of restoring original file capabilities for the > entire /usr directory? > > The background is I wanted to move my /usr directory to another > partition and I copied it with "cp -ar ..." and deleted the original > content of /usr to find out my ping does not work because of the lack of > the required capabilities for the binary. > That is not too much of an issue, because I can fix the ping command. > However, I am afraid there might be some other binaries lurking to bite > me when I need it least... > > Is there an easy method (like apt based for instance) of restoring file > capabilities for the whole > /usr directory?
Capabilities are currently not stored in Debian packages, but are set up by the postinst scripts. Here is how to find them: $ grep -w -l setcap /var/lib/dpkg/info/*.postinst Reinstall the affected packages (likely there are only a few of them), and you should be fine. Cheers, Sven