[Python-ideas] Implement POSIX ln via shutil.link and shutil.symlink

Barry barry at barrys-emacs.org
Wed May 29 17:22:31 EDT 2019



> On 29 May 2019, at 16:48, Steven D'Aprano <steve at pearwood.info> wrote:
> 
>> On Wed, May 29, 2019 at 10:07:38PM +0700, Tom Hale wrote:
>> They say silence is golden... But I'm still looking for some feedback on 
>> the below.
> 
> I think the first thing you need to do is respond to Serhiy's objection:
> 
>    Sorry, but I do not understand what problem do you try to solve. If
>    somebody can create a file named link_name between unlink and 
>    symlink, he can also remove and create a file named link_name after 
>    symlink.
> 
> If Serhiy is correct, that completely undermines the primary motive for 
> adding this functionality.

Serhiy, I think, is conflating two things.
1. How to write software robust aginst attack.
2. How to replace a symlink atomically.

The only reason 1 is a problem is that the application is not in control of its file space which I would suggest means you already lost.

I think the OP wants a soution to 2, which as I suggest can leverage the design work in the implementation of the GNU ln -sf command in python.

Barry



> 
> 
> -- 
> Steven
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
> 



More information about the Python-ideas mailing list