Windows: don’t require admin/dev-mode for bookmark set
#378
Replies: 14 comments
-
|
Oh, that shouldn’t be… Which Windows version are you on? Could you check whether you have a hidden For me it appears to work with Windows 10. |
Beta Was this translation helpful? Give feedback.
-
|
Thinking out loud (a.k.a. note to self) it could be useful to have a |
Beta Was this translation helpful? Give feedback.
-
I do have the |
Beta Was this translation helpful? Give feedback.
-
|
I added support for the
This is not released yet, though. In case you know how to build a Go project from sources you could try it already, that would help me. Otherwise you can wait for the next release, then we can get more info. (I still cannot reproduce this with Windows 10, unfortunately. The error originates here.) |
Beta Was this translation helpful? Give feedback.
-
Thanks to the infos in the error I circumvented the issue by running I honestly don't understand why an elevated shell is needed to create a symlink. I'm available to further guidance to provide more feedback on the issue. |
Beta Was this translation helpful? Give feedback.
-
|
Terrific, thanks for checking it out with the debug flag! 🙏 Is it possible that you had created a bookmark earlier with elevated permissions? The issue seems to be this: Symlink creation fails on Windows (with that privilege error) in case there is already a symlink at that location present. klog actually removes the symlink before setting it, but it just swallows the error since I just assume that the error means “no such file”. This assumption is not correct, since there might be other causes of failure. This of course must cause subsequent failures, like the one that you reported. (Just for context: bookmarking technically just means creating a symlink to the target file at Long story short: I made the error handling more robust: #68. Since you are apparently all set for compiling locally, could you do me a favour and try again with the |
Beta Was this translation helpful? Give feedback.
-
Impossible, I never used klog, and I was trying it for the first time and I never run a privileged shell if I don't intentionally have to.
TL;DR Seems to me that klog can successfully remove a previously created symlink (regardless of (un)privileged shell) but not create a new one. |
Beta Was this translation helpful? Give feedback.
-
|
Ok, good to know that it’s not the remove step. Thanks for the detailed report! I’m generally a bit shallow on Windows since I don’t use it regularly. I’ve tested the bookmark commands with both an admin account as well as a standard user one and couldn’t reproduce the issue. As far as Go is concerned there are no further options on Just to clarify: by “unprivileged shell” you mean you run the shell with a standard permission user account, or is there another way to configure permissions on Windows? |
Beta Was this translation helpful? Give feedback.
-
|
Or does the target file have different permissions/ownership, and therefore it cannot symlink? (Just thinking out loud here…) |
Beta Was this translation helpful? Give feedback.
-
I mean that that right click cmd.exe in start menu and click on "Run as administrator". My account (which is the only one) has the admin rights.
No clue on why it should have 🤔 |
Beta Was this translation helpful? Give feedback.
-
|
I can reproduce this now, the reason why it works for me is that my Windows VM has Developer mode turned on by default, which has more permissive settings. The root cause is some security mechanism in Windows that doesn’t allow the creation of symlinks for regular users. Generally it seems to me that symlink support on Windows by design is more targeted at developers. Not sure yet what the right move forward is, at least I couldn’t find a way to unblock an application easily (except running as admin, which is certainly not good). |
Beta Was this translation helpful? Give feedback.
-
|
I'm glad you figured it out! It's a bummer this limitation.
Asking for elevated permissions isn't a good choice IMHO, a workaround, albeit anti-pattern, might be to create a configuration file in the Klog could then load the path and "under hood" append it to the -f arg, this way klog doesn't need to create a symlink while still always knowing where the journal is. The major con is that if the file the bookmark will be broken while on the other hand a symlonk will still work (I think, since it points to the inode block level) Just a very quick brainstorming I thought to share. |
Beta Was this translation helpful? Give feedback.
-
|
Yeah agreed, quite an annoyance… For the time being I improved the error message on Windows, so that it tells you that you need admin or dev-mode for the Solving this properly requires quite a bit of work unfortunately, not just to change the current implementation (e.g. to a text file that contains the path), but also to migrate existing bookmarks on the fly on Linux/Mac. I’d like to keep the platform-specific code as small as possible, so if I change the inner workings then I’d change it for all platforms. Thanks for your assistance so far @maxiride |
Beta Was this translation helpful? Give feedback.
-
|
This is fixed through 2c23b48 and will be shipped in the next release. Internally, the bookmarks are stored as JSON file now ( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've added klog to my PATH and tried few commands. I can operate the logs, print them etc but the bookmark feature did not work. I'd love to provide further details but the error received is just that plain.
Beta Was this translation helpful? Give feedback.
All reactions