Page MenuHomeFreeBSD

libutil: Fix login_setcryptfmt()
ClosedPublic

Authored by des on Tue, Aug 5, 5:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Aug 11, 10:21 PM
Unknown Object (File)
Mon, Aug 11, 4:07 PM
Unknown Object (File)
Sun, Aug 10, 3:00 AM
Unknown Object (File)
Sat, Aug 9, 1:54 PM
Unknown Object (File)
Fri, Aug 8, 9:09 PM
Unknown Object (File)
Fri, Aug 8, 6:29 PM
Unknown Object (File)
Fri, Aug 8, 6:20 PM
Unknown Object (File)
Fri, Aug 8, 6:04 PM
Subscribers

Details

Summary

Our dummy crypt_set_format() needs to be exported, otherwise it will
be resolved at link time instead of load time, preventing the real
crypt_set_format() in libcrypt from replacing it when present.

PR: 288677
Fixes: 0c381b7f0570

Diff Detail

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

Event Timeline

des requested review of this revision.Tue, Aug 5, 5:15 PM

Why did you put the symbol into the private namespace? It is supposed to participate in interposing with libcrypt, and apps binaries would record a reference to the symbol, am I right? I believe it must be guaranteed to be stable (as in stable ABI).

libcrypt is not versioned, so the interposing mechanism there is somewhat strengthened, but ok.

The stub does not need to be public. Its only purpose is to avoid forcing programs that link with libutil but don't use login_setcryptfmt() to also link with libcrypt. An alternate solution would be to drop the stub and have login_setcryptfmt() use dlfunc() to find crypt_set_format().

This revision is now accepted and ready to land.Wed, Aug 6, 8:14 PM
This revision was automatically updated to reflect the committed changes.