2003-08-13 05:53:07 +04:00
/*
Unix SMB / CIFS implementation .
Parameter loading functions
Copyright ( C ) Karl Auer 1993 - 1998
Largely re - written by Andrew Tridgell , September 1994
Copyright ( C ) Simo Sorce 2001
Copyright ( C ) Alexander Bokovoy 2002
Copyright ( C ) Stefan ( metze ) Metzmacher 2002
2004-07-28 17:08:08 +04:00
Copyright ( C ) Jim McDonough ( jmcd @ us . ibm . com ) 2003.
2003-08-13 05:53:07 +04:00
Copyright ( C ) James Myers 2003 < myersjj @ samba . org >
2007-09-08 04:07:50 +04:00
Copyright ( C ) Jelmer Vernooij < jelmer @ samba . org > 2007
2008-02-10 15:01:20 +03:00
2003-08-13 05:53:07 +04:00
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-10 06:07:03 +04:00
the Free Software Foundation ; either version 3 of the License , or
2003-08-13 05:53:07 +04:00
( at your option ) any later version .
2008-02-10 15:01:20 +03:00
2003-08-13 05:53:07 +04:00
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
2008-02-10 15:01:20 +03:00
2003-08-13 05:53:07 +04:00
You should have received a copy of the GNU General Public License
2007-07-10 06:07:03 +04:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2003-08-13 05:53:07 +04:00
*/
2011-10-06 12:34:50 +04:00
# include "includes.h"
# include "lib/param/param.h"
# include "libcli/raw/libcliraw.h"
2013-09-25 08:46:47 +04:00
# include "librpc/ndr/libndr.h"
2017-02-27 18:14:39 +03:00
# include "libcli/smb/smb2_negotiate_context.h"
2008-01-04 02:22:12 +03:00
2010-07-16 08:32:10 +04:00
void lpcfg_smbcli_options ( struct loadparm_context * lp_ctx ,
2008-01-04 02:22:12 +03:00
struct smbcli_options * options )
{
2022-08-10 16:15:45 +03:00
struct GUID client_guid ;
const char * str = NULL ;
str = lpcfg_parm_string ( lp_ctx , NULL , " libsmb " , " client_guid " ) ;
if ( str ! = NULL ) {
GUID_from_string ( str , & client_guid ) ;
} else {
client_guid = GUID_random ( ) ;
}
2020-07-02 14:25:43 +03:00
* options = ( struct smbcli_options ) {
. max_xmit = lpcfg_max_xmit ( lp_ctx ) ,
. max_mux = lpcfg_max_mux ( lp_ctx ) ,
. use_spnego = lpcfg_nt_status_support ( lp_ctx ) & & lpcfg_client_use_spnego ( lp_ctx ) ,
. signing = lpcfg_client_signing ( lp_ctx ) ,
. request_timeout = SMB_REQUEST_TIMEOUT ,
. ntstatus_support = lpcfg_nt_status_support ( lp_ctx ) ,
. min_protocol = lpcfg_client_min_protocol ( lp_ctx ) ,
. max_protocol = lpcfg__client_max_protocol ( lp_ctx ) ,
. unicode = lpcfg_unicode ( lp_ctx ) ,
. use_oplocks = true ,
. use_level2_oplocks = true ,
. smb2_capabilities = SMB2_CAP_ALL ,
2022-08-10 16:15:45 +03:00
. client_guid = client_guid ,
2020-07-02 14:25:43 +03:00
. max_credits = WINDOWS_CLIENT_PURE_SMB2_NEGPROT_INITIAL_CREDIT_ASK ,
2021-07-13 19:16:10 +03:00
. smb3_capabilities = smb311_capabilities_parse ( " client " ,
2021-07-13 22:26:19 +03:00
lpcfg_client_smb3_signing_algorithms ( lp_ctx ) ,
2021-07-13 19:16:10 +03:00
lpcfg_client_smb3_encryption_algorithms ( lp_ctx ) ) ,
2020-07-02 14:25:43 +03:00
} ;
2008-01-04 02:22:12 +03:00
}
2008-09-30 03:29:53 +04:00
2010-07-16 08:32:10 +04:00
void lpcfg_smbcli_session_options ( struct loadparm_context * lp_ctx ,
2008-09-30 03:29:53 +04:00
struct smbcli_session_options * options )
{
2020-07-02 14:25:43 +03:00
* options = ( struct smbcli_session_options ) {
. lanman_auth = lpcfg_client_lanman_auth ( lp_ctx ) ,
. ntlmv2_auth = lpcfg_client_ntlmv2_auth ( lp_ctx ) ,
. plaintext_auth = lpcfg_client_plaintext_auth ( lp_ctx ) ,
} ;
2008-09-30 03:29:53 +04:00
}
2008-10-23 23:49:40 +04:00