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

filesystem disable SDL_GetBasePath implementation #3752

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 3 comments
Closed

filesystem disable SDL_GetBasePath implementation #3752

SDLBugzilla opened this issue Feb 11, 2021 · 3 comments
Assignees
Milestone

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.0
Reported for operating system, platform: Windows 10, x86

Comments on the original bug report:

On 2020-06-20 23:20:23 +0000, Brad Smith wrote:

Created attachment 4393
Disable SDL_GetBasePath implementation

Disable the SDL_GetBasePath implementation on OpenBSD. It is not functional.

On 2020-09-05 02:23:35 +0000, Brad Smith wrote:

ping.

On 2020-12-09 15:19:43 +0000, Sam Lantinga wrote:

I imagine it worked at some point? Do you have replacement code?

@SDLBugzilla SDLBugzilla added bug waiting Waiting on user response labels Feb 11, 2021
@icculus
Copy link
Collaborator

icculus commented Feb 14, 2021

I'll try this out the OpenBSD buildbot and see what happens.

@icculus icculus removed the waiting Waiting on user response label Feb 14, 2021
@icculus icculus self-assigned this Feb 14, 2021
@icculus icculus added this to the 2.0.16 milestone Feb 14, 2021
@icculus
Copy link
Collaborator

icculus commented Apr 19, 2021

So this works sometimes.

It works if there's an absolute path to the binary on the command line, and it works if there's a relative path and the current directory hasn't changed.

It 100% doesn't work if the program is run from the $PATH, or maybe if it's mangled it's argv[], if that affects the syscall.

We need a mechanism that doesn't rely on the command line for this.

@icculus
Copy link
Collaborator

icculus commented Apr 19, 2021

I don't see anything in OpenBSD we can rely on for this. And apparently when asked for this functionality, Theo de Raadt replied "Quite expensive, for such a small need." :/

https://marc.info/?l=openbsd-misc&m=144987773230417

So I guess the best fix is to search the $PATH if realpath() fails, and return NULL if that doesn't work out, and if something messes with the cwd or the command line, they're just out of luck on this platform.

joolswills pushed a commit to RetroPie/SDL that referenced this issue May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants