s4:pysmb: Add error log that the s4 bindings are deprecated
authorTim Beale <timbeale@catalyst.net.nz>
Fri, 11 Jan 2019 02:57:21 +0000 (15:57 +1300)
committerKarolin Seeger <kseeger@samba.org>
Mon, 4 Feb 2019 08:50:08 +0000 (09:50 +0100)
We plan to delete the s4 SMB Python bindings in the next Samba release
after v4.10, but first give external consumers a heads-up, just in case
they are currently using the s4 bindings.

Note the auth_log tests still use the s4 bindings, but all user-facing
tools should now be updated to use the s3 bindings.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 6a29e63f32c0024587020fc1f92b3d1ecaa0afbc)

source4/libcli/pysmb.c

index 45ff9a0a7c02be6148ce84a2470353775d4e1548..5a0281696619fab960f5db1b471c82b4b8039caf 100644 (file)
@@ -614,6 +614,18 @@ static PyObject *py_smb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs
        uint8_t use_spnego = 0xFF;
        PyObject *sign = Py_False;
 
+       /*
+        * These Python bindings are now deprecated because the s4 SMB client
+        * code doesn't support SMBv2 (and is unlikely to ever support it).
+        * The s3 libsmb_samba_internal bindings are a better choice for use
+        * within the Samba codebase, and support much the same API.
+        * This warning is mostly for external consumers that might be using
+        * these Python bindings (in which case, note libsmb_samba_internal
+        * is not a stable API and may change in future).
+        */
+       DBG_ERR("The smb.SMB() Python bindings are now deprecated "
+               "and will be removed in the next samba release\n");
+
        if (!PyArg_ParseTupleAndKeywords(args, kwargs, "zz|OObbO",
                                         discard_const_p(char *, kwnames),
                                         &hostname, &service, &py_creds, &py_lp,