dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.2k stars 9.93k forks source link

See if FileAttributes.ReparsePoint can allow for symbolic link checks #5987

Open jkotalik opened 8 years ago

jkotalik commented 8 years ago

See title. Nate had this idea and I wanted to formally document it.

natemcmaster commented 7 years ago

In checking file system attributes, Apache mod_rewrite supports checking if a file is a symbolic link. We might be able to imitate this behavior by checking if a file has the FileAttributes.ReparsePoint attribute set, but we need to verify the semantics are correct. e.g. when is ReparsePoint true? soft/hard links? junctions? etc.

Here's the TODO in code: https://github.com/aspnet/BasicMiddleware/blob/ead052324c911604a18a64594672613cca211115/src/Microsoft.AspNetCore.Rewrite/Internal/ApacheModRewrite/RuleBuilder.cs#L134-L137

Apache RewriteCond: http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritecond

natemcmaster commented 7 years ago

More context: https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/