When I modify a file, the file capabilities I had set earlier are lost. Is this the expected behavior?
I first set a file capability:
$ setcap CAP_NET_RAW+ep ./test.txt $ getcap ./test.txt ./test.txt = cap_net_raw+ep
As expected I found the file capability is set.
Then I modify the file.
$ echo hello >> ./test.txt
Now when I check the file capabilities, no capabilities are found.
$ getcap ./test.txt