LCOV - code coverage report
Current view: top level - source4/param - loadparm.c (source / functions) Hit Total Coverage
Test: coverage report for fix-15632 9995c5c2 Lines: 25 26 96.2 %
Date: 2024-04-13 12:30:31 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /* 
       2             :    Unix SMB/CIFS implementation.
       3             :    Parameter loading functions
       4             :    Copyright (C) Karl Auer 1993-1998
       5             : 
       6             :    Largely re-written by Andrew Tridgell, September 1994
       7             : 
       8             :    Copyright (C) Simo Sorce 2001
       9             :    Copyright (C) Alexander Bokovoy 2002
      10             :    Copyright (C) Stefan (metze) Metzmacher 2002
      11             :    Copyright (C) Jim McDonough (jmcd@us.ibm.com)  2003.
      12             :    Copyright (C) James Myers 2003 <myersjj@samba.org>
      13             :    Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
      14             : 
      15             :    This program is free software; you can redistribute it and/or modify
      16             :    it under the terms of the GNU General Public License as published by
      17             :    the Free Software Foundation; either version 3 of the License, or
      18             :    (at your option) any later version.
      19             : 
      20             :    This program is distributed in the hope that it will be useful,
      21             :    but WITHOUT ANY WARRANTY; without even the implied warranty of
      22             :    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      23             :    GNU General Public License for more details.
      24             : 
      25             :    You should have received a copy of the GNU General Public License
      26             :    along with this program.  If not, see <http://www.gnu.org/licenses/>.
      27             : */
      28             : 
      29             : #include "includes.h"
      30             : #include "lib/param/param.h"
      31             : #include "libcli/raw/libcliraw.h"
      32             : #include "librpc/ndr/libndr.h"
      33             : #include "libcli/smb/smb2_negotiate_context.h"
      34             : 
      35       13445 : void lpcfg_smbcli_options(struct loadparm_context *lp_ctx,
      36             :                          struct smbcli_options *options)
      37             : {
      38         654 :         struct GUID client_guid;
      39       13445 :         const char *str = NULL;
      40             : 
      41       13445 :         str = lpcfg_parm_string(lp_ctx, NULL, "libsmb", "client_guid");
      42       13445 :         if (str != NULL) {
      43           0 :                 GUID_from_string(str, &client_guid);
      44             :         } else {
      45       13445 :                 client_guid = GUID_random();
      46             :         }
      47       27544 :         *options = (struct smbcli_options) {
      48       13445 :                 .max_xmit = lpcfg_max_xmit(lp_ctx),
      49       13445 :                 .max_mux = lpcfg_max_mux(lp_ctx),
      50       13445 :                 .use_spnego = lpcfg_nt_status_support(lp_ctx) && lpcfg_client_use_spnego(lp_ctx),
      51       13445 :                 .signing = lpcfg_client_signing(lp_ctx),
      52             :                 .request_timeout = SMB_REQUEST_TIMEOUT,
      53       13445 :                 .ntstatus_support = lpcfg_nt_status_support(lp_ctx),
      54       13445 :                 .min_protocol = lpcfg_client_min_protocol(lp_ctx),
      55       13445 :                 .max_protocol = lpcfg__client_max_protocol(lp_ctx),
      56       13445 :                 .unicode = lpcfg_unicode(lp_ctx),
      57             :                 .use_oplocks = true,
      58             :                 .use_level2_oplocks = true,
      59             :                 .smb2_capabilities = SMB2_CAP_ALL,
      60             :                 .client_guid = client_guid,
      61             :                 .max_credits = WINDOWS_CLIENT_PURE_SMB2_NEGPROT_INITIAL_CREDIT_ASK,
      62       13445 :                 .smb3_capabilities = smb311_capabilities_parse("client",
      63       13445 :                         lpcfg_client_smb3_signing_algorithms(lp_ctx),
      64       13445 :                         lpcfg_client_smb3_encryption_algorithms(lp_ctx)),
      65             :         };
      66       13445 : }
      67             : 
      68       10716 : void lpcfg_smbcli_session_options(struct loadparm_context *lp_ctx,
      69             :                                  struct smbcli_session_options *options)
      70             : {
      71       11243 :         *options = (struct smbcli_session_options) {
      72       10716 :                 .lanman_auth = lpcfg_client_lanman_auth(lp_ctx),
      73       10716 :                 .ntlmv2_auth = lpcfg_client_ntlmv2_auth(lp_ctx),
      74       10716 :                 .plaintext_auth = lpcfg_client_plaintext_auth(lp_ctx),
      75             :         };
      76       10716 : }
      77             : 

Generated by: LCOV version 1.14