[Bug] Symbolic links are not resolved (RESOLVED: NOT A BUG)

3 replies [Last post]
Wuzzy
Wuzzy's picture
User offline. Last seen 1 week 5 days ago. Offline
Joined: 2012-06-20
Posts: 1301

This one affects Linux-based operating systems:

If you store something in the Hedgewars user directory (“$HOME/.hedgewars” under GNU/Linux) and replace any of the folders with a symbolic link, Hedgewars is unable to find any file

Example:
$HOME/.hedgewars/Data/Scripts is replaced by a symbolic link on $HOME/mycode/Hedgewars and in the 2nd folder there are all my scripts installed.

Now if I start Hedgewars, everything in Scripts is invisible to Hedgewars, no scripts appear in-game. I have to remove the symbolic link and physically move the original files back to a read Scripts folder to make it work.

Hi, I am a Hedgewars developer. Smile

sheepluva
sheepluva's picture
User offline. Last seen 2 hours 55 min ago. Offline
Joined: 2009-07-18
Posts: 563

We disabled symlinks in PhysFs on purpose, so that people can't distribute symlinks via .hwp files and use them to potentially access files that do not belong to Hedgewars.

  sheepluva <- me  my code stats -> 
a Hedgewars Developer


   <- where I'm from  what I speak -> 

Anachron
User offline. Last seen 24 weeks 4 days ago. Offline
Joined: 2014-11-08
Posts: 42

sheepluva allegedly wrote:

We disabled symlinks in PhysFs on purpose, so that people can't distribute symlinks via .hwp files and use them to potentially access files that do not belong to Hedgewars.

So how would that be possible? If I symlink ~/test.lua to ~/.hedgewars/Data/Scripts/Multiplayer/test.lua and inside the file load "SomethingElse.lua", it will load it from ~/.hedgewars/Data/Scripts/Multiplayer, not from ~/?

sheepluva
sheepluva's picture
User offline. Last seen 2 hours 55 min ago. Offline
Joined: 2009-07-18
Posts: 563

Anachron allegedly wrote:

So how would that be possible? If I symlink ~/test.lua to ~/.hedgewars/Data/Scripts/Multiplayer/test.lua and inside the file load "SomethingElse.lua", it will load it from ~/.hedgewars/Data/Scripts/Multiplayer, not from ~/?

AFAIK, it will load nothing, because test.lua will not be read pr executes by Hedgewars at all, because test.lia iin Data is a symlink, rather than a file... and symlinks are not being followed.

  sheepluva <- me  my code stats -> 
a Hedgewars Developer


   <- where I'm from  what I speak -> 

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]