dimo414 / bkt

a subprocess caching utility, available as a command line binary and a Rust library.
https://www.bkt.rs
MIT License
241 stars 13 forks source link

Symlinks on Windows require privilege escalation #3

Open dimo414 opened 2 years ago

dimo414 commented 2 years ago

On Windows bkt fails with this error:

> /bkt.exe -- ipconfig
bkt: Cache write failed: A required privilege is not held by the client. (os error 1314)

This comes from the call to std::os::windows::fs::symlink_file which actually doesn't work in most cases. Specifically, Windows treats symlink creation as a privileged action and there aren't a lot of good ways around it.

Rather than making users jump through these hoops, it might be easiest to just manually reimplement "symlinks" as vanilla text files, so the key file would simply contain the path to the data file and lookup() would read that file to find where the data is stored.