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

Michael Tokarev mjt at tls.msk.ru
Sat Jun 29 07:06:13 UTC 2024


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.

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.



> 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.

Thanks,

/mjt

-- 
GPG Key transition (from rsa2048 to rsa4096) since 2024-04-24.
New key: rsa4096/61AD3D98ECDF2C8E  9D8B E14E 3F2A 9DD7 9199  28F1 61AD 3D98 ECDF 2C8E
Old key: rsa2048/457CE0A0804465C5  6EE1 95D1 886E 8FFB 810D  4324 457C E0A0 8044 65C5
Transition statement: http://www.corpit.ru/mjt/gpg-transition-2024.txt




More information about the samba mailing list