Skip to content
This repository has been archived by the owner on Feb 12, 2019. It is now read-only.

Symbolic link from outside KBFS to KBFS doesn't work with PowerShell "New-Item" cmdlet #1472

Open
lediur opened this issue Jan 30, 2018 · 3 comments

Comments

@lediur
Copy link

lediur commented Jan 30, 2018

Operating system: Windows 10 Insider (build 17083)

I'm attempting to create a symbolic link using PowerShell using the idiomatic way recently introduced in PowerShell:

New-Item -ItemType SymbolicLink -Name myfile -Target K:\private\derrickliu\myfile

This fails with an error:

ni : Cannot find drive. A drive with the name 'K' does not exist.
At line:1 char:1
+ ni -itemtype symboliclink -name myfile -target K:\PRIVATE\derrick ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (K:String) [New-Item], DriveNotFoundException
    + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.NewItemCommand

(ni was the alias I used in practice)

Thinking it might be related to the issue at keybase/keybase-issues#2248, I also tried the path K:\PRIVATE\derrickliu\myfile, with the same error result.

Using mklink via the classic cmd command prompt creates symbolic links just fine, so that was the workaround I used, but it would be nice to see PowerShell support.

@lediur
Copy link
Author

lediur commented Jan 30, 2018

I just discovered that the K:\ filesystem isn't visible to the shell when running as admin, since I just tried cding to it and got the same error. I can see the K:\ filesystem just fine in the non-admin shell. That's probably the cause of the issue, but I can't create symlinks using PowerShell from non-admin shells :(

@strib
Copy link
Contributor

strib commented Jan 30, 2018

cc: @zanderz @taruti

@taruti
Copy link
Contributor

taruti commented Feb 1, 2018

@ledur, we disable access for other accounts than the one running kbfsdokan.

Creating symbolic links from cmd.exe works as you have discovered.

Pondering on what would be the best way to fix this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants