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

3 replies [Last post]
Wuzzy
Wuzzy's picture
User offline. Last seen 4 days 49 min 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 1 day 20 hours ago. Offline
Joined: 2009-07-18
Posts: 561
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.
  [url=/user/3290][color=white][b]sheepluva[/b][/color][/url][color=#90BA5D] <- me[float=right]  [/float][float=right][url=https://www.openhub.net/accounts/80048][img]https://www.openhub.net/accounts/80048/widgets/account_tiny.gif[/img][/url][/float][float=right]my code stats -> [/float][/color] [i][color=#6080C0][size=8]a[size=4] [/size][/size][/color][color=yellow]Hedgewars Developer[/color][/i] [center][float=left]  [/float][float=left][url=https://twitter.com/sheepytweety][img]/images/twitter.png[/img][/url][/float] [url=/privatemsg/new/3290][color=#C0C0C0]click here to message me[/color][/url][/center] [color=#90BA5D][float=left]  [/float][float=left][url=https://en.wikipedia.org/wiki/Austria][img]/images/Flags/austria.png[/img][/url][/float][float=left] <- where I'm from[/float][float=right]  [/float][float=right][img]/images/Flags/united_kingdom.png[/img][/float][float=right][img]/images/Flags/germany.png[/img][/float][float=right]what I speak -> [/float][/color]
Anachron
User offline. Last seen 22 weeks 3 days ago. Offline
Joined: 2014-11-08
Posts: 42
[quote=sheepluva] 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. [/quote] 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 1 day 20 hours ago. Offline
Joined: 2009-07-18
Posts: 561
[quote=Anachron] 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 ~/? [/quote] 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.
  [url=/user/3290][color=white][b]sheepluva[/b][/color][/url][color=#90BA5D] <- me[float=right]  [/float][float=right][url=https://www.openhub.net/accounts/80048][img]https://www.openhub.net/accounts/80048/widgets/account_tiny.gif[/img][/url][/float][float=right]my code stats -> [/float][/color] [i][color=#6080C0][size=8]a[size=4] [/size][/size][/color][color=yellow]Hedgewars Developer[/color][/i] [center][float=left]  [/float][float=left][url=https://twitter.com/sheepytweety][img]/images/twitter.png[/img][/url][/float] [url=/privatemsg/new/3290][color=#C0C0C0]click here to message me[/color][/url][/center] [color=#90BA5D][float=left]  [/float][float=left][url=https://en.wikipedia.org/wiki/Austria][img]/images/Flags/austria.png[/img][/url][/float][float=left] <- where I'm from[/float][float=right]  [/float][float=right][img]/images/Flags/united_kingdom.png[/img][/float][float=right][img]/images/Flags/germany.png[/img][/float][float=right]what I speak -> [/float][/color]
Copyright © 2004-2023 Hedgewars Project. All rights reserved. [ contact ]