libndr 4.0 issues.

Andrew Bartlett abartlet at samba.org
Mon Mar 18 06:27:59 UTC 2024


On Tue, 2024-01-30 at 14:09 +0300, Michael Tokarev wrote:
> 30.01.2024 13:04, Michael Tokarev via samba-technical:
> ...
> > Now, the "right but not exactly trivial" way would be to actually
> > use
> > the symbol versioning mechanism.  It is not a black magic, it's
> > actually
> > quite simple once you understand how it works.  So that will be the
> > same
> > set of (wrapper/compat) functions but done in a stright-forward,
> > clean
> > way, without hackish re-#defines.  You write
> > ndr_size_string_v3(uint32)
> > which just call new ndr_size_string(uint64), and mark the v3 one in
> > the
> > ld script (or right in the code) as belonging to the previous
> > version.
> > Having ABI/*.syms files makes it easy to implement proper symbol
> > versioning,
> > but this has to be done (so at least some python/waf code needs to
> > be
> > written), and done in a way to be at least somewhat compatible with
> > the before-versioned symbols - that means, at least on per-library
> > basis,
> > after ABI bumping.
> 
> Samba does use some form of symbol versioning already, so there's no
> conversion needed.  But it does not allow for multiple versions of
> the
> same symbol, and the versioning itself is done a bit wrong.  Namely,
> current wafsamba only looks when the given symbol appeared, not when
> it changed.  For example, when a program uses one of the changed in
> v4
> symbols, such as that same ndr_size_string(), it gets linked with
> ndr_size_string at NDR_0.0.1 (it was ndr version 0.0.1 when this symbol
> first appeared), instead of the correct-by-now ndr_size_string at NDR_4.
> 0.0,
> since it's version 4.0.0 when this symbol with this signature first
> appeared -- ndr_size_string at NDR_0.0.1 is not compatible with current
> interface.
> 
> I just committed a change to debian bumping all changed symbols
> minver to current:
> 
> https://salsa.debian.org/samba-team/samba/-/commit/b48cc627abb0ea1aa924de420419dcb2c21616dc
> 
> 
> but this should be done in wafsamba using this @VER mechanism.

Thanks for doing this.  If you are able to help us change this
correctly (eg with a patch) upstream, I'm happy to take a look.

An idea that, perhaps now too late, was being tossed around the
Catalyst office was to patch Samba 4.20 with the revert
of  c75be6c326119a64e95513b3bad3f78522f4587a.  
Depending on how you feel about the int -> uint32_t parts of the ABI,
this could potentially allow you to set the libndr version to 3.0.1.

I think backports (as a general concept) are best done in such a way
that they don't provide public libs (except say libwbclient), but just
in case the above helps with backports I wanted to mention the
possability.

Andrew Bartlett
-- 
Andrew Bartlett (he/him)       https://samba.org/~abartlet/
Samba Team Member (since 2001) https://samba.org
Samba Team Lead                https://catalyst.net.nz/services/samba
Catalyst.Net Ltd

Proudly developing Samba for Catalyst.Net Ltd - a Catalyst IT group
company

Samba Development and Support: https://catalyst.net.nz/services/samba

Catalyst IT - Expert Open Source Solutions




More information about the samba-technical mailing list