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

[Improved user experience] avoid redundant permission requests #583

Open
Vixb1122 opened this issue Nov 16, 2020 · 8 comments
Open

[Improved user experience] avoid redundant permission requests #583

Vixb1122 opened this issue Nov 16, 2020 · 8 comments
Labels
consider for rt Pinned for use in the rt project enhancement request

Comments

@Vixb1122
Copy link

Vixb1122 commented Nov 16, 2020

Because restricted user can execute some command to create symbolic link without permission elevated.
For example: "C:\A_folder"->"C:\B_folder", create symbolic links by the following logic:

  1. run cmd /c rmdir "C:\A_folder" to delete symbolic link
  2. if "C:\A_folder" exists, elevate permission and rerun step 1
  3. if "C:\A_folder" exists, throw error
  4. run cmd /c mklink /j "C:\A_folder" "C:\B_folder" to create symbolic link
  5. if "C:\A_folder" not exists, elevate permission and rerun step 4
  6. if "C:\A_folder" not exists, throw error
@coreybutler
Copy link
Owner

Step 4 is using a junction, which may not work in all environments, but the overall concept of a retry upon failure due to permissions seems like a useful enhancement. It would be nice to reduce/eliminate permission prompts.

@Vixb1122
Copy link
Author

@coreybutler
Yes, execute the command first, and if it fails, elevate permission and execute the command again.

@Vixb1122
Copy link
Author

Vixb1122 commented Nov 16, 2020

@coreybutler mklink /j can create symbolic link without admin permission, but 'mklink /d' need admin permission.
if you create symbolic link with absolute path, mklink /j is no problem.

@coreybutler
Copy link
Owner

@Vixb1122 - yes, I know what the junction does, but this can cause problems in some Windows environments, especially those where the junction is made with a directory on another system (NAS/SAN/mapped drive). This is relatively common in corporate environments where the user's home directory is part of a floating Windows profile or is mapped to a different storage system. I've considered making /j an option that can be configured in the settings. There are several old issues referring to this.

@Vixb1122
Copy link
Author

Vixb1122 commented Nov 16, 2020

@Vixb1122 - yes, I know what the junction does, but this can cause problems in some Windows environments, especially those where the junction is made with a directory on another system (NAS/SAN/mapped drive). This is relatively common in corporate environments where the user's home directory is part of a floating Windows profile or is mapped to a different storage system. I've considered making /j an option that can be configured in the settings. There are several old issues referring to this.

Well, your answer is very helpful for me.

@Vixb1122
Copy link
Author

I've considered making /j an option that can be configured in the settings. There are several old issues referring to this.

make '/j' an default option is useful to reduce permission prompts.

@vieruuuu
Copy link

any progress on this?

@coreybutler
Copy link
Owner

@vieruuuu - this won't be coming to NVM4W due to the feature freeze, but it should be part of Runtime (which will replace NVM4W when we're done with it).

@coreybutler coreybutler added the consider for rt Pinned for use in the rt project label Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consider for rt Pinned for use in the rt project enhancement request
Projects
None yet
Development

No branches or pull requests

4 participants
@coreybutler @Vixb1122 @vieruuuu and others