Skip to content

LoadResourceFile unable to load symlinked files #4071

Description

@luxu-gg

What happened?

This commit 3903cfd prevents a resource from loading files from a symbolic linked folder.

Up until artifacts 30819 I had no issues. But after 30863, resources attempting to load symbolic linked files, fail and error out.

These symlinked files are inside the resource folder and are there intentionally

I think it would be wise to do extra testing with symlinks before commiting filesystem changes like these.
Symlinks are ancient and an important feature that should always have support.

Expected result

Be able to load any file inside the resource folder, despite it being symlinked or not

Reproduction steps

Create a resource folder add a symlinked folder inside and try to load it via LoadResourceFile.

structure example:

ResourceA

  • fxmanifest.lua
  • main.lua -> LoadResourceFile (... locales/en.json)
  • locales [symlink]
    • en.json

Importancy

Unknown

Area(s)

Natives, FXServer, FiveM, RedM

Specific version(s)

Server 30863

Additional information

Would it be possible to build a file allowlist when a resource is loaded (including intentional symlinks) and only allow LoadResourceFile to access entries from that list? It would re-map the allowlist on refresh; That seems like it could preserve the sandbox while keeping symlink support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RedMIssues/PRs related to RedMbugtriageNeeds a preliminary assessment to determine the urgency and required action

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions