Michael Tokarev
2024-May-25 11:25 UTC
[Samba] libsamba-policy.cpython: where it is used in samba?
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). I don't see these are referenced anywhere. What it is for? Also, what it *is* to begin with? It looks like it is a python code embeddable into a C program, and next it's linked to with a python extension? Can't the said python extension (samba-policy.cpython) run python code in libsamba-policy directly, without the C/so wrapper? 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
Andrew Bartlett
2024-May-26 10:13 UTC
[Samba] libsamba-policy.cpython: where it is used in samba?
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 currentdebian 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). > I don't see these are referenced anywhere. What it is for? > Also, what it *is* to begin with? It looks like it is a python code > embeddableinto a C program, and next it's linked to with a python > extension? > Can't the said python extension (samba-policy.cpython) run python > code inlibsamba-policy directly, without the C/so wrapper?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 also am unclear if commit 5324b943e72d597da178d362f7c938fe0a4e57b0Author: Jelmer Vernooij <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) I would put in in the python package, and hopefully we can at least make it a normal librar and perhaps deprecate it being public soon. Andrew Bartlett -- Andrew Bartlett (he/him) https://samba.org/~abartlet/Samba Team Member (since 2001) https://samba.orgSamba Team Lead https://catalyst.net.nz/services/sambaCatalyst.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