2 * Unix SMB/CIFS implementation.
4 * SMB2 Posix context handling
6 * Copyright (C) Jeremy Allison 2019
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/>.
23 #include "libcli/smb/smb2_posix.h"
24 #include "libcli/smb/smb2_constants.h"
25 #include "lib/util/byteorder.h"
27 NTSTATUS
make_smb2_posix_create_ctx(
29 struct smb2_create_blobs
**crb
,
32 struct smb2_create_blobs
*cblobs
= NULL
;
33 uint8_t linear_mode
[4];
34 DATA_BLOB blob
= { .data
=linear_mode
, .length
=sizeof(linear_mode
) };
37 cblobs
= talloc_zero(mem_ctx
, struct smb2_create_blobs
);
39 return NT_STATUS_NO_MEMORY
;
41 SIVAL(&linear_mode
,0, unix_perms_to_wire(mode
& ~S_IFMT
));
43 status
= smb2_create_blob_add(
44 cblobs
, cblobs
, SMB2_CREATE_TAG_POSIX
, blob
);
45 if (!NT_STATUS_IS_OK(status
)) {