From: Volker Lendecke Date: Thu, 3 Nov 2022 11:37:58 +0000 (+0100) Subject: pylibsmb: Add template code X-Git-Tag: talloc-2.4.0~519 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71789c7f6b2d98219ae712ed810df86ebe4eda6a;p=thirdparty%2Fsamba.git pylibsmb: Add template code I've looked this up in my samples too often :-) Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c index 2cee63a76c3..dea156d623c 100644 --- a/source3/libsmb/pylibsmb.c +++ b/source3/libsmb/pylibsmb.c @@ -21,6 +21,30 @@ * along with this program. If not, see . */ +/* +Template code to use this library: + +------------------------- +from samba.samba3 import libsmb_samba_internal as libsmb +from samba.samba3 import param as s3param +from samba import (credentials,NTSTATUSError) + +lp = s3param.get_context() +lp.load("/etc/samba/smb.conf"); + +creds = credentials.Credentials() +creds.guess(lp) +creds.set_username("administrator") +creds.set_password("1234") + +c = libsmb.Conn("127.0.0.1", + "tmp", + lp, + creds, + multi_threaded=True) +------------------------- +*/ + #include #include "includes.h" #include "python/py3compat.h"