2 * Unix SMB/CIFS implementation.
3 * Utility functions for reparse points.
5 * Copyright (C) Jeremy Allison 2018
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "util_reparse.h"
24 NTSTATUS
fsctl_get_reparse_point(struct files_struct
*fsp
,
30 DBG_DEBUG("Called on %s\n", fsp_str_dbg(fsp
));
31 return NT_STATUS_NOT_A_REPARSE_POINT
;
34 static NTSTATUS
check_reparse_data_buffer(
35 const uint8_t *in_data
, size_t in_len
)
37 uint16_t reparse_data_length
;
40 DBG_DEBUG("in_len=0\n");
41 return NT_STATUS_INVALID_BUFFER_SIZE
;
44 DBG_DEBUG("in_len=%zu\n", in_len
);
45 return NT_STATUS_IO_REPARSE_DATA_INVALID
;
48 reparse_data_length
= PULL_LE_U16(in_data
, 4);
50 if (reparse_data_length
!= (in_len
- 8)) {
51 DBG_DEBUG("in_len=%zu, reparse_data_length=%"PRIu16
"\n",
54 return NT_STATUS_IO_REPARSE_DATA_INVALID
;
60 NTSTATUS
fsctl_set_reparse_point(struct files_struct
*fsp
,
62 const uint8_t *in_data
,
67 DBG_DEBUG("Called on %s\n", fsp_str_dbg(fsp
));
69 status
= check_reparse_data_buffer(in_data
, in_len
);
70 if (!NT_STATUS_IS_OK(status
)) {
74 return NT_STATUS_NOT_A_REPARSE_POINT
;
77 NTSTATUS
fsctl_del_reparse_point(struct files_struct
*fsp
,
79 const uint8_t *in_data
,
82 DBG_DEBUG("Called on %s\n", fsp_str_dbg(fsp
));
83 return NT_STATUS_NOT_A_REPARSE_POINT
;