s3:pylibsmb: Rename libsmb_samba_internal Py bindings to libsmb
authorTim Beale <timbeale@catalyst.net.nz>
Wed, 12 Dec 2018 23:32:17 +0000 (12:32 +1300)
committerTim Beale <timbeale@samba.org>
Mon, 7 Jan 2019 21:48:27 +0000 (22:48 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/tests/dcerpc/raw_testcase.py
python/samba/tests/libsmb_samba_internal.py
python/samba/tests/smb.py
source3/libsmb/pylibsmb.c
source3/wscript_build

index 3a50ceb..ec299bf 100644 (file)
@@ -35,15 +35,15 @@ from samba.ntstatus import (
 )
 from samba import NTSTATUSError
 from samba.samba3 import param as s3param
-from samba.samba3 import libsmb_samba_internal
+from samba.samba3 import libsmb
 
 class smb_pipe_socket(object):
 
     def __init__(self, target_hostname, pipename, creds, impersonation_level, lp):
         lp3 = s3param.get_context()
         lp3.load(lp.configfile)
-        self.smbconn = libsmb_samba_internal.Conn(target_hostname, 'IPC$', lp3,
-                                                  credentials=creds, sign=True)
+        self.smbconn = libsmb.Conn(target_hostname, 'IPC$', lp3,
+                                   credentials=creds, sign=True)
         self.smbfid = self.smbconn.create(pipename,
                                           DesiredAccess=0x12019f,
                                           ShareAccess=0x7,
index ebfed94..5a37b09 100644 (file)
@@ -15,9 +15,9 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-"""Tests for samba.samba3.libsmb_samba_internal."""
+"""Tests for samba.samba3.libsmb."""
 
-from samba.samba3 import libsmb_samba_internal
+from samba.samba3 import libsmb
 from samba.dcerpc import security
 from samba.samba3 import param as s3param
 from samba import credentials
@@ -59,9 +59,9 @@ class LibsmbTestCase(samba.tests.TestCase):
         creds.set_username(os.getenv("USERNAME"))
         creds.set_password(os.getenv("PASSWORD"))
 
-        c = libsmb_samba_internal.Conn(os.getenv("SERVER_IP"), "tmp",
-                                       lp, creds, multi_threaded=True,
-                                       force_smb1=True)
+        c = libsmb.Conn(os.getenv("SERVER_IP"), "tmp",
+                        lp, creds, multi_threaded=True,
+                        force_smb1=True)
 
         mythreads = []
 
index 9700953..fcb0b7f 100644 (file)
@@ -19,11 +19,10 @@ import samba
 import os
 import random
 import sys
-from samba import smb
 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_samba_internal
+from samba.samba3 import libsmb
 from samba.samba3 import param as s3param
 
 PY3 = sys.version_info[0] == 3
@@ -47,8 +46,7 @@ class SMBTests(samba.tests.TestCase):
         # create an SMB connection to the server
         lp = s3param.get_context()
         lp.load(os.getenv("SMB_CONF_PATH"))
-        self.smb_conn = libsmb_samba_internal.Conn(self.server, "sysvol",
-                                                   lp, creds)
+        self.smb_conn = libsmb.Conn(self.server, "sysvol", lp, creds)
 
         self.smb_conn.mkdir(test_dir)
 
index 452c30e..21c8b4e 100644 (file)
@@ -1526,7 +1526,7 @@ static PyMethodDef py_cli_state_methods[] = {
 
 static PyTypeObject py_cli_state_type = {
        PyVarObject_HEAD_INIT(NULL, 0)
-       .tp_name = "libsmb_samba_internal.Conn",
+       .tp_name = "libsmb.Conn",
        .tp_basicsize = sizeof(struct py_cli_state),
        .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
        .tp_doc = "libsmb connection",
@@ -1540,17 +1540,17 @@ static PyMethodDef py_libsmb_methods[] = {
        { NULL },
 };
 
-void initlibsmb_samba_internal(void);
+void initlibsmb(void);
 
 static struct PyModuleDef moduledef = {
     PyModuleDef_HEAD_INIT,
-    .m_name = "libsmb_samba_internal",
+    .m_name = "libsmb",
     .m_doc = "libsmb wrapper",
     .m_size = -1,
     .m_methods = py_libsmb_methods,
 };
 
-MODULE_INIT_FUNC(libsmb_samba_internal)
+MODULE_INIT_FUNC(libsmb)
 {
        PyObject *m = NULL;
 
index a8ea8e5..9d188a8 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_samba_internal.so'
+                  realname='samba/samba3/libsmb.so'
                   )
 
 bld.SAMBA3_BINARY('spotlight2sparql',