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

Additional realpath() fixes #99

Merged
merged 3 commits into from
Nov 14, 2024
Merged

Additional realpath() fixes #99

merged 3 commits into from
Nov 14, 2024

Conversation

fhgwright
Copy link
Contributor

  • Fix 10.6 non-POSIX realpath()
  • Add test case demonstrating 10.6 non-POSIX bug.

The rework of the Makefile recipes dropped this, which impacts
those test builds for non-default architectures.

TESTED:
ARCHFLAGS is now honored as intended.
This adds our allocating wrapper to the 10.6 non-POSIX case, which
returns an unsafe buffer pointer when supplied with a nonexistent path
and no buffer.  Providing our own malloc()ed buffer avoids the
problem.  This only affects 32-bit builds, since 64-bit non-POSIX is
nonexistent.

The original flag is renamed in the process, with the original name
now reflecting the combined need for the wrapper.

Some whitespace cleanup is also applied to the other composite flag
definitions.

Updates README to reflect the fix.

TESTED:
Tests pass on all platforms, including newly added test case (next
commit).
Although more thorough testing of various path cases would be useful,
this one, which just tests a simple nonexistent relative path, is
sufficient to demonstrate a bug in the 10.6 non-POSIX realpath(),
which returns "success" via an unsafe pointer to an internal buffer.

TESTED:
Fails in known bad case without the fix; passes in all cases with the
fix.
@fhgwright
Copy link
Contributor Author

@mascguy
I had time to implement the other realpath fix and its test, and test it. I don't expect to do anything further before next midweek. It's probably not super-urgent to get this into a -devel port, but I did test it in the Portfile context just in case you want to do it. This time it's just the usual commit/version/checksum update.

The only remaining known realpath bug is in the non-Darwin-extension (and non-default) 10.15 version (an OS bug, not a legacy-support bug), and I wasn't planning to deal with that one right away.

@mascguy mascguy merged commit 42c54ff into macports:master Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants