[pve-devel] Fwd: Re: applied: [PATCH v2 storage 2/2] fix #2226: allow broken symlinks to be deleted via API

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jun 17 12:26:01 CEST 2019


On 6/17/19 12:18 PM, Stefan Reiter wrote:
> I just tested with '-e', it does not return true for a broken symlink.
> It does however return true for directories, which I'm not sure should be
> deleteable via the API? I think '-f' and '-l' are the better solution here.


unlink does nothing on directories, so that's a non issue.
But yes, you're right the symlink is followed in general:

> With the exception of the -l test they all follow symbolic links because they
> use stat() and not lstat() (so dangling symlinks can't be examined and will
> therefore report failure).
-- https://perldoc.perl.org/functions/-X.html

So yes, lets keep your proposed solution, it's fine here.




More information about the pve-devel mailing list