smbd: avoid calling SMB_VFS_FGET_NT_ACL() if do_not_check_mask already covers all
[Samba.git] / source3 / smbd / smb2_signing.c
blob4691ef4d61308224aef487056d5f536d9c82cb56
1 /*
2 Unix SMB/CIFS implementation.
3 SMB Signing Code
4 Copyright (C) Jeremy Allison 2003.
5 Copyright (C) Andrew Bartlett <abartlet@samba.org> 2002-2003
6 Copyright (C) Stefan Metzmacher 2009
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "includes.h"
23 #include "smbd/smbd.h"
24 #include "smbd/globals.h"
25 #include "../libcli/smb/smb_signing.h"
26 #include "lib/param/param.h"
27 #include "smb2_signing.h"
29 bool smb2_srv_init_signing(struct smbXsrv_connection *conn)
31 struct loadparm_context *lp_ctx = loadparm_init_s3(conn, loadparm_s3_helpers());
32 if (lp_ctx == NULL) {
33 DBG_DEBUG("loadparm_init_s3 failed\n");
34 return false;
38 * For SMB2 all we need to know is if signing is mandatory.
39 * It is always allowed and desired, whatever the smb.conf says.
41 (void)lpcfg_server_signing_allowed(lp_ctx, &conn->smb2.signing_mandatory);
42 talloc_unlink(conn, lp_ctx);
43 return true;
46 bool srv_init_signing(struct smbXsrv_connection *conn)
48 #if defined(WITH_SMB1SERVER)
49 if (conn->protocol >= PROTOCOL_SMB2_02) {
50 #endif
51 return smb2_srv_init_signing(conn);
52 #if defined(WITH_SMB1SERVER)
53 } else {
54 return smb1_srv_init_signing(conn);
56 #endif