ACEs of a file in user's home directory will be lost using vim or cp


Access Control Entries (ACEs) of a file in the user's home directory will be lost if the file is modified using vim.  In addition, the newly created file using the cp command won't keep the ACEs of the original file. There are two workarounds:

1. Set the file to inherit the ACEs from the parent folder

2. Use the following commands to preserve its ACEs, where file.txt is the file with ACEs:

vim "+set backupcopy=yes" file.txt
cp --preserve=all file.txt file-new.txt