From: Tim Beale Date: Fri, 11 Jan 2019 02:57:21 +0000 (+1300) Subject: s4:pysmb: Add error log that the s4 bindings are deprecated X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=6a29e63f32c0024587020fc1f92b3d1ecaa0afbc;p=metze%2Fsamba%2Fwip.git s4:pysmb: Add error log that the s4 bindings are deprecated 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 Reviewed-by: Jeremy Allison --- diff --git a/source4/libcli/pysmb.c b/source4/libcli/pysmb.c index 45ff9a0a7c02..5a0281696619 100644 --- a/source4/libcli/pysmb.c +++ b/source4/libcli/pysmb.c @@ -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,