From: Tim Beale Date: Tue, 8 Jan 2019 21:15:49 +0000 (+1300) Subject: s3:libsmb: Revert SMB Py bindings name back to libsmb_samba_internal X-Git-Tag: tdb-1.3.17~10 X-Git-Url: http://git.samba.org/?p=samba.git;a=commitdiff_plain;h=a9def5c6971fa1dea3aaa2da0e5dfd9246dd0c87 s3:libsmb: Revert SMB Py bindings name back to libsmb_samba_internal In order to make it clear that the APIs in these Python bindings are unstable and should not be used by external consumers, this patch changes the name of the Python bindings back to libsmb_samba_internal. To make the Python code that uses these bindings (i.e. samba-tool, etc) look a little cleaner, we can just change the module name as we import it, e.g. from samba.samba3 import libsmb_samba_internal as libsmb Signed-off-by: Tim Beale Reviewed-by: Stefan Metzmacher Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Wed Jan 9 14:30:31 CET 2019 on sn-devel-144 --- diff --git a/python/samba/ntacls.py b/python/samba/ntacls.py index 1ab5fd36e15..99245737529 100644 --- a/python/samba/ntacls.py +++ b/python/samba/ntacls.py @@ -32,7 +32,7 @@ from samba.samba3 import param as s3param from samba.dcerpc import security, xattr, idmap from samba.ndr import ndr_pack, ndr_unpack from samba.samba3 import smbd -from samba.samba3 import libsmb +from samba.samba3 import libsmb_samba_internal as libsmb # don't include volumes SMB_FILE_ATTRIBUTE_FLAGS = libsmb.FILE_ATTRIBUTE_SYSTEM | \ diff --git a/python/samba/tests/dcerpc/raw_testcase.py b/python/samba/tests/dcerpc/raw_testcase.py index 4f3f9992549..fc1c86a1283 100644 --- a/python/samba/tests/dcerpc/raw_testcase.py +++ b/python/samba/tests/dcerpc/raw_testcase.py @@ -35,7 +35,7 @@ from samba.ntstatus import ( ) from samba import NTSTATUSError from samba.samba3 import param as s3param -from samba.samba3 import libsmb +from samba.samba3 import libsmb_samba_internal as libsmb class smb_pipe_socket(object): diff --git a/python/samba/tests/libsmb.py b/python/samba/tests/libsmb.py index 5a37b09978b..e8f8e7fe94d 100644 --- a/python/samba/tests/libsmb.py +++ b/python/samba/tests/libsmb.py @@ -17,7 +17,7 @@ """Tests for samba.samba3.libsmb.""" -from samba.samba3 import libsmb +from samba.samba3 import libsmb_samba_internal as libsmb from samba.dcerpc import security from samba.samba3 import param as s3param from samba import credentials diff --git a/python/samba/tests/smb.py b/python/samba/tests/smb.py index fcb0b7fd7b8..5a52885c2f4 100644 --- a/python/samba/tests/smb.py +++ b/python/samba/tests/smb.py @@ -22,7 +22,7 @@ import sys from samba import NTSTATUSError from samba.ntstatus import (NT_STATUS_OBJECT_NAME_NOT_FOUND, NT_STATUS_OBJECT_PATH_NOT_FOUND) -from samba.samba3 import libsmb +from samba.samba3 import libsmb_samba_internal as libsmb from samba.samba3 import param as s3param PY3 = sys.version_info[0] == 3 diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c index 4322c2b0712..9acfbb2df55 100644 --- a/source3/libsmb/pylibsmb.c +++ b/source3/libsmb/pylibsmb.c @@ -1,6 +1,9 @@ /* * Unix SMB/CIFS implementation. - * Samba-internal work in progress Python binding for libsmbclient + * + * SMB client Python bindings used internally by Samba (for things like + * samba-tool). These Python bindings may change without warning, and so + * should not be used outside of the Samba codebase. * * Copyright (C) Volker Lendecke 2012 * @@ -1526,7 +1529,7 @@ static PyMethodDef py_cli_state_methods[] = { static PyTypeObject py_cli_state_type = { PyVarObject_HEAD_INIT(NULL, 0) - .tp_name = "libsmb.Conn", + .tp_name = "libsmb_samba_internal.Conn", .tp_basicsize = sizeof(struct py_cli_state), .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_doc = "libsmb connection", @@ -1540,17 +1543,17 @@ static PyMethodDef py_libsmb_methods[] = { { NULL }, }; -void initlibsmb(void); +void initlibsmb_samba_internal(void); static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, - .m_name = "libsmb", + .m_name = "libsmb_samba_internal", .m_doc = "libsmb wrapper", .m_size = -1, .m_methods = py_libsmb_methods, }; -MODULE_INIT_FUNC(libsmb) +MODULE_INIT_FUNC(libsmb_samba_internal) { PyObject *m = NULL; diff --git a/source3/wscript_build b/source3/wscript_build index 9d188a8d36a..a8ea8e581df 100644 --- a/source3/wscript_build +++ b/source3/wscript_build @@ -1323,7 +1323,7 @@ for env in bld.gen_python_environments(): bld.SAMBA3_PYTHON('pylibsmb', source='libsmb/pylibsmb.c', deps='smbclient samba-credentials %s' % pycredentials, - realname='samba/samba3/libsmb.so' + realname='samba/samba3/libsmb_samba_internal.so' ) bld.SAMBA3_BINARY('spotlight2sparql',