[Samba] libsamba-policy.cpython: where it is used in samba?

Andrew Bartlett abartlet at samba.org
Sun Jun 30 20:50:33 UTC 2024


On Sat, 2024-06-29 at 10:06 +0300, Michael Tokarev wrote:
> 26.05.2024 13:13, Andrew Bartlett wrote:
> > On Sat, 2024-05-25 at 14:25 +0300, Michael Tokarev via samba wrote:
> > > Hi!
> > > 
> > > I'm trying to find where various components of samba belongs to
> > > and where they're used.
> > > There are quite a few files with unknown purpose.  For example, a
> > > cpython library
> > > (python code which is to be linked to from a C program) libsamba-
> > > policy.  On current
> > > debian it is like:
> > > 
> > >     usr/lib/x86_64-linux-gnu/libsamba-policy.cpython-311-x86-64-
> > > linux-gnu.so.0.0.1
> > >     usr/lib/python3/dist-packages/samba/policy.cpython-311-
> > > x86_64-linux-gnu.so
> > >     usr/lib/x86_64-linux-gnu/pkgconfig/samba-policy.cpython-311-
> > > x86_64-linux-gnu.pc
> > > 
> > > (the libraries are part of python3-samba package, the .pc file is
> > > part of samba-dev).
> 
> There's one more case like this, now with a separate package in
> debian, python3-ldb-dev:
> 
>    usr/include/samba-4.0/pyldb.h
>    usr/lib/x86_64-linux-gnu/pkgconfig/pyldb-util.cpython-311-x86_64-
> linux-gnu.pc
>    usr/lib/x86_64-linux-gnu/libpyldb-util.cpython-311-x86-64-linux-
> gnu.so
> 
> and
>    usr/lib/x86_64-linux-gnu/libpyldb-util.cpython-311-x86-64-linux-
> gnu.so.2.6.2
> in python3-ldb package.
> 
> 
> > This is a component used in the samba.policy python lib and also
> > available as an public library for other software to use (!).
> > 
> > I don't think anybody has considered if this is a wise API to be
> > exposing since it was added in the pre 4.0 days.
> 
> I think both of these (samba-policy-cpython C interface and pyldb C
> interface)
> can be dropped.  There's no realistic way to use these libraries from
> a C
> code unless you're deep into python internals - note the names of the
> .pc
> files, they depend on the python internal characteristics.  If they
> were
> named like pyldb-util.pc (or samba-policy.cpython.pc), there'd be a
> way
> to use them, but now now.
> 
> I'll drop these in debian first, as a sort of playground.

Yeah, they will be default internal in Samba 4.21 after 
https://gitlab.com/samba-team/samba/-/merge_requests/3642/diffs?commit_id=bf74d76c0f09520f90813125b835ab2162c836f3

> python-ldb-dev has been added in
> 
> commit 36ba3bdb84349660ec7aa9bae9f82e4721aee95a
> Author: Jelmer Vernooij <
> jelmer at debian.org
> >
> Date:   Sat Oct 23 20:52:04 2010 +0200
> 
>      * New upstream snapshot.
>       + Add python-ldb-dev package.
> 
> and not used anywhere.  Maybe it was used when libldb were a separate
> package though.

Yes, it would have made sense then.

> 
> > I also am unclear if
> > 
> > commit 5324b943e72d597da178d362f7c938fe0a4e57b0
> > Author: Jelmer Vernooij <
> > jelmer at samba.org
> >   <mailto:
> > jelmer at samba.org
> > >>
> > Date:   Mon Oct 11 01:09:26 2010 +0200
> > 
> >      wafsamba: Fix handling of pyembed/pyext.
> > 
> > Is correct here, I think this is a normal Samba library that is
> > called from python, it doesn't use python things (unlike pyldb-
> > util/pytalloc-util)
> 
> Oh. Also pytalloc-util and python3-talloc-dev, - similar thing to
> pyldb-util and python3-ldb-dev.  Also unused.
> 
> > I would put in in the python package, and hopefully we can at least
> > make it a normal library and perhaps deprecate it being public
> > soon.
> 
> Why put these anywhere at all?  These things aren't used already,
> as far as I can see - again, if not because it's quite difficult
> to use.

Yeah, now fixed and gone for Samba 4.21

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 mailing list