s3/smbd: If we fail to close file_handle ensure we should reset the fd
[Samba.git] / source3 / smbd / smb2_signing.c
blob73d07380dfa173d5f34c935b83fdc8ddc3d90b7b
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 srv_init_signing(struct smbXsrv_connection *conn)
31 struct loadparm_context *lp_ctx = NULL;
32 bool ok = true;
34 lp_ctx = loadparm_init_s3(conn, loadparm_s3_helpers());
35 if (lp_ctx == NULL) {
36 DBG_DEBUG("loadparm_init_s3 failed\n");
37 return false;
41 * For SMB2 all we need to know is if signing is mandatory.
42 * It is always allowed and desired, whatever the smb.conf says.
44 (void)lpcfg_server_signing_allowed(lp_ctx, &conn->smb2.signing_mandatory);
46 #if defined(WITH_SMB1SERVER)
47 ok = smb1_srv_init_signing(lp_ctx, conn);
48 #endif
50 talloc_unlink(conn, lp_ctx);
51 return ok;