KSP-ModularManagement / KSPe

Extensions and utilities for Kerbal Space Program
http://ksp.lisias.net/add-ons/KSPAPIExtensions
Other
11 stars 5 forks source link

The Sandboxed File System is borking on symlinks. Again. #16

Closed Lisias closed 2 years ago

Lisias commented 3 years ago

Fellow Kerbonaut https://github.com/kolAflash was bitten by another missed use case on the symlinks handling on KSPe.

TL;DR : I need to find a way to handle symlinks above the KSP root directory to prevent false positives, as explained by him on https://github.com/net-lisias-ksp/TweakScale/issues/183 :

/home/user/GamesStuff/ is where I keep stuff like savegames, mods, ... for different games, so I can easily backup it. And /home/user/opt/Steam/steamapps/common/Kerbal Space Program/GameData/TweakScale/ is symlinked to /home/user/GamesStuff/KerbalSpaceProgram/GameData/TweakScale/, so it's actually in the right place.

This is a follow up for https://github.com/net-lisias-ksp/KSPAPIExtensions/issues/6

Lisias commented 3 years ago

Update https://github.com/net-lisias-ksp/TweakScale/issues/183 when this issue is closed.

Lisias commented 3 years ago

Oukey, I finally gave this a shot.

I'm on MacOS, but this thing is still BSD under under the bonnet, it should behave similarly.

So I created a /home/lisias/GameStuff/KerbalSpaceProgram/GameData on my rig (had to comment out /home from /etc/auto_master first), and then installed on it:

Then I instrumented my KSP 1.12.2 test bed, installed on /Users/lisias/Workspaces/KSP/runtime/1.12.2 to use them as symlinks:

ln -s /home/lisias/GameStuff/KerbalSpaceProgram/GameData/999_KSP-Recall 999_KSP-Recall
ln -s /home/lisias/GameStuff/KerbalSpaceProgram/GameData/ModuleManagerWatchDog ModuleManagerWatchDog
ln -s /home/lisias/GameStuff/KerbalSpaceProgram/GameData/666_ModuleManagerWatchDog.dll 666_ModuleManagerWatchDog.dll
ln -s /home/lisias/GameStuff/KerbalSpaceProgram/GameData/999_Scale_Redist.dll 999_Scale_Redist.dll
ln -s /home/lisias/GameStuff/KerbalSpaceProgram/GameData/TweakScale TweakScale

And the ending result is:

Screen Shot 2021-08-18 at 04 40 41

And… The thing works! Not a single warning from any of the installed add'ons, being them symlinked or not.

KSP_log.zip

I don't know what's happening on the @kolAflash machine, but on mine things are working.

I will keep this open for further investigation.

Lisias commented 3 years ago

Removing this from the milestones as it works for me, and I need further information from the affected users to pursue the matter!

Lisias commented 2 years ago

FINALLY Found the problem. I forgot to add quotes when calling readlink, and so anything with spaces would bork.

Fixed on commit https://github.com/net-lisias-ksp/KSPAPIExtensions/commit/4aa5847c9cbfb5f55afbe6c6ca92f841360c8241

Lisias commented 2 years ago

The commit https://github.com/net-lisias-ksp/KSPAPIExtensions/commit/6819082feae1f0b7908b4e9153075e6f50c7baf1 probably tackles down a yet another borderline situation that could be described by this issue.