s3:libsmb: Revert SMB Py bindings name back to libsmb_samba_internal
authorTim Beale <timbeale@catalyst.net.nz>
Tue, 8 Jan 2019 21:15:49 +0000 (10:15 +1300)
committerStefan Metzmacher <metze@samba.org>
Wed, 9 Jan 2019 13:30:31 +0000 (14:30 +0100)
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 <timbeale@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jan  9 14:30:31 CET 2019 on sn-devel-144

python/samba/ntacls.py
python/samba/tests/dcerpc/raw_testcase.py
python/samba/tests/libsmb.py
python/samba/tests/smb.py
source3/libsmb/pylibsmb.c
source3/wscript_build

index 1ab5fd36e15c68f709136a06abd3babc170f9b23..992457375294ea4131544b9aeb124aae1acc2a8c 100644 (file)
@@ -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 | \
index 4f3f9992549586e0291ab0ddb56f8a0add0cc024..fc1c86a1283b9f06e7ba1ddc1743999c7001b140 100644 (file)
@@ -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):
 
index 5a37b09978b446adf3d951bf90d6d5f06e45dd77..e8f8e7fe94df7792ab4b631db764f018702c552d 100644 (file)
@@ -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
index fcb0b7fd7b8ea8900a6abcc07194549aa104cdec..5a52885c2f4c5f07121d2081fc1f7ecdde2d9274 100644 (file)
@@ -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
index 4322c2b0712906e8d296cfcd94003c286fcafddd..9acfbb2df55c2b0a01e42b2bf4ecd668557469d6 100644 (file)
@@ -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;
 
index 9d188a8d36a6fbec66bc75231f605c3959241a7d..a8ea8e581df24e9eddb52a02d798657747ea9434 100644 (file)
@@ -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',