Project

General

Profile

Bug #12938

zonename should dlopen libzonecfg, or link with it, but not both

Added by Rich Lowe about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
zones
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

Unless there's some deep reason I'm missing, zonename links to libzonecfg lazily and dlopens it, both in an attempt to work before /usr is present (which it can't not be, these days). It should do one or the other, probably it should just link it and stop dlopening

History

#1

Updated by Joshua M. Clulow about 1 month ago

It looks like what is going on is that the lazy-loaded symbol usage is gated on whether the dlopen() call succeeds or not. Lazy loading for the calls to those functions occurs at the call site (via the PLT) and thus won't happen if the dlopen() call fails.

If we assume the "maybe libzonecfg.so isn't here" use case is sound, this is not quite as poorly conceived as it might first appear. The comment above the call could absolutely make this clearer. One could imagine this might still be useful in certain reduced ramdisk or installer contexts.

Also available in: Atom PDF