Opened 6 months ago

Closed 5 months ago

Last modified 3 months ago

#69878 closed enhancement (fixed)

legacy-support headers should include optional "secure" definitions

Reported by: fhgwright (Fred Wright) Owned by: fhgwright (Fred Wright)
Priority: Low Milestone:
Component: ports Version:
Keywords: Cc: mascguy (Christopher Nielsen), kencu (Ken)
Port: legacy-support

Description

The standard include files have optional "secure" definitions for some calls, with macro wrappers for additional checks. The legacy-support headers should do the same where applicable.

Change History (4)

comment:1 Changed 5 months ago by fhgwright (Fred Wright)

Resolution: fixed
Status: assignedclosed

In 9cc5d9aac2c2a88dfaa906474c3407abbb821ac5/macports-legacy-support (master):

Add optional security wrapper for stpncpy().

This adds support for the optional stpncpy() security wrapper, based
on the _FORTIFY_SOURCE setting. By default, it only impacts 10.6
builds, though it can be explicitly enabled on 10.5, albeit less
efficiently due to the lack of the compiler builtin.

The stpncpy() function is the only one with an optional security
wrapper which is also optionally provided by legacy-support. Hence,
this is the only addition needed to close the more general ticket.

Closes: #69878

Also fixes a minor comment formatting issue.

TESTED:
Tested on 10.4-10.5 ppc, 10.4-10.6 i386, 10.5-10.6 ppc (i386 Rosetta),
10.5-12.x x86_64, 11.x-14.x arm64.
Passes all tests, including newly added tests for this feature.

comment:2 Changed 5 months ago by fhgwright (Fred Wright)

In 6f0ee43a1e662308527bd0c8cd85031d9a6553d9/macports-ports (master):

legacy-support-devel: update to latest master

  • Adds optional security wrapper for stpncpy().

Re: #69878

  • Fixes most issues with mismatched SDKs.

Re: #69867

  • Moves renameat() prototype to the proper header location.

Simplifies Tiger-only handling in the Portfile, though only for the
devel subport until the next release. In the interim, two different
versions of this code are present.

TESTED:
Tested both normal and -devel versions on 10.4-10.5 ppc, 10.5-10.6 ppc
(i386 Rosetta), 10.4-10.6 i386, 10.4-12.x x86_64, and 11.x-14.x arm64.
Builds on all tested platforms except 10.4 ppc +universal.
Passes all tests in all buildable cases.

comment:3 Changed 4 months ago by fhgwright (Fred Wright)

In a16240162b34f3a69eab8c529bd6bef7d25d51df/macports-ports (master):

legacy-support-devel: Update to latest master.

Since the previous legacy-support-devel:

  • Adds SLIST_REMOVE_AFTER, SLIST_HEAD_INITIALIZER Re: #69890
  • Adds fgetattrlist()

In the previous legacy-support-devel, since v1.2.4:

  • Adds optional security wrapper for stpncpy(). Re: #69878
  • Moves renameat() prototype to the proper header location.
  • Fixes incorrect CLOCK_UPTIME_RAW_APPROX definition
  • Eliminates spurious fmemopen() in OSes that don't need it
  • Adds appropriate DARWIN_C_LEVEL conditionals, as in SDK headers. Re: #69688
  • Reworks headers for "mismatched" SDK compatibility. Re: #69867
  • Makes clockid_t an enum, matching SDK behavior.

TESTED:
Tested both normal and -devel versions on 10.4-10.5 ppc, 10.5-10.6 ppc
(i386 Rosetta), 10.4-10.6 i386, 10.4-12.x x86_64, and 11.x-14.x arm64.
Builds on all tested platforms except 10.4 ppc +universal.
Passes all tests in all buildable cases.

comment:4 Changed 3 months ago by fhgwright (Fred Wright)

In ceccb8bb27da3987f9c191f0ad8181998af1831c/macports-ports (master):

legacy-support: Update to v1.3.0.

  • Adds optional security wrapper for stpncpy(). Re: #69878
  • Moves renameat() prototype to the proper header location.
  • Fixes incorrect CLOCK_UPTIME_RAW_APPROX definition.
  • Eliminates spurious fmemopen() in OSes that don't need it.
  • Adds appropriate DARWIN_C_LEVEL conditionals, as in SDK headers. Re: #69688
  • Reworks headers for "mismatched" SDK compatibility. Re: #69867
  • Makes clockid_t an enum, matching SDK behavior.
  • Adds SLIST_REMOVE_AFTER, SLIST_HEAD_INITIALIZER. Re: #69890
  • Adds fgetattrlist(). Closes: #70350

Portfile changes:

  • Removes obsolete portion of Tiger-specific additions.
  • Moves atexit removal from post-extract to pre-patch, to respect expected phase behavior.

TESTED:
Tested both normal and -devel versions (currently identical) on
10.4-10.5 ppc, 10.5-10.6 ppc (i386 Rosetta), 10.4-10.6 i386, 10.4-12.x
x86_64, and 11.x-14.x arm64.
Builds on all tested platforms except 10.4 ppc +universal.
Passes all tests in all buildable cases.

Note: See TracTickets for help on using tickets.