Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symbolic links unsupported in archives #83

Closed
illwieckz opened this issue Mar 11, 2018 · 8 comments

Comments

Projects
4 participants
@illwieckz
Copy link
Member

commented Mar 11, 2018

It looks like the engine does not support symbolic links in archives, Xonotic makes use of that, for example:

Warn: R_LoadDDSImage: invalid dds header "dds/textures/trak5x/floor/floor_floor2a.dds" 
Warn: R_FindImageFile could not find image 'textures/trak5x/floor/floor_floor2a.tga' in shader 'textures/trak5x/floor-floor2a' 

The dds/textures/trak5x/floor/floor_floor2a.dds is in fact a symbolic link to a file named floor_floor2a_gloss.dds in the same directory.

@slipher

This comment has been minimized.

Copy link
Member

commented Mar 11, 2018

I would rather not support such a thing :) Is it impossible to simply fix the assets to use the real path?

@illwieckz

This comment has been minimized.

Copy link
Member Author

commented Mar 11, 2018

These are asset paths within standard paks Xonotic ships, it means third-party community content rely on this…

@illwieckz

This comment has been minimized.

Copy link
Member Author

commented Mar 11, 2018

Well, they can write .shader files to provide alternative names instead of doing symlink: every related piece of software knows how to read .shader files, that's not true for symlinks.

@illwieckz

This comment has been minimized.

Copy link
Member Author

commented Mar 11, 2018

For information, there is almost 2K symlinks in xonotic paks:

922 xonotic-20170401-data.pk3
514 xonotic-20170401-maps.pk3
475 xonotic-20170401-nexcompat.pk3
@illwieckz

This comment has been minimized.

Copy link
Member Author

commented Mar 12, 2018

There is a lot of different kind of files that are symlinked:

1     cfg
1349  dds
5     iqm
523   jpg
4     md3
1     mdl
28    ogg
@Viech

This comment has been minimized.

Copy link
Member

commented Mar 12, 2018

If we restrict to relative symlinks to files within the same .dpk(dir) I don't see a (security) issue. Would that suffice for the Xonotic packs?

Allowing symlinks to files in other loaded .pdk(dir)s, if ZIP even supports that, could be doable as well but would be a little more complicated as you first need to load all packages and then evaluate the links while somehow handling the possibility that a link targets a resource that was overwritten by a package with higher priority.

@illwieckz illwieckz added this to To Do in Xonotic Oct 24, 2018

@t4im t4im added the VFS label Nov 24, 2018

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 3, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

Most of the code is taken from DarkPlaces source code

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 3, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

Most of the code is taken from DarkPlaces source code

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 3, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

Most of the code is taken from DarkPlaces source code
@illwieckz

This comment has been minimized.

Copy link
Member Author

commented Mar 3, 2019

See #176 for an implementation based on DarkPlaces code:

Debug: found symlink: dds/textures/trak5x/floor/floor_floor2a.dds → dds/textures/trak5x/floor/floor_floor2a_gloss.dds 

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 3, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

Most of the code is taken from DarkPlaces source code

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 3, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

Most of the code is taken from DarkPlaces source code

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 5, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

Most of the code is taken from DarkPlaces source code

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 5, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

Most of the code is taken from DarkPlaces source code

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 10, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

Most of the code is taken from DarkPlaces source code

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 10, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

Most of the code is taken from DarkPlaces source code

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 10, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

Most of the code is taken from DarkPlaces source code

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 10, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

Most of the code is taken from DarkPlaces source code

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 12, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

symlink resolver is taken from DarkPlaces source code

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 12, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

- original C++ and BSD zip symlink resolver
- only load zip symlink from the same pak

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 12, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

- original C++ and BSD zip symlink resolver
- only load zip symlink from the same pak
- optional fs_pakSymlink cvar to enable the feature (disabled by default)

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 12, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

- original C++ and BSD zip symlink resolver
- only load zip symlink from the same pak
- optional fs_pakSymlink cvar to enable the feature (disabled by default)

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 12, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

- original C++ and BSD zip symlink resolver
- only load zip symlink from the same pak
- optional fs_pakSymlink cvar to enable the feature (disabled by default)

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 12, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

- original C++ and BSD zip symlink resolver
- only load zip symlink from the same pak
- optional fs_pakSymlink cvar to enable the feature (disabled by default)

illwieckz added a commit to illwieckz/Daemon that referenced this issue Mar 12, 2019

FileSystem: implement symlink support in zip archives, fix DaemonEngi…
…ne#83

- original C++ and BSD zip symlink resolver
- only load zip symlink from the same pak
- optional fs_pakSymlink cvar to enable the feature (disabled by default)
@illwieckz

This comment has been minimized.

Copy link
Member Author

commented Jul 5, 2019

fixed by #182

@illwieckz illwieckz closed this Jul 5, 2019

Xonotic automation moved this from To do to Done Jul 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.