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

Use SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE for symlinking on Windows #83

Closed
YellPika opened this issue May 22, 2018 · 7 comments
Closed
Assignees
Labels
type: a-feature-request This is a request for a new feature.

Comments

@YellPika
Copy link

Windows 10 added support for creating symbolic links without administrator privileges when the system is in developer mode, but CreateSymbolicLink will still fail unless SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE is passed as a flag.

directory doesn't seem to expose this functionality. Does it make sense to make it the default?

@Rufflewind
Copy link
Member

Do you know what happens if SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE is passed to a Windows system that doesn't support it? It would be nice to have it by default, but I'm concerned about compatibility with older versions of Windows.

@YellPika
Copy link
Author

This thread claims that passing the flag on earlier builds of will give ERROR_INVALID_PARAMETER. This could be solved by checking at runtime for Windows 10 build >= 14972.

@Rufflewind
Copy link
Member

I'll just check for the error code instead of the build number (which might be difficult on older versions of Windows).

@YellPika
Copy link
Author

Thanks!

Could you elaborate on why there would be difficulties on earlier versions of Windows? If we're on anything before Windows 10 then we shouldn't even need to check the build number since this feature doesn't exist.

(Also, your last commit doesn't work for me. Did you mean to pass flags .|. unpriv to c_CreateSymbolicLink?)

Rufflewind added a commit to Rufflewind/directory that referenced this issue May 25, 2018
@Rufflewind
Copy link
Member

Did you mean to pass flags .|. unpriv to c_CreateSymbolicLink?

Yes, my bad. Please try 76e4c21 when you get the chance.

If we're on anything before Windows 10 then we shouldn't even need to check the build number since this feature doesn't exist.

It's just a bit more involved to implement (and might involve more #ifs).

@YellPika
Copy link
Author

For some reason I can't pull that changeset. If I click on the link, I can browse the changes, but it's otherwise inaccessible.

In any case, I've applied the patch manually and can confirm that it works.

@Rufflewind
Copy link
Member

For some reason I can't pull that changeset.

It was still in my fork at the time: https://github.com/Rufflewind/directory

In any case, I've applied the patch manually and can confirm that it works.

Yay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: a-feature-request This is a request for a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants