Page MenuHomeFreeBSD

krb5: Use GNU strerror_r() when building on Linux
AbandonedPublic

Authored by cy on Thu, Mar 12, 3:28 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 20, 2:18 AM
Unknown Object (File)
Fri, Mar 20, 12:53 AM
Unknown Object (File)
Wed, Mar 18, 9:08 PM
Unknown Object (File)
Tue, Mar 17, 8:27 AM
Unknown Object (File)
Sat, Mar 14, 11:30 PM
Subscribers

Details

Reviewers
emaste
jrtc27
ivy
des
markj
jrm
Group Reviewers
krb5
Summary

While the POSIX (BSD) strerror_r() returns an int where 0 is success
or an error number on failure, the GNU strerror() returns a char*, with
NULL pointer on success or otherwise a pointer to an error message.
This difference causes a buildworld failure when building FreeBSD on a
Linux system.

34e7a57673c9 and 4dd2b869cd0 addressed the error by defining
STRERROR_R_CHAR_P when built on a Linux system. This patch tells
includes autoconf.h, which defines STRERROR_R_CHAR_P telling nKRB5's
strerror_p.c which form of the strerror() function to call.

Noted on an Ubuntu system. Tested on a Fedora system.

PR: 293660
MFC After: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 71358
Build 68241: arc lint + arc unit

Event Timeline

cy requested review of this revision.Thu, Mar 12, 3:28 AM

Is this something which should be upstream?

Is this something which should be upstream?

Yes.

In D55823#1277096, @cy wrote:

Is this something which should be upstream?

Yes.

Do you want to raise the PR on GitHub or shall I do it? Greg Hudson is quite receptive to PRs. I have done numerous throughout the years.

I find it quite surprising that this would just be broken in the upstream build; is it possible this is an artifact of our bespoke build process? Presumably the Implement the POSIX strerror_r API in terms of the GNU strerror_r section has to be used on GNU systems?

I find it quite surprising that this would just be broken in the upstream build; is it possible this is an artifact of our bespoke build process? Presumably the Implement the POSIX strerror_r API in terms of the GNU strerror_r section has to be used on GNU systems?

I find it surprising too.

However, jrtc27@'s patch to krb5/include/autoconf.h did not make it into 15.0-RELEASE. And, this patch relies on jrtc27@'s patch. I MFCed jrtc27@'s patch yesterday. This suggests this has been broken in the stable/15 branch until yesterday. Given all our work to add some "awareness" of build environment to autoconf.h (which BTW is built by ./configure upstream), our bespoke build environment would have contributed.

I'm also surprised we didn't notice until now.

My patch did apply to the upstream sources (PR #1494). I'll have to give it a spin on my Fedora VM at $JOB.

I think this needs a little more investigation because k5-platform.h already includes autoconf.h. jrtc27@'s October patch should have been enough. I will rebuild again (cleanly).

Update to the latest 15-STABLE is all that is needed.