smbd: pass symlink target path to safe_symlink_target_path()
[samba.git] / source3 / smbd / fd_handle.h
1 /*
2    Unix SMB/CIFS implementation.
3    Files handle structure handling
4    Copyright (C) Ralph Boehme 2020
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef FD_HANDLE_H
21 #define FD_HANDLE_H
22
23 #include "replace.h"
24 #include <talloc.h>
25
26 struct fd_handle;
27
28 struct fd_handle *fd_handle_create(TALLOC_CTX *mem_ctx);
29
30 size_t fh_get_refcount(struct fd_handle *fh);
31 void fh_set_refcount(struct fd_handle *fh, size_t ref_count);
32
33 uint64_t fh_get_position_information(struct fd_handle *fh);
34 void fh_set_position_information(struct fd_handle *fh, uint64_t posinfo);
35
36 off_t fh_get_pos(struct fd_handle *fh);
37 void fh_set_pos(struct fd_handle *fh, off_t pos);
38
39 uint32_t fh_get_private_options(struct fd_handle *fh);
40 void fh_set_private_options(struct fd_handle *fh, uint32_t private_options);
41
42 uint64_t fh_get_gen_id(struct fd_handle *fh);
43 void fh_set_gen_id(struct fd_handle *fh, uint64_t gen_id);
44
45 int fsp_get_io_fd(const struct files_struct *fsp);
46 int fsp_get_pathref_fd(const struct files_struct *fsp);
47 void fsp_set_fd(struct files_struct *fsp, int fd);
48
49 #endif