Para criar o link físico alice
precisará de write+execute
permissões em target-dir
em todos os casos. As permissões necessárias em target.txt
variam:
- Se
fs.protected_hardlinks = 1
, em seguida,alice
precisar da propriedade detarget.txt
ou pelo menosread+write
de permissões. - Se
fs.protected_hardlinks = 0
, qualquer conjunto de permissões será suficiente; Mesmo 000 está bem.
Esta resposta a uma pergunta semelhante teve a informação que faltava para responder a essa pergunta.
De link [ênfase minha]:
Hardlinks:
On systems that have user-writable directories on the same partition as system files, a long-standing class of security issues is the hardlink-based time-of-check-time-of-use race, most commonly seen in world-writable directories like /tmp. The common method of exploitation of this flaw is to cross privilege boundaries when following a given hardlink (i.e. a root process follows a hardlink created by another user). Additionally, an issue exists where users can "pin" a potentially vulnerable setuid/setgid file so that an administrator will not actually upgrade a system fully.
The solution is to permit hardlinks to only be created when the user is already the existing file's owner, or if they already have read/write access to the existing file.