Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support unprivileged symlink creation in Windows #38921

Merged

Commits on Jan 9, 2017

  1. Support unprivileged symlink creation in Windows

    Symlink creation on Windows has in the past basically required admin;
    it’s being opened up a bit in the Creators Update, so that at least
    people who have put their computers into Developer Mode will be able to
    create symlinks without special privileges. (Microsoft are being
    cautious about it all; the Developer Mode requirement makes it so that
    it this won’t be as helpful as I’d like, but it’s still an improvement
    over requiring admin.)
    
    Because of compatibility concerns, they’ve hidden this new functionality
    behind a new flag in the CreateSymbolicLink dwFlags:
    SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE. So we add this flag in
    order to join the party.
    
    Older Windows doesn’t like this new flag, though, so if we encounter
    ERROR_INVALID_PARAMETER we try again without the new flag.
    
    Sources:
    
    - https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/
      is the official announcement (search for CreateSymbolicLink)
    
    - https://news.ycombinator.com/item?id=13096354 on why the new flag.
    
    - https://twitter.com/richturn_ms/status/818167548269051905 confirming
      that Developer Mode will still be required.
    chris-morgan committed Jan 9, 2017
    Configuration menu
    Copy the full SHA
    02ae1e1 View commit details
    Browse the repository at this point in the history