1 | /*
|
---|
2 | * Unix SMB/CIFS implementation.
|
---|
3 | * Main SMB server routines
|
---|
4 | *
|
---|
5 | * Copyright (C) Andrew Tridgell 1992-2002,2006
|
---|
6 | * Copyright (C) Jeremy Allison 1992-2010
|
---|
7 | * Copyright (C) Volker Lendecke 1993-2009
|
---|
8 | * Copyright (C) John H Terpstra 1995-1998
|
---|
9 | * Copyright (C) Luke Kenneth Casson Leighton 1996-1998
|
---|
10 | * Copyright (C) Paul Ashton 1997-1998
|
---|
11 | * Copyright (C) Tim Potter 1999-2000
|
---|
12 | * Copyright (C) T.D.Lee@durham.ac.uk 1999
|
---|
13 | * Copyright (C) Ying Chen 2000
|
---|
14 | * Copyright (C) Shirish Kalele 2000
|
---|
15 | * Copyright (C) Andrew Bartlett 2001-2003
|
---|
16 | * Copyright (C) Alexander Bokovoy 2002,2005
|
---|
17 | * Copyright (C) Simo Sorce 2001-2002,2009
|
---|
18 | * Copyright (C) Andreas Gruenbacher 2002
|
---|
19 | * Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002
|
---|
20 | * Copyright (C) Martin Pool 2002
|
---|
21 | * Copyright (C) Luke Howard 2003
|
---|
22 | * Copyright (C) Stefan (metze) Metzmacher 2003,2009
|
---|
23 | * Copyright (C) Steve French 2005
|
---|
24 | * Copyright (C) Gerald (Jerry) Carter 2006
|
---|
25 | * Copyright (C) James Peach 2006-2007
|
---|
26 | * Copyright (C) Jelmer Vernooij 2002-2003
|
---|
27 | * Copyright (C) Michael Adam 2007
|
---|
28 | * Copyright (C) Rishi Srivatsavai 2007
|
---|
29 | * Copyright (C) Tim Prouty 2009
|
---|
30 | * Copyright (C) Gregor Beck 2011
|
---|
31 | *
|
---|
32 | * This program is free software; you can redistribute it and/or modify
|
---|
33 | * it under the terms of the GNU General Public License as published by
|
---|
34 | * the Free Software Foundation; either version 3 of the License, or
|
---|
35 | * (at your option) any later version.
|
---|
36 | *
|
---|
37 | * This program is distributed in the hope that it will be useful,
|
---|
38 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
39 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
40 | * GNU General Public License for more details.
|
---|
41 | *
|
---|
42 | * You should have received a copy of the GNU General Public License
|
---|
43 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
44 | */
|
---|
45 |
|
---|
46 | #ifndef _SMBD_PROTO_H_
|
---|
47 | #define _SMBD_PROTO_H_
|
---|
48 |
|
---|
49 | /* The following definitions come from smbd/signing.c */
|
---|
50 |
|
---|
51 | struct smbXsrv_connection;
|
---|
52 |
|
---|
53 | bool srv_check_sign_mac(struct smbXsrv_connection *conn,
|
---|
54 | const char *inbuf, uint32_t *seqnum, bool trusted_channel);
|
---|
55 | void srv_calculate_sign_mac(struct smbXsrv_connection *conn,
|
---|
56 | char *outbuf, uint32_t seqnum);
|
---|
57 | void srv_cancel_sign_response(struct smbXsrv_connection *conn);
|
---|
58 | bool srv_init_signing(struct smbXsrv_connection *conn);
|
---|
59 | void srv_set_signing_negotiated(struct smbXsrv_connection *conn,
|
---|
60 | bool allowed, bool mandatory);
|
---|
61 | bool srv_is_signing_active(struct smbXsrv_connection *conn);
|
---|
62 | bool srv_is_signing_negotiated(struct smbXsrv_connection *conn);
|
---|
63 | void srv_set_signing(struct smbXsrv_connection *conn,
|
---|
64 | const DATA_BLOB user_session_key,
|
---|
65 | const DATA_BLOB response);
|
---|
66 |
|
---|
67 | /* The following definitions come from smbd/aio.c */
|
---|
68 |
|
---|
69 | int get_outstanding_aio_calls(void);
|
---|
70 | void increment_outstanding_aio_calls(void);
|
---|
71 | void decrement_outstanding_aio_calls(void);
|
---|
72 | struct aio_extra;
|
---|
73 | bool aio_write_through_requested(struct aio_extra *aio_ex);
|
---|
74 | NTSTATUS schedule_aio_read_and_X(connection_struct *conn,
|
---|
75 | struct smb_request *req,
|
---|
76 | files_struct *fsp, off_t startpos,
|
---|
77 | size_t smb_maxcnt);
|
---|
78 | NTSTATUS schedule_aio_write_and_X(connection_struct *conn,
|
---|
79 | struct smb_request *req,
|
---|
80 | files_struct *fsp, const char *data,
|
---|
81 | off_t startpos,
|
---|
82 | size_t numtowrite);
|
---|
83 | NTSTATUS schedule_smb2_aio_read(connection_struct *conn,
|
---|
84 | struct smb_request *smbreq,
|
---|
85 | files_struct *fsp,
|
---|
86 | TALLOC_CTX *ctx,
|
---|
87 | DATA_BLOB *preadbuf,
|
---|
88 | off_t startpos,
|
---|
89 | size_t smb_maxcnt);
|
---|
90 | NTSTATUS schedule_aio_smb2_write(connection_struct *conn,
|
---|
91 | struct smb_request *smbreq,
|
---|
92 | files_struct *fsp,
|
---|
93 | uint64_t in_offset,
|
---|
94 | DATA_BLOB in_data,
|
---|
95 | bool write_through);
|
---|
96 | bool cancel_smb2_aio(struct smb_request *smbreq);
|
---|
97 | bool aio_add_req_to_fsp(files_struct *fsp, struct tevent_req *req);
|
---|
98 |
|
---|
99 | /* The following definitions come from smbd/blocking.c */
|
---|
100 |
|
---|
101 | void brl_timeout_fn(struct tevent_context *event_ctx,
|
---|
102 | struct tevent_timer *te,
|
---|
103 | struct timeval now,
|
---|
104 | void *private_data);
|
---|
105 | struct timeval timeval_brl_min(const struct timeval *tv1,
|
---|
106 | const struct timeval *tv2);
|
---|
107 | void process_blocking_lock_queue(struct smbd_server_connection *sconn);
|
---|
108 | bool push_blocking_lock_request( struct byte_range_lock *br_lck,
|
---|
109 | struct smb_request *req,
|
---|
110 | files_struct *fsp,
|
---|
111 | int lock_timeout,
|
---|
112 | int lock_num,
|
---|
113 | uint64_t smblctx,
|
---|
114 | enum brl_type lock_type,
|
---|
115 | enum brl_flavour lock_flav,
|
---|
116 | uint64_t offset,
|
---|
117 | uint64_t count,
|
---|
118 | uint64_t blocking_smblctx);
|
---|
119 | void smbd_cancel_pending_lock_requests_by_fid(files_struct *fsp,
|
---|
120 | struct byte_range_lock *br_lck,
|
---|
121 | enum file_close_type close_type);
|
---|
122 | void cancel_pending_lock_requests_by_fid(files_struct *fsp,
|
---|
123 | struct byte_range_lock *br_lck,
|
---|
124 | enum file_close_type close_type);
|
---|
125 | void remove_pending_lock_requests_by_mid_smb1(
|
---|
126 | struct smbd_server_connection *sconn, uint64_t mid);
|
---|
127 | bool blocking_lock_was_deferred_smb1(
|
---|
128 | struct smbd_server_connection *sconn, uint64_t mid);
|
---|
129 | struct blocking_lock_record *blocking_lock_cancel_smb1(files_struct *fsp,
|
---|
130 | uint64_t smblctx,
|
---|
131 | uint64_t offset,
|
---|
132 | uint64_t count,
|
---|
133 | enum brl_flavour lock_flav,
|
---|
134 | unsigned char locktype,
|
---|
135 | NTSTATUS err);
|
---|
136 |
|
---|
137 | /* The following definitions come from smbd/close.c */
|
---|
138 |
|
---|
139 | void set_close_write_time(struct files_struct *fsp, struct timespec ts);
|
---|
140 | NTSTATUS close_file(struct smb_request *req, files_struct *fsp,
|
---|
141 | enum file_close_type close_type);
|
---|
142 | void msg_close_file(struct messaging_context *msg_ctx,
|
---|
143 | void *private_data,
|
---|
144 | uint32_t msg_type,
|
---|
145 | struct server_id server_id,
|
---|
146 | DATA_BLOB *data);
|
---|
147 | NTSTATUS delete_all_streams(connection_struct *conn, const char *fname);
|
---|
148 | bool recursive_rmdir(TALLOC_CTX *ctx,
|
---|
149 | connection_struct *conn,
|
---|
150 | struct smb_filename *smb_dname);
|
---|
151 |
|
---|
152 | /* The following definitions come from smbd/conn.c */
|
---|
153 |
|
---|
154 | int conn_num_open(struct smbd_server_connection *sconn);
|
---|
155 | bool conn_snum_used(struct smbd_server_connection *sconn, int snum);
|
---|
156 | connection_struct *conn_new(struct smbd_server_connection *sconn);
|
---|
157 | bool conn_idle_all(struct smbd_server_connection *sconn, time_t t);
|
---|
158 | void conn_clear_vuid_caches(struct smbd_server_connection *sconn, uint64_t vuid);
|
---|
159 | void conn_free(connection_struct *conn);
|
---|
160 | void conn_force_tdis(struct smbd_server_connection *sconn, const char *sharename);
|
---|
161 | void msg_force_tdis(struct messaging_context *msg,
|
---|
162 | void *private_data,
|
---|
163 | uint32_t msg_type,
|
---|
164 | struct server_id server_id,
|
---|
165 | DATA_BLOB *data);
|
---|
166 |
|
---|
167 | /* The following definitions come from smbd/connection.c */
|
---|
168 |
|
---|
169 | int count_current_connections(const char *sharename, bool verify);
|
---|
170 | bool connections_snum_used(struct smbd_server_connection *unused, int snum);
|
---|
171 |
|
---|
172 | /* The following definitions come from smbd/dfree.c */
|
---|
173 |
|
---|
174 | uint64_t sys_disk_free(connection_struct *conn, struct smb_filename *fname,
|
---|
175 | uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
|
---|
176 | uint64_t get_dfree_info(connection_struct *conn, struct smb_filename *fname,
|
---|
177 | uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
|
---|
178 |
|
---|
179 | /* The following definitions come from smbd/dir.c */
|
---|
180 |
|
---|
181 | bool init_dptrs(struct smbd_server_connection *sconn);
|
---|
182 | const char *dptr_path(struct smbd_server_connection *sconn, int key);
|
---|
183 | const char *dptr_wcard(struct smbd_server_connection *sconn, int key);
|
---|
184 | uint16_t dptr_attr(struct smbd_server_connection *sconn, int key);
|
---|
185 | void dptr_close(struct smbd_server_connection *sconn, int *key);
|
---|
186 | void dptr_closecnum(connection_struct *conn);
|
---|
187 | void dptr_idlecnum(connection_struct *conn);
|
---|
188 | void dptr_closepath(struct smbd_server_connection *sconn,
|
---|
189 | char *path,uint16_t spid);
|
---|
190 | NTSTATUS dptr_create(connection_struct *conn,
|
---|
191 | struct smb_request *req,
|
---|
192 | files_struct *fsp,
|
---|
193 | const char *path, bool old_handle, bool expect_close,uint16_t spid,
|
---|
194 | const char *wcard, bool wcard_has_wild, uint32_t attr, struct dptr_struct **dptr_ret);
|
---|
195 | void dptr_CloseDir(files_struct *fsp);
|
---|
196 | void dptr_SeekDir(struct dptr_struct *dptr, long offset);
|
---|
197 | long dptr_TellDir(struct dptr_struct *dptr);
|
---|
198 | bool dptr_has_wild(struct dptr_struct *dptr);
|
---|
199 | int dptr_dnum(struct dptr_struct *dptr);
|
---|
200 | bool dptr_get_priv(struct dptr_struct *dptr);
|
---|
201 | void dptr_set_priv(struct dptr_struct *dptr);
|
---|
202 | bool dptr_SearchDir(struct dptr_struct *dptr, const char *name, long *poffset, SMB_STRUCT_STAT *pst);
|
---|
203 | void dptr_init_search_op(struct dptr_struct *dptr);
|
---|
204 | bool dptr_fill(struct smbd_server_connection *sconn,
|
---|
205 | char *buf1,unsigned int key);
|
---|
206 | struct dptr_struct *dptr_fetch(struct smbd_server_connection *sconn,
|
---|
207 | char *buf,int *num);
|
---|
208 | struct dptr_struct *dptr_fetch_lanman2(struct smbd_server_connection *sconn,
|
---|
209 | int dptr_num);
|
---|
210 | bool get_dir_entry(TALLOC_CTX *ctx,
|
---|
211 | struct dptr_struct *dirptr,
|
---|
212 | const char *mask,
|
---|
213 | uint32_t dirtype,
|
---|
214 | char **pp_fname_out,
|
---|
215 | off_t *size,
|
---|
216 | uint32_t *mode,
|
---|
217 | struct timespec *date,
|
---|
218 | bool check_descend,
|
---|
219 | bool ask_sharemode);
|
---|
220 | bool is_visible_file(connection_struct *conn, const char *dir_path, const char *name, SMB_STRUCT_STAT *pst, bool use_veto);
|
---|
221 | struct smb_Dir *OpenDir(TALLOC_CTX *mem_ctx, connection_struct *conn,
|
---|
222 | const char *name, const char *mask, uint32_t attr);
|
---|
223 | const char *ReadDirName(struct smb_Dir *dirp, long *poffset,
|
---|
224 | SMB_STRUCT_STAT *sbuf, char **talloced);
|
---|
225 | void RewindDir(struct smb_Dir *dirp, long *poffset);
|
---|
226 | void SeekDir(struct smb_Dir *dirp, long offset);
|
---|
227 | long TellDir(struct smb_Dir *dirp);
|
---|
228 | bool SearchDir(struct smb_Dir *dirp, const char *name, long *poffset);
|
---|
229 | NTSTATUS can_delete_directory(struct connection_struct *conn,
|
---|
230 | const char *dirname);
|
---|
231 | bool have_file_open_below(connection_struct *conn,
|
---|
232 | const struct smb_filename *name);
|
---|
233 |
|
---|
234 | /* The following definitions come from smbd/dmapi.c */
|
---|
235 |
|
---|
236 | const void *dmapi_get_current_session(void);
|
---|
237 | bool dmapi_have_session(void);
|
---|
238 | bool dmapi_new_session(void);
|
---|
239 | bool dmapi_destroy_session(void);
|
---|
240 | uint32_t dmapi_file_flags(const char * const path);
|
---|
241 |
|
---|
242 | /* The following definitions come from smbd/dnsregister.c */
|
---|
243 |
|
---|
244 | bool smbd_setup_mdns_registration(struct tevent_context *ev,
|
---|
245 | TALLOC_CTX *mem_ctx,
|
---|
246 | uint16_t port);
|
---|
247 |
|
---|
248 | /* The following definitions come from smbd/dosmode.c */
|
---|
249 |
|
---|
250 | mode_t unix_mode(connection_struct *conn, int dosmode,
|
---|
251 | const struct smb_filename *smb_fname,
|
---|
252 | const char *inherit_from_dir);
|
---|
253 | uint32_t dos_mode_msdfs(connection_struct *conn,
|
---|
254 | const struct smb_filename *smb_fname);
|
---|
255 | int dos_attributes_to_stat_dos_flags(uint32_t dosmode);
|
---|
256 | uint32_t dos_mode(connection_struct *conn, struct smb_filename *smb_fname);
|
---|
257 | int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname,
|
---|
258 | uint32_t dosmode, const char *parent_dir, bool newfile);
|
---|
259 | bool get_ea_dos_attribute(connection_struct *conn,
|
---|
260 | struct smb_filename *smb_fname,
|
---|
261 | uint32_t *pattr);
|
---|
262 | NTSTATUS file_set_sparse(connection_struct *conn,
|
---|
263 | struct files_struct *fsp,
|
---|
264 | bool sparse);
|
---|
265 | int file_ntimes(connection_struct *conn, const struct smb_filename *smb_fname,
|
---|
266 | struct smb_file_time *ft);
|
---|
267 | bool set_sticky_write_time_path(struct file_id fileid, struct timespec mtime);
|
---|
268 | bool set_sticky_write_time_fsp(struct files_struct *fsp,
|
---|
269 | struct timespec mtime);
|
---|
270 |
|
---|
271 | NTSTATUS set_create_timespec_ea(connection_struct *conn,
|
---|
272 | const struct smb_filename *smb_fname,
|
---|
273 | struct timespec create_time);
|
---|
274 |
|
---|
275 | struct timespec get_create_timespec(connection_struct *conn,
|
---|
276 | struct files_struct *fsp,
|
---|
277 | const struct smb_filename *smb_fname);
|
---|
278 |
|
---|
279 | struct timespec get_change_timespec(connection_struct *conn,
|
---|
280 | struct files_struct *fsp,
|
---|
281 | const struct smb_filename *smb_fname);
|
---|
282 |
|
---|
283 | /* The following definitions come from smbd/error.c */
|
---|
284 |
|
---|
285 | bool use_nt_status(void);
|
---|
286 | void error_packet_set(char *outbuf, uint8_t eclass, uint32_t ecode, NTSTATUS ntstatus, int line, const char *file);
|
---|
287 | int error_packet(char *outbuf, uint8_t eclass, uint32_t ecode, NTSTATUS ntstatus, int line, const char *file);
|
---|
288 | void reply_nt_error(struct smb_request *req, NTSTATUS ntstatus,
|
---|
289 | int line, const char *file);
|
---|
290 | void reply_force_dos_error(struct smb_request *req, uint8_t eclass, uint32_t ecode,
|
---|
291 | int line, const char *file);
|
---|
292 | void reply_both_error(struct smb_request *req, uint8_t eclass, uint32_t ecode,
|
---|
293 | NTSTATUS status, int line, const char *file);
|
---|
294 | void reply_openerror(struct smb_request *req, NTSTATUS status);
|
---|
295 |
|
---|
296 | /* The following definitions come from smbd/file_access.c */
|
---|
297 |
|
---|
298 | bool can_delete_file_in_directory(connection_struct *conn,
|
---|
299 | const struct smb_filename *smb_fname);
|
---|
300 | bool can_write_to_file(connection_struct *conn,
|
---|
301 | const struct smb_filename *smb_fname);
|
---|
302 | bool directory_has_default_acl(connection_struct *conn, const char *fname);
|
---|
303 | NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32_t dosmode);
|
---|
304 |
|
---|
305 | /* The following definitions come from smbd/fileio.c */
|
---|
306 |
|
---|
307 | ssize_t read_file(files_struct *fsp,char *data,off_t pos,size_t n);
|
---|
308 | void update_write_time_handler(struct tevent_context *ctx,
|
---|
309 | struct tevent_timer *te,
|
---|
310 | struct timeval now,
|
---|
311 | void *private_data);
|
---|
312 | void trigger_write_time_update(struct files_struct *fsp);
|
---|
313 | void trigger_write_time_update_immediate(struct files_struct *fsp);
|
---|
314 | void mark_file_modified(files_struct *fsp);
|
---|
315 | ssize_t write_file(struct smb_request *req,
|
---|
316 | files_struct *fsp,
|
---|
317 | const char *data,
|
---|
318 | off_t pos,
|
---|
319 | size_t n);
|
---|
320 | void delete_write_cache(files_struct *fsp);
|
---|
321 | void set_filelen_write_cache(files_struct *fsp, off_t file_size);
|
---|
322 | ssize_t flush_write_cache(files_struct *fsp, enum flush_reason_enum reason);
|
---|
323 | NTSTATUS sync_file(connection_struct *conn, files_struct *fsp, bool write_through);
|
---|
324 | int fsp_stat(files_struct *fsp);
|
---|
325 |
|
---|
326 | /* The following definitions come from smbd/filename.c */
|
---|
327 |
|
---|
328 | NTSTATUS unix_convert(TALLOC_CTX *ctx,
|
---|
329 | connection_struct *conn,
|
---|
330 | const char *orig_path,
|
---|
331 | struct smb_filename **smb_fname,
|
---|
332 | uint32_t ucf_flags);
|
---|
333 | NTSTATUS check_name(connection_struct *conn, const char *name);
|
---|
334 | int get_real_filename(connection_struct *conn, const char *path,
|
---|
335 | const char *name, TALLOC_CTX *mem_ctx,
|
---|
336 | char **found_name);
|
---|
337 | NTSTATUS filename_convert(TALLOC_CTX *mem_ctx,
|
---|
338 | connection_struct *conn,
|
---|
339 | bool dfs_path,
|
---|
340 | const char *name_in,
|
---|
341 | uint32_t ucf_flags,
|
---|
342 | bool *ppath_contains_wcard,
|
---|
343 | struct smb_filename **pp_smb_fname);
|
---|
344 | NTSTATUS filename_convert_with_privilege(TALLOC_CTX *mem_ctx,
|
---|
345 | connection_struct *conn,
|
---|
346 | struct smb_request *smbreq,
|
---|
347 | const char *name_in,
|
---|
348 | uint32_t ucf_flags,
|
---|
349 | bool *ppath_contains_wcard,
|
---|
350 | struct smb_filename **pp_smb_fname);
|
---|
351 |
|
---|
352 | /* The following definitions come from smbd/files.c */
|
---|
353 |
|
---|
354 | NTSTATUS fsp_new(struct connection_struct *conn, TALLOC_CTX *mem_ctx,
|
---|
355 | files_struct **result);
|
---|
356 | NTSTATUS file_new(struct smb_request *req, connection_struct *conn,
|
---|
357 | files_struct **result);
|
---|
358 | void file_close_conn(connection_struct *conn);
|
---|
359 | void file_close_pid(struct smbd_server_connection *sconn, uint16_t smbpid,
|
---|
360 | uint64_t vuid);
|
---|
361 | bool file_init_global(void);
|
---|
362 | bool file_init(struct smbd_server_connection *sconn);
|
---|
363 | void file_close_user(struct smbd_server_connection *sconn, uint64_t vuid);
|
---|
364 | struct files_struct *files_forall(
|
---|
365 | struct smbd_server_connection *sconn,
|
---|
366 | struct files_struct *(*fn)(struct files_struct *fsp,
|
---|
367 | void *private_data),
|
---|
368 | void *private_data);
|
---|
369 | files_struct *file_find_fd(struct smbd_server_connection *sconn, int fd);
|
---|
370 | files_struct *file_find_dif(struct smbd_server_connection *sconn,
|
---|
371 | struct file_id id, unsigned long gen_id);
|
---|
372 | files_struct *file_find_di_first(struct smbd_server_connection *sconn,
|
---|
373 | struct file_id id);
|
---|
374 | files_struct *file_find_di_next(files_struct *start_fsp);
|
---|
375 | struct files_struct *file_find_one_fsp_from_lease_key(
|
---|
376 | struct smbd_server_connection *sconn,
|
---|
377 | const struct smb2_lease_key *lease_key);
|
---|
378 | bool file_find_subpath(files_struct *dir_fsp);
|
---|
379 | void file_sync_all(connection_struct *conn);
|
---|
380 | void fsp_free(files_struct *fsp);
|
---|
381 | void file_free(struct smb_request *req, files_struct *fsp);
|
---|
382 | files_struct *file_fsp(struct smb_request *req, uint16_t fid);
|
---|
383 | struct files_struct *file_fsp_get(struct smbd_smb2_request *smb2req,
|
---|
384 | uint64_t persistent_id,
|
---|
385 | uint64_t volatile_id);
|
---|
386 | struct files_struct *file_fsp_smb2(struct smbd_smb2_request *smb2req,
|
---|
387 | uint64_t persistent_id,
|
---|
388 | uint64_t volatile_id);
|
---|
389 | NTSTATUS dup_file_fsp(struct smb_request *req, files_struct *from,
|
---|
390 | uint32_t access_mask, uint32_t share_access,
|
---|
391 | uint32_t create_options, files_struct *to);
|
---|
392 | NTSTATUS file_name_hash(connection_struct *conn,
|
---|
393 | const char *name, uint32_t *p_name_hash);
|
---|
394 | NTSTATUS fsp_set_smb_fname(struct files_struct *fsp,
|
---|
395 | const struct smb_filename *smb_fname_in);
|
---|
396 | const struct GUID *fsp_client_guid(const files_struct *fsp);
|
---|
397 | uint32_t fsp_lease_type(struct files_struct *fsp);
|
---|
398 |
|
---|
399 | /* The following definitions come from smbd/ipc.c */
|
---|
400 |
|
---|
401 | NTSTATUS nt_status_np_pipe(NTSTATUS status);
|
---|
402 | void send_trans_reply(connection_struct *conn,
|
---|
403 | struct smb_request *req,
|
---|
404 | char *rparam, int rparam_len,
|
---|
405 | char *rdata, int rdata_len,
|
---|
406 | bool buffer_too_large);
|
---|
407 | void reply_trans(struct smb_request *req);
|
---|
408 | void reply_transs(struct smb_request *req);
|
---|
409 |
|
---|
410 | /* The following definitions come from smbd/lanman.c */
|
---|
411 |
|
---|
412 | void api_reply(connection_struct *conn, uint64_t vuid,
|
---|
413 | struct smb_request *req,
|
---|
414 | char *data, char *params,
|
---|
415 | int tdscnt, int tpscnt,
|
---|
416 | int mdrcnt, int mprcnt);
|
---|
417 |
|
---|
418 | /* The following definitions come from smbd/mangle.c */
|
---|
419 |
|
---|
420 | void mangle_reset_cache(void);
|
---|
421 | void mangle_change_to_posix(void);
|
---|
422 | bool mangle_is_mangled(const char *s, const struct share_params *p);
|
---|
423 | bool mangle_is_8_3(const char *fname, bool check_case,
|
---|
424 | const struct share_params *p);
|
---|
425 | bool mangle_is_8_3_wildcards(const char *fname, bool check_case,
|
---|
426 | const struct share_params *p);
|
---|
427 | bool mangle_must_mangle(const char *fname,
|
---|
428 | const struct share_params *p);
|
---|
429 | bool mangle_lookup_name_from_8_3(TALLOC_CTX *ctx,
|
---|
430 | const char *in,
|
---|
431 | char **out, /* talloced on the given context. */
|
---|
432 | const struct share_params *p);
|
---|
433 | bool name_to_8_3(const char *in,
|
---|
434 | char out[13],
|
---|
435 | bool cache83,
|
---|
436 | const struct share_params *p);
|
---|
437 |
|
---|
438 | /* The following definitions come from smbd/mangle_hash.c */
|
---|
439 |
|
---|
440 | const struct mangle_fns *mangle_hash_init(void);
|
---|
441 |
|
---|
442 | /* The following definitions come from smbd/mangle_hash2.c */
|
---|
443 |
|
---|
444 | const struct mangle_fns *mangle_hash2_init(void);
|
---|
445 | const struct mangle_fns *posix_mangle_init(void);
|
---|
446 |
|
---|
447 | /* The following definitions come from smbd/message.c */
|
---|
448 |
|
---|
449 | void reply_sends(struct smb_request *req);
|
---|
450 | void reply_sendstrt(struct smb_request *req);
|
---|
451 | void reply_sendtxt(struct smb_request *req);
|
---|
452 | void reply_sendend(struct smb_request *req);
|
---|
453 |
|
---|
454 | /* The following definitions come from smbd/msdfs.c */
|
---|
455 |
|
---|
456 | bool is_msdfs_link(connection_struct *conn,
|
---|
457 | const char *path,
|
---|
458 | SMB_STRUCT_STAT *sbufp);
|
---|
459 | struct junction_map;
|
---|
460 | NTSTATUS get_referred_path(TALLOC_CTX *ctx,
|
---|
461 | const char *dfs_path,
|
---|
462 | bool allow_broken_path,
|
---|
463 | struct junction_map *jucn,
|
---|
464 | int *consumedcntp,
|
---|
465 | bool *self_referralp);
|
---|
466 | int setup_dfs_referral(connection_struct *orig_conn,
|
---|
467 | const char *dfs_path,
|
---|
468 | int max_referral_level,
|
---|
469 | char **ppdata, NTSTATUS *pstatus);
|
---|
470 | bool create_junction(TALLOC_CTX *ctx,
|
---|
471 | const char *dfs_path,
|
---|
472 | bool allow_broken_path,
|
---|
473 | struct junction_map *jucn);
|
---|
474 | bool create_msdfs_link(const struct junction_map *jucn);
|
---|
475 | bool remove_msdfs_link(const struct junction_map *jucn);
|
---|
476 | struct junction_map *enum_msdfs_links(TALLOC_CTX *ctx, size_t *p_num_jn);
|
---|
477 | NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx,
|
---|
478 | connection_struct *conn,
|
---|
479 | bool dfs_pathnames,
|
---|
480 | const char *name_in,
|
---|
481 | bool allow_wcards,
|
---|
482 | bool allow_broken_path,
|
---|
483 | char **pp_name_out,
|
---|
484 | bool *ppath_contains_wcard);
|
---|
485 | NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
|
---|
486 | struct tevent_context *ev,
|
---|
487 | struct messaging_context *msg,
|
---|
488 | connection_struct **pconn,
|
---|
489 | int snum,
|
---|
490 | const char *path,
|
---|
491 | const struct auth_session_info *session_info);
|
---|
492 | NTSTATUS create_conn_struct_cwd(TALLOC_CTX *ctx,
|
---|
493 | struct tevent_context *ev,
|
---|
494 | struct messaging_context *msg,
|
---|
495 | connection_struct **pconn,
|
---|
496 | int snum,
|
---|
497 | const char *path,
|
---|
498 | const struct auth_session_info *session_info,
|
---|
499 | char **poldcwd);
|
---|
500 |
|
---|
501 | /* The following definitions come from smbd/negprot.c */
|
---|
502 |
|
---|
503 | void reply_negprot(struct smb_request *req);
|
---|
504 |
|
---|
505 | /* The following definitions come from smbd/notify.c */
|
---|
506 |
|
---|
507 | bool change_notify_fsp_has_changes(struct files_struct *fsp);
|
---|
508 | void change_notify_reply(struct smb_request *req,
|
---|
509 | NTSTATUS error_code,
|
---|
510 | uint32_t max_param,
|
---|
511 | struct notify_change_buf *notify_buf,
|
---|
512 | void (*reply_fn)(struct smb_request *req,
|
---|
513 | NTSTATUS error_code,
|
---|
514 | uint8_t *buf, size_t len));
|
---|
515 | NTSTATUS change_notify_create(struct files_struct *fsp, uint32_t filter,
|
---|
516 | bool recursive);
|
---|
517 | NTSTATUS change_notify_add_request(struct smb_request *req,
|
---|
518 | uint32_t max_param,
|
---|
519 | uint32_t filter, bool recursive,
|
---|
520 | struct files_struct *fsp,
|
---|
521 | void (*reply_fn)(struct smb_request *req,
|
---|
522 | NTSTATUS error_code,
|
---|
523 | uint8_t *buf, size_t len));
|
---|
524 | void smbd_notify_cancel_deleted(struct messaging_context *msg,
|
---|
525 | void *private_data, uint32_t msg_type,
|
---|
526 | struct server_id server_id, DATA_BLOB *data);
|
---|
527 | void remove_pending_change_notify_requests_by_mid(
|
---|
528 | struct smbd_server_connection *sconn, uint64_t mid);
|
---|
529 | void remove_pending_change_notify_requests_by_fid(files_struct *fsp,
|
---|
530 | NTSTATUS status);
|
---|
531 | void notify_fname(connection_struct *conn, uint32_t action, uint32_t filter,
|
---|
532 | const char *path);
|
---|
533 | char *notify_filter_string(TALLOC_CTX *mem_ctx, uint32_t filter);
|
---|
534 | struct sys_notify_context *sys_notify_context_create(TALLOC_CTX *mem_ctx,
|
---|
535 | struct tevent_context *ev);
|
---|
536 |
|
---|
537 | /* The following definitions come from smbd/notify_inotify.c */
|
---|
538 |
|
---|
539 | int inotify_watch(TALLOC_CTX *mem_ctx,
|
---|
540 | struct sys_notify_context *ctx,
|
---|
541 | const char *path,
|
---|
542 | uint32_t *filter,
|
---|
543 | uint32_t *subdir_filter,
|
---|
544 | void (*callback)(struct sys_notify_context *ctx,
|
---|
545 | void *private_data,
|
---|
546 | struct notify_event *ev),
|
---|
547 | void *private_data,
|
---|
548 | void *handle_p);
|
---|
549 |
|
---|
550 | int _fam_watch(TALLOC_CTX *mem_ctx,
|
---|
551 | struct sys_notify_context *ctx,
|
---|
552 | const char *path,
|
---|
553 | uint32_t *filter,
|
---|
554 | uint32_t *subdir_filter,
|
---|
555 | void (*callback)(struct sys_notify_context *ctx,
|
---|
556 | void *private_data,
|
---|
557 | struct notify_event *ev),
|
---|
558 | void *private_data,
|
---|
559 | void *handle_p);
|
---|
560 |
|
---|
561 |
|
---|
562 | /* The following definitions come from smbd/notify_internal.c */
|
---|
563 |
|
---|
564 | struct notify_context *notify_init(TALLOC_CTX *mem_ctx,
|
---|
565 | struct messaging_context *messaging_ctx,
|
---|
566 | struct tevent_context *ev);
|
---|
567 | NTSTATUS notify_add(struct notify_context *notify,
|
---|
568 | const char *path, uint32_t filter, uint32_t subdir_filter,
|
---|
569 | void (*callback)(void *, struct timespec,
|
---|
570 | const struct notify_event *),
|
---|
571 | void *private_data);
|
---|
572 | NTSTATUS notify_remove(struct notify_context *notify, void *private_data);
|
---|
573 | void notify_trigger(struct notify_context *notify,
|
---|
574 | uint32_t action, uint32_t filter,
|
---|
575 | const char *dir, const char *path);
|
---|
576 |
|
---|
577 | struct notify_instance;
|
---|
578 | NTSTATUS notify_walk(struct notify_context *notify,
|
---|
579 | bool (*fn)(const char *path, struct server_id server,
|
---|
580 | const struct notify_instance *instance,
|
---|
581 | void *private_data),
|
---|
582 | void *private_data);
|
---|
583 |
|
---|
584 | /* The following definitions come from smbd/ntquotas.c */
|
---|
585 |
|
---|
586 | int vfs_get_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, struct dom_sid *psid, SMB_NTQUOTA_STRUCT *qt);
|
---|
587 | int vfs_set_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, struct dom_sid *psid, SMB_NTQUOTA_STRUCT *qt);
|
---|
588 | int vfs_get_user_ntquota_list(files_struct *fsp, SMB_NTQUOTA_LIST **qt_list);
|
---|
589 | void *init_quota_handle(TALLOC_CTX *mem_ctx);
|
---|
590 |
|
---|
591 | /* The following definitions come from smbd/nttrans.c */
|
---|
592 |
|
---|
593 | void reply_ntcreate_and_X(struct smb_request *req);
|
---|
594 | NTSTATUS set_sd(files_struct *fsp, struct security_descriptor *psd,
|
---|
595 | uint32_t security_info_sent);
|
---|
596 | NTSTATUS set_sd_blob(files_struct *fsp, uint8_t *data, uint32_t sd_len,
|
---|
597 | uint32_t security_info_sent);
|
---|
598 | struct ea_list *read_nttrans_ea_list(TALLOC_CTX *ctx, const char *pdata, size_t data_size);
|
---|
599 | void reply_ntcancel(struct smb_request *req);
|
---|
600 | void reply_ntrename(struct smb_request *req);
|
---|
601 | NTSTATUS smbd_do_query_security_desc(connection_struct *conn,
|
---|
602 | TALLOC_CTX *mem_ctx,
|
---|
603 | files_struct *fsp,
|
---|
604 | uint32_t security_info_wanted,
|
---|
605 | uint32_t max_data_count,
|
---|
606 | uint8_t **ppmarshalled_sd,
|
---|
607 | size_t *psd_size);
|
---|
608 | void reply_nttrans(struct smb_request *req);
|
---|
609 | void reply_nttranss(struct smb_request *req);
|
---|
610 |
|
---|
611 | /* The following definitions come from smbd/open.c */
|
---|
612 |
|
---|
613 | NTSTATUS smbd_check_access_rights(struct connection_struct *conn,
|
---|
614 | const struct smb_filename *smb_fname,
|
---|
615 | bool use_privs,
|
---|
616 | uint32_t access_mask);
|
---|
617 | NTSTATUS fd_open(struct connection_struct *conn, files_struct *fsp,
|
---|
618 | int flags, mode_t mode);
|
---|
619 | NTSTATUS fd_close(files_struct *fsp);
|
---|
620 | void change_file_owner_to_parent(connection_struct *conn,
|
---|
621 | const char *inherit_from_dir,
|
---|
622 | files_struct *fsp);
|
---|
623 | NTSTATUS change_dir_owner_to_parent(connection_struct *conn,
|
---|
624 | const char *inherit_from_dir,
|
---|
625 | const char *fname,
|
---|
626 | SMB_STRUCT_STAT *psbuf);
|
---|
627 | bool is_stat_open(uint32_t access_mask);
|
---|
628 | NTSTATUS send_break_message(struct messaging_context *msg_ctx,
|
---|
629 | const struct share_mode_entry *exclusive,
|
---|
630 | uint16_t break_to);
|
---|
631 | struct deferred_open_record;
|
---|
632 | bool is_deferred_open_async(const struct deferred_open_record *rec);
|
---|
633 | NTSTATUS create_directory(connection_struct *conn, struct smb_request *req,
|
---|
634 | struct smb_filename *smb_dname);
|
---|
635 | void msg_file_was_renamed(struct messaging_context *msg,
|
---|
636 | void *private_data,
|
---|
637 | uint32_t msg_type,
|
---|
638 | struct server_id server_id,
|
---|
639 | DATA_BLOB *data);
|
---|
640 | NTSTATUS open_streams_for_delete(connection_struct *conn,
|
---|
641 | const char *fname);
|
---|
642 | int find_share_mode_lease(struct share_mode_data *d,
|
---|
643 | const struct GUID *client_guid,
|
---|
644 | const struct smb2_lease_key *key);
|
---|
645 | struct share_mode_lease;
|
---|
646 | struct fsp_lease *find_fsp_lease(files_struct *new_fsp,
|
---|
647 | const struct smb2_lease_key *key,
|
---|
648 | const struct share_mode_lease *l);
|
---|
649 | NTSTATUS create_file_default(connection_struct *conn,
|
---|
650 | struct smb_request *req,
|
---|
651 | uint16_t root_dir_fid,
|
---|
652 | struct smb_filename * smb_fname,
|
---|
653 | uint32_t access_mask,
|
---|
654 | uint32_t share_access,
|
---|
655 | uint32_t create_disposition,
|
---|
656 | uint32_t create_options,
|
---|
657 | uint32_t file_attributes,
|
---|
658 | uint32_t oplock_request,
|
---|
659 | struct smb2_lease *lease,
|
---|
660 | uint64_t allocation_size,
|
---|
661 | uint32_t private_flags,
|
---|
662 | struct security_descriptor *sd,
|
---|
663 | struct ea_list *ea_list,
|
---|
664 | files_struct **result,
|
---|
665 | int *pinfo,
|
---|
666 | const struct smb2_create_blobs *in_context_blobs,
|
---|
667 | struct smb2_create_blobs *out_context_blobs);
|
---|
668 |
|
---|
669 | NTSTATUS get_relative_fid_filename(connection_struct *conn,
|
---|
670 | struct smb_request *req,
|
---|
671 | uint16_t root_dir_fid,
|
---|
672 | const struct smb_filename *smb_fname,
|
---|
673 | struct smb_filename **smb_fname_out);
|
---|
674 |
|
---|
675 | /* The following definitions come from smbd/oplock.c */
|
---|
676 |
|
---|
677 | uint32_t map_oplock_to_lease_type(uint16_t op_type);
|
---|
678 | uint32_t get_lease_type(struct share_mode_data *d, struct share_mode_entry *e);
|
---|
679 | bool update_num_read_oplocks(files_struct *fsp, struct share_mode_lock *lck);
|
---|
680 |
|
---|
681 | void break_kernel_oplock(struct messaging_context *msg_ctx, files_struct *fsp);
|
---|
682 | NTSTATUS set_file_oplock(files_struct *fsp);
|
---|
683 | bool remove_oplock_under_lock(files_struct *fsp, struct share_mode_lock *lck);
|
---|
684 | bool remove_oplock(files_struct *fsp);
|
---|
685 | bool downgrade_oplock(files_struct *fsp);
|
---|
686 | bool fsp_lease_update(struct share_mode_lock *lck,
|
---|
687 | const struct GUID *client_guid,
|
---|
688 | struct fsp_lease *lease);
|
---|
689 | NTSTATUS downgrade_lease(struct smbXsrv_connection *xconn,
|
---|
690 | uint32_t num_file_ids,
|
---|
691 | const struct file_id *ids,
|
---|
692 | const struct smb2_lease_key *key,
|
---|
693 | uint32_t lease_state);
|
---|
694 | void contend_level2_oplocks_begin(files_struct *fsp,
|
---|
695 | enum level2_contention_type type);
|
---|
696 | void contend_level2_oplocks_end(files_struct *fsp,
|
---|
697 | enum level2_contention_type type);
|
---|
698 | void smbd_contend_level2_oplocks_begin(files_struct *fsp,
|
---|
699 | enum level2_contention_type type);
|
---|
700 | void smbd_contend_level2_oplocks_end(files_struct *fsp,
|
---|
701 | enum level2_contention_type type);
|
---|
702 | void share_mode_entry_to_message(char *msg, const struct share_mode_entry *e);
|
---|
703 | void message_to_share_mode_entry(struct share_mode_entry *e, const char *msg);
|
---|
704 | bool init_oplocks(struct smbd_server_connection *sconn);
|
---|
705 | void init_kernel_oplocks(struct smbd_server_connection *sconn);
|
---|
706 |
|
---|
707 | /* The following definitions come from smbd/oplock_irix.c */
|
---|
708 |
|
---|
709 | struct kernel_oplocks *irix_init_kernel_oplocks(struct smbd_server_connection *sconn);
|
---|
710 |
|
---|
711 | /* The following definitions come from smbd/oplock_linux.c */
|
---|
712 |
|
---|
713 | void linux_set_lease_capability(void);
|
---|
714 | int linux_set_lease_sighandler(int fd);
|
---|
715 | int linux_setlease(int fd, int leasetype);
|
---|
716 | struct kernel_oplocks *linux_init_kernel_oplocks(struct smbd_server_connection *sconn);
|
---|
717 |
|
---|
718 | /* The following definitions come from smbd/password.c */
|
---|
719 |
|
---|
720 | struct user_struct *get_valid_user_struct(struct smbd_server_connection *sconn,
|
---|
721 | uint64_t vuid);
|
---|
722 | void invalidate_vuid(struct smbd_server_connection *sconn, uint64_t vuid);
|
---|
723 | int register_homes_share(const char *username);
|
---|
724 |
|
---|
725 | /* The following definitions come from smbd/pipes.c */
|
---|
726 |
|
---|
727 | NTSTATUS open_np_file(struct smb_request *smb_req, const char *name,
|
---|
728 | struct files_struct **pfsp);
|
---|
729 | void reply_open_pipe_and_X(connection_struct *conn, struct smb_request *req);
|
---|
730 | void reply_pipe_write(struct smb_request *req);
|
---|
731 | void reply_pipe_write_and_X(struct smb_request *req);
|
---|
732 | void reply_pipe_read_and_X(struct smb_request *req);
|
---|
733 |
|
---|
734 | /* The following definitions come from smbd/posix_acls.c */
|
---|
735 |
|
---|
736 | void create_file_sids(const SMB_STRUCT_STAT *psbuf, struct dom_sid *powner_sid, struct dom_sid *pgroup_sid);
|
---|
737 | uint32_t map_canon_ace_perms(int snum,
|
---|
738 | enum security_ace_type *pacl_type,
|
---|
739 | mode_t perms,
|
---|
740 | bool directory_ace);
|
---|
741 | NTSTATUS unpack_nt_owners(connection_struct *conn, uid_t *puser, gid_t *pgrp, uint32_t security_info_sent, const struct security_descriptor *psd);
|
---|
742 | bool current_user_in_group(connection_struct *conn, gid_t gid);
|
---|
743 | SMB_ACL_T free_empty_sys_acl(connection_struct *conn, SMB_ACL_T the_acl);
|
---|
744 | NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info,
|
---|
745 | TALLOC_CTX *mem_ctx,
|
---|
746 | struct security_descriptor **ppdesc);
|
---|
747 | NTSTATUS posix_get_nt_acl(struct connection_struct *conn, const char *name,
|
---|
748 | uint32_t security_info,
|
---|
749 | TALLOC_CTX *mem_ctx,
|
---|
750 | struct security_descriptor **ppdesc);
|
---|
751 | NTSTATUS try_chown(files_struct *fsp, uid_t uid, gid_t gid);
|
---|
752 | NTSTATUS set_nt_acl(files_struct *fsp, uint32_t security_info_sent, const struct security_descriptor *psd);
|
---|
753 | int get_acl_group_bits( connection_struct *conn, const char *fname, mode_t *mode );
|
---|
754 | int chmod_acl(connection_struct *conn, const char *name, mode_t mode);
|
---|
755 | int inherit_access_posix_acl(connection_struct *conn, const char *inherit_from_dir,
|
---|
756 | const char *name, mode_t mode);
|
---|
757 | int fchmod_acl(files_struct *fsp, mode_t mode);
|
---|
758 | bool set_unix_posix_default_acl(connection_struct *conn, const char *fname,
|
---|
759 | const SMB_STRUCT_STAT *psbuf,
|
---|
760 | uint16_t num_def_acls, const char *pdata);
|
---|
761 | bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname, uint16_t num_acls, const char *pdata);
|
---|
762 | NTSTATUS get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fname,
|
---|
763 | uint32_t security_info_wanted,
|
---|
764 | struct security_descriptor **sd);
|
---|
765 | int posix_sys_acl_blob_get_file(vfs_handle_struct *handle,
|
---|
766 | const char *path_p,
|
---|
767 | TALLOC_CTX *mem_ctx,
|
---|
768 | char **blob_description,
|
---|
769 | DATA_BLOB *blob);
|
---|
770 | int posix_sys_acl_blob_get_fd(vfs_handle_struct *handle,
|
---|
771 | files_struct *fsp,
|
---|
772 | TALLOC_CTX *mem_ctx,
|
---|
773 | char **blob_description,
|
---|
774 | DATA_BLOB *blob);
|
---|
775 |
|
---|
776 | /* The following definitions come from smbd/process.c */
|
---|
777 |
|
---|
778 | void smbd_setup_sig_term_handler(struct smbd_server_connection *sconn);
|
---|
779 | void smbd_setup_sig_hup_handler(struct smbd_server_connection *sconn);
|
---|
780 | bool srv_send_smb(struct smbXsrv_connection *xconn, char *buffer,
|
---|
781 | bool no_signing, uint32_t seqnum,
|
---|
782 | bool do_encrypt,
|
---|
783 | struct smb_perfcount_data *pcd);
|
---|
784 | int srv_set_message(char *buf,
|
---|
785 | int num_words,
|
---|
786 | int num_bytes,
|
---|
787 | bool zero);
|
---|
788 | void remove_deferred_open_message_smb(struct smbXsrv_connection *xconn,
|
---|
789 | uint64_t mid);
|
---|
790 | bool schedule_deferred_open_message_smb(struct smbXsrv_connection *xconn,
|
---|
791 | uint64_t mid);
|
---|
792 | bool open_was_deferred(struct smbXsrv_connection *xconn, uint64_t mid);
|
---|
793 | bool get_deferred_open_message_state(struct smb_request *smbreq,
|
---|
794 | struct timeval *p_request_time,
|
---|
795 | struct deferred_open_record **open_rec);
|
---|
796 | bool push_deferred_open_message_smb(struct smb_request *req,
|
---|
797 | struct timeval request_time,
|
---|
798 | struct timeval timeout,
|
---|
799 | struct file_id id,
|
---|
800 | struct deferred_open_record *open_rec);
|
---|
801 | NTSTATUS allow_new_trans(struct trans_state *list, uint64_t mid);
|
---|
802 | void reply_outbuf(struct smb_request *req, uint8_t num_words, uint32_t num_bytes);
|
---|
803 | void smb_request_done(struct smb_request *req);
|
---|
804 | const char *smb_fn_name(int type);
|
---|
805 | void add_to_common_flags2(uint32_t v);
|
---|
806 | void remove_from_common_flags2(uint32_t v);
|
---|
807 | void construct_reply_common_req(struct smb_request *req, char *outbuf);
|
---|
808 | bool smb1_is_chain(const uint8_t *buf);
|
---|
809 | bool smb1_walk_chain(const uint8_t *buf,
|
---|
810 | bool (*fn)(uint8_t cmd,
|
---|
811 | uint8_t wct, const uint16_t *vwv,
|
---|
812 | uint16_t num_bytes, const uint8_t *bytes,
|
---|
813 | void *private_data),
|
---|
814 | void *private_data);
|
---|
815 | unsigned smb1_chain_length(const uint8_t *buf);
|
---|
816 | bool smb1_parse_chain(TALLOC_CTX *mem_ctx, const uint8_t *buf,
|
---|
817 | struct smbXsrv_connection *xconn,
|
---|
818 | bool encrypted, uint32_t seqnum,
|
---|
819 | struct smb_request ***reqs, unsigned *num_reqs);
|
---|
820 | bool req_is_in_chain(const struct smb_request *req);
|
---|
821 | void smbd_process(struct tevent_context *ev_ctx,
|
---|
822 | struct messaging_context *msg_ctx,
|
---|
823 | int sock_fd,
|
---|
824 | bool interactive);
|
---|
825 | bool fork_echo_handler(struct smbXsrv_connection *xconn);
|
---|
826 |
|
---|
827 | /* The following definitions come from smbd/quotas.c */
|
---|
828 |
|
---|
829 | bool disk_quotas(connection_struct *conn, struct smb_filename *fname,
|
---|
830 | uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
|
---|
831 |
|
---|
832 | /* The following definitions come from smbd/reply.c */
|
---|
833 |
|
---|
834 | NTSTATUS check_path_syntax(char *path);
|
---|
835 | NTSTATUS check_path_syntax_wcard(char *path, bool *p_contains_wcard);
|
---|
836 | NTSTATUS check_path_syntax_posix(char *path);
|
---|
837 | size_t srvstr_get_path_wcard(TALLOC_CTX *ctx,
|
---|
838 | const char *inbuf,
|
---|
839 | uint16_t smb_flags2,
|
---|
840 | char **pp_dest,
|
---|
841 | const char *src,
|
---|
842 | size_t src_len,
|
---|
843 | int flags,
|
---|
844 | NTSTATUS *err,
|
---|
845 | bool *contains_wcard);
|
---|
846 | size_t srvstr_get_path_wcard_posix(TALLOC_CTX *ctx,
|
---|
847 | const char *inbuf,
|
---|
848 | uint16_t smb_flags2,
|
---|
849 | char **pp_dest,
|
---|
850 | const char *src,
|
---|
851 | size_t src_len,
|
---|
852 | int flags,
|
---|
853 | NTSTATUS *err,
|
---|
854 | bool *contains_wcard);
|
---|
855 | size_t srvstr_get_path(TALLOC_CTX *ctx,
|
---|
856 | const char *inbuf,
|
---|
857 | uint16_t smb_flags2,
|
---|
858 | char **pp_dest,
|
---|
859 | const char *src,
|
---|
860 | size_t src_len,
|
---|
861 | int flags,
|
---|
862 | NTSTATUS *err);
|
---|
863 | size_t srvstr_get_path_posix(TALLOC_CTX *ctx,
|
---|
864 | const char *inbuf,
|
---|
865 | uint16_t smb_flags2,
|
---|
866 | char **pp_dest,
|
---|
867 | const char *src,
|
---|
868 | size_t src_len,
|
---|
869 | int flags,
|
---|
870 | NTSTATUS *err);
|
---|
871 | size_t srvstr_get_path_req_wcard(TALLOC_CTX *mem_ctx, struct smb_request *req,
|
---|
872 | char **pp_dest, const char *src, int flags,
|
---|
873 | NTSTATUS *err, bool *contains_wcard);
|
---|
874 | size_t srvstr_get_path_req(TALLOC_CTX *mem_ctx, struct smb_request *req,
|
---|
875 | char **pp_dest, const char *src, int flags,
|
---|
876 | NTSTATUS *err);
|
---|
877 | size_t srvstr_pull_req_talloc(TALLOC_CTX *ctx, struct smb_request *req,
|
---|
878 | char **dest, const uint8_t *src, int flags);
|
---|
879 | bool check_fsp_open(connection_struct *conn, struct smb_request *req,
|
---|
880 | files_struct *fsp);
|
---|
881 | bool check_fsp(connection_struct *conn, struct smb_request *req,
|
---|
882 | files_struct *fsp);
|
---|
883 | bool check_fsp_ntquota_handle(connection_struct *conn, struct smb_request *req,
|
---|
884 | files_struct *fsp);
|
---|
885 | void reply_special(struct smbXsrv_connection *xconn, char *inbuf, size_t inbuf_size);
|
---|
886 | void reply_tcon(struct smb_request *req);
|
---|
887 | void reply_tcon_and_X(struct smb_request *req);
|
---|
888 | void reply_unknown_new(struct smb_request *req, uint8_t type);
|
---|
889 | void reply_ioctl(struct smb_request *req);
|
---|
890 | void reply_checkpath(struct smb_request *req);
|
---|
891 | void reply_getatr(struct smb_request *req);
|
---|
892 | void reply_setatr(struct smb_request *req);
|
---|
893 | void reply_dskattr(struct smb_request *req);
|
---|
894 | void reply_search(struct smb_request *req);
|
---|
895 | void reply_fclose(struct smb_request *req);
|
---|
896 | void reply_open(struct smb_request *req);
|
---|
897 | void reply_open_and_X(struct smb_request *req);
|
---|
898 | void reply_ulogoffX(struct smb_request *req);
|
---|
899 | void reply_mknew(struct smb_request *req);
|
---|
900 | void reply_ctemp(struct smb_request *req);
|
---|
901 | NTSTATUS unlink_internals(connection_struct *conn, struct smb_request *req,
|
---|
902 | uint32_t dirtype, struct smb_filename *smb_fname,
|
---|
903 | bool has_wild);
|
---|
904 | void reply_unlink(struct smb_request *req);
|
---|
905 | ssize_t fake_sendfile(struct smbXsrv_connection *xconn, files_struct *fsp,
|
---|
906 | off_t startpos, size_t nread);
|
---|
907 | ssize_t sendfile_short_send(struct smbXsrv_connection *xconn,
|
---|
908 | files_struct *fsp,
|
---|
909 | ssize_t nread,
|
---|
910 | size_t headersize,
|
---|
911 | size_t smb_maxcnt);
|
---|
912 | void reply_readbraw(struct smb_request *req);
|
---|
913 | void reply_lockread(struct smb_request *req);
|
---|
914 | int setup_readX_header(char *outbuf, size_t smb_maxcnt);
|
---|
915 | void reply_read(struct smb_request *req);
|
---|
916 | void reply_read_and_X(struct smb_request *req);
|
---|
917 | void error_to_writebrawerr(struct smb_request *req);
|
---|
918 | void reply_writebraw(struct smb_request *req);
|
---|
919 | void reply_writeunlock(struct smb_request *req);
|
---|
920 | void reply_write(struct smb_request *req);
|
---|
921 | bool is_valid_writeX_buffer(struct smbXsrv_connection *xconn,
|
---|
922 | const uint8_t *inbuf);
|
---|
923 | void reply_write_and_X(struct smb_request *req);
|
---|
924 | void reply_lseek(struct smb_request *req);
|
---|
925 | void reply_flush(struct smb_request *req);
|
---|
926 | void reply_exit(struct smb_request *req);
|
---|
927 | void reply_close(struct smb_request *req);
|
---|
928 | void reply_writeclose(struct smb_request *req);
|
---|
929 | void reply_lock(struct smb_request *req);
|
---|
930 | void reply_unlock(struct smb_request *req);
|
---|
931 | void reply_tdis(struct smb_request *req);
|
---|
932 | void reply_echo(struct smb_request *req);
|
---|
933 | void reply_printopen(struct smb_request *req);
|
---|
934 | void reply_printclose(struct smb_request *req);
|
---|
935 | void reply_printqueue(struct smb_request *req);
|
---|
936 | void reply_printwrite(struct smb_request *req);
|
---|
937 | void reply_mkdir(struct smb_request *req);
|
---|
938 | void reply_rmdir(struct smb_request *req);
|
---|
939 | NTSTATUS rename_internals_fsp(connection_struct *conn,
|
---|
940 | files_struct *fsp,
|
---|
941 | const struct smb_filename *smb_fname_dst_in,
|
---|
942 | uint32_t attrs,
|
---|
943 | bool replace_if_exists);
|
---|
944 | NTSTATUS rename_internals(TALLOC_CTX *ctx,
|
---|
945 | connection_struct *conn,
|
---|
946 | struct smb_request *req,
|
---|
947 | struct smb_filename *smb_fname_src,
|
---|
948 | struct smb_filename *smb_fname_dst,
|
---|
949 | uint32_t attrs,
|
---|
950 | bool replace_if_exists,
|
---|
951 | bool src_has_wild,
|
---|
952 | bool dest_has_wild,
|
---|
953 | uint32_t access_mask);
|
---|
954 | void reply_mv(struct smb_request *req);
|
---|
955 | NTSTATUS copy_file(TALLOC_CTX *ctx,
|
---|
956 | connection_struct *conn,
|
---|
957 | struct smb_filename *smb_fname_src,
|
---|
958 | struct smb_filename *smb_fname_dst,
|
---|
959 | int ofun,
|
---|
960 | int count,
|
---|
961 | bool target_is_directory);
|
---|
962 | void reply_copy(struct smb_request *req);
|
---|
963 | uint64_t get_lock_pid(const uint8_t *data, int data_offset,
|
---|
964 | bool large_file_format);
|
---|
965 | uint64_t get_lock_count(const uint8_t *data, int data_offset,
|
---|
966 | bool large_file_format);
|
---|
967 | uint64_t get_lock_offset(const uint8_t *data, int data_offset,
|
---|
968 | bool large_file_format);
|
---|
969 | void reply_lockingX(struct smb_request *req);
|
---|
970 | void reply_readbmpx(struct smb_request *req);
|
---|
971 | void reply_readbs(struct smb_request *req);
|
---|
972 | void reply_setattrE(struct smb_request *req);
|
---|
973 | void reply_writebmpx(struct smb_request *req);
|
---|
974 | void reply_writebs(struct smb_request *req);
|
---|
975 | void reply_getattrE(struct smb_request *req);
|
---|
976 |
|
---|
977 | /* The following definitions come from smbd/seal.c */
|
---|
978 |
|
---|
979 | bool is_encrypted_packet(const uint8_t *inbuf);
|
---|
980 | void srv_free_enc_buffer(struct smbXsrv_connection *xconn, char *buf);
|
---|
981 | NTSTATUS srv_decrypt_buffer(struct smbXsrv_connection *xconn, char *buf);
|
---|
982 | NTSTATUS srv_encrypt_buffer(struct smbXsrv_connection *xconn, char *buf,
|
---|
983 | char **buf_out);
|
---|
984 | NTSTATUS srv_request_encryption_setup(connection_struct *conn,
|
---|
985 | unsigned char **ppdata,
|
---|
986 | size_t *p_data_size,
|
---|
987 | unsigned char **pparam,
|
---|
988 | size_t *p_param_size);
|
---|
989 | NTSTATUS srv_encryption_start(connection_struct *conn);
|
---|
990 | void server_encryption_shutdown(struct smbXsrv_connection *xconn);
|
---|
991 |
|
---|
992 | /* The following definitions come from smbd/sec_ctx.c */
|
---|
993 |
|
---|
994 | bool unix_token_equal(const struct security_unix_token *t1, const struct security_unix_token *t2);
|
---|
995 | bool push_sec_ctx(void);
|
---|
996 | void set_sec_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups, const struct security_token *token);
|
---|
997 | void set_root_sec_ctx(void);
|
---|
998 | bool pop_sec_ctx(void);
|
---|
999 | void init_sec_ctx(void);
|
---|
1000 | const struct security_token *sec_ctx_active_token(void);
|
---|
1001 |
|
---|
1002 | /* The following definitions come from smbd/server.c */
|
---|
1003 |
|
---|
1004 | struct memcache *smbd_memcache(void);
|
---|
1005 | bool snum_is_shared_printer(int snum);
|
---|
1006 | void delete_and_reload_printers(struct tevent_context *ev,
|
---|
1007 | struct messaging_context *msg_ctx);
|
---|
1008 | bool reload_services(struct smbd_server_connection *sconn,
|
---|
1009 | bool (*snumused) (struct smbd_server_connection *, int),
|
---|
1010 | bool test);
|
---|
1011 |
|
---|
1012 | /* The following definitions come from smbd/server_exit.c */
|
---|
1013 |
|
---|
1014 | void smbd_exit_server(const char *reason) _NORETURN_;
|
---|
1015 | void smbd_exit_server_cleanly(const char *const reason) _NORETURN_;
|
---|
1016 |
|
---|
1017 | /* The following definitions come from smbd/service.c */
|
---|
1018 |
|
---|
1019 | bool set_conn_connectpath(connection_struct *conn, const char *connectpath);
|
---|
1020 | NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum);
|
---|
1021 | bool set_current_service(connection_struct *conn, uint16_t flags, bool do_chdir);
|
---|
1022 | void load_registry_shares(void);
|
---|
1023 | int add_home_service(const char *service, const char *username, const char *homedir);
|
---|
1024 | int find_service(TALLOC_CTX *ctx, const char *service, char **p_service_out);
|
---|
1025 | connection_struct *make_connection_smb2(struct smbd_smb2_request *req,
|
---|
1026 | struct smbXsrv_tcon *tcon,
|
---|
1027 | int snum,
|
---|
1028 | struct user_struct *vuser,
|
---|
1029 | const char *pdev,
|
---|
1030 | NTSTATUS *pstatus);
|
---|
1031 | connection_struct *make_connection(struct smb_request *req,
|
---|
1032 | NTTIME now,
|
---|
1033 | const char *service_in,
|
---|
1034 | const char *pdev, uint64_t vuid,
|
---|
1035 | NTSTATUS *status);
|
---|
1036 | void close_cnum(connection_struct *conn, uint64_t vuid);
|
---|
1037 |
|
---|
1038 | /* The following definitions come from smbd/session.c */
|
---|
1039 | struct sessionid;
|
---|
1040 | struct smbXsrv_session;
|
---|
1041 | bool session_init(void);
|
---|
1042 | bool session_claim(struct smbXsrv_session *session);
|
---|
1043 | void session_yield(struct smbXsrv_session *session);
|
---|
1044 | int list_sessions(TALLOC_CTX *mem_ctx, struct sessionid **session_list);
|
---|
1045 | int find_sessions(TALLOC_CTX *mem_ctx, const char *username,
|
---|
1046 | const char *machine, struct sessionid **session_list);
|
---|
1047 |
|
---|
1048 | /* The following definitions come from smbd/sesssetup.c */
|
---|
1049 |
|
---|
1050 | void reply_sesssetup_and_X(struct smb_request *req);
|
---|
1051 |
|
---|
1052 | /* The following definitions come from smbd/share_access.c */
|
---|
1053 |
|
---|
1054 | bool token_contains_name_in_list(const char *username,
|
---|
1055 | const char *domain,
|
---|
1056 | const char *sharename,
|
---|
1057 | const struct security_token *token,
|
---|
1058 | const char **list);
|
---|
1059 | bool user_ok_token(const char *username, const char *domain,
|
---|
1060 | const struct security_token *token, int snum);
|
---|
1061 | bool is_share_read_only_for_token(const char *username,
|
---|
1062 | const char *domain,
|
---|
1063 | const struct security_token *token,
|
---|
1064 | connection_struct *conn);
|
---|
1065 |
|
---|
1066 | /* The following definitions come from smbd/srvstr.c */
|
---|
1067 |
|
---|
1068 | NTSTATUS srvstr_push_fn(const char *base_ptr, uint16_t smb_flags2, void *dest,
|
---|
1069 | const char *src, int dest_len, int flags, size_t *ret_len);
|
---|
1070 | ssize_t message_push_string(uint8_t **outbuf, const char *str, int flags);
|
---|
1071 |
|
---|
1072 | /* The following definitions come from smbd/statcache.c */
|
---|
1073 |
|
---|
1074 | void stat_cache_add( const char *full_orig_name,
|
---|
1075 | char *translated_path,
|
---|
1076 | bool case_sensitive);
|
---|
1077 | bool stat_cache_lookup(connection_struct *conn,
|
---|
1078 | bool posix_paths,
|
---|
1079 | char **pp_name,
|
---|
1080 | char **pp_dirpath,
|
---|
1081 | char **pp_start,
|
---|
1082 | SMB_STRUCT_STAT *pst);
|
---|
1083 | void smbd_send_stat_cache_delete_message(struct messaging_context *msg_ctx,
|
---|
1084 | const char *name);
|
---|
1085 | void send_stat_cache_delete_message(struct messaging_context *msg_ctx,
|
---|
1086 | const char *name);
|
---|
1087 | void stat_cache_delete(const char *name);
|
---|
1088 | struct TDB_DATA;
|
---|
1089 | unsigned int fast_string_hash(struct TDB_DATA *key);
|
---|
1090 | bool reset_stat_cache( void );
|
---|
1091 |
|
---|
1092 | /* The following definitions come from smbd/statvfs.c */
|
---|
1093 |
|
---|
1094 | int sys_statvfs(const char *path, vfs_statvfs_struct *statbuf);
|
---|
1095 |
|
---|
1096 | /* The following definitions come from smbd/trans2.c */
|
---|
1097 |
|
---|
1098 | NTSTATUS check_access_fsp(const struct files_struct *fsp,
|
---|
1099 | uint32_t access_mask);
|
---|
1100 | NTSTATUS check_access(connection_struct *conn,
|
---|
1101 | files_struct *fsp,
|
---|
1102 | const struct smb_filename *smb_fname,
|
---|
1103 | uint32_t access_mask);
|
---|
1104 | uint64_t smb_roundup(connection_struct *conn, uint64_t val);
|
---|
1105 | uint64_t get_FileIndex(connection_struct *conn, const SMB_STRUCT_STAT *psbuf);
|
---|
1106 | bool samba_private_attr_name(const char *unix_ea_name);
|
---|
1107 | NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn,
|
---|
1108 | files_struct *fsp, const char *fname,
|
---|
1109 | const char *ea_name, struct ea_struct *pea);
|
---|
1110 | NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx, connection_struct *conn,
|
---|
1111 | files_struct *fsp, const char *fname,
|
---|
1112 | char ***pnames, size_t *pnum_names);
|
---|
1113 | NTSTATUS set_ea(connection_struct *conn, files_struct *fsp,
|
---|
1114 | const struct smb_filename *smb_fname, struct ea_list *ea_list);
|
---|
1115 | struct ea_list *read_ea_list_entry(TALLOC_CTX *ctx, const char *pdata, size_t data_size, size_t *pbytes_used);
|
---|
1116 | void send_trans2_replies(connection_struct *conn,
|
---|
1117 | struct smb_request *req,
|
---|
1118 | NTSTATUS status,
|
---|
1119 | const char *params,
|
---|
1120 | int paramsize,
|
---|
1121 | const char *pdata,
|
---|
1122 | int datasize,
|
---|
1123 | int max_data_bytes);
|
---|
1124 | unsigned char *create_volume_objectid(connection_struct *conn, unsigned char objid[16]);
|
---|
1125 | NTSTATUS hardlink_internals(TALLOC_CTX *ctx,
|
---|
1126 | connection_struct *conn,
|
---|
1127 | struct smb_request *req,
|
---|
1128 | bool overwrite_if_exists,
|
---|
1129 | const struct smb_filename *smb_fname_old,
|
---|
1130 | struct smb_filename *smb_fname_new);
|
---|
1131 | NTSTATUS smb_set_file_time(connection_struct *conn,
|
---|
1132 | files_struct *fsp,
|
---|
1133 | const struct smb_filename *smb_fname,
|
---|
1134 | struct smb_file_time *ft,
|
---|
1135 | bool setting_write_time);
|
---|
1136 | void reply_findclose(struct smb_request *req);
|
---|
1137 | void reply_findnclose(struct smb_request *req);
|
---|
1138 | void reply_trans2(struct smb_request *req);
|
---|
1139 | void reply_transs2(struct smb_request *req);
|
---|
1140 |
|
---|
1141 | /* The following definitions come from smbd/uid.c */
|
---|
1142 |
|
---|
1143 | bool change_to_guest(void);
|
---|
1144 | NTSTATUS check_user_share_access(connection_struct *conn,
|
---|
1145 | const struct auth_session_info *session_info,
|
---|
1146 | uint32_t *p_share_access,
|
---|
1147 | bool *p_readonly_share);
|
---|
1148 | bool change_to_user(connection_struct *conn, uint64_t vuid);
|
---|
1149 | bool smbd_change_to_root_user(void);
|
---|
1150 | bool smbd_become_authenticated_pipe_user(struct auth_session_info *session_info);
|
---|
1151 | bool smbd_unbecome_authenticated_pipe_user(void);
|
---|
1152 | void become_root(void);
|
---|
1153 | void unbecome_root(void);
|
---|
1154 | void smbd_become_root(void);
|
---|
1155 | void smbd_unbecome_root(void);
|
---|
1156 | bool become_user(connection_struct *conn, uint64_t vuid);
|
---|
1157 | bool become_user_by_session(connection_struct *conn,
|
---|
1158 | const struct auth_session_info *session_info);
|
---|
1159 | bool unbecome_user(void);
|
---|
1160 | uid_t get_current_uid(connection_struct *conn);
|
---|
1161 | gid_t get_current_gid(connection_struct *conn);
|
---|
1162 | const struct security_unix_token *get_current_utok(connection_struct *conn);
|
---|
1163 | const struct security_token *get_current_nttok(connection_struct *conn);
|
---|
1164 | uint64_t get_current_vuid(connection_struct *conn);
|
---|
1165 |
|
---|
1166 | /* The following definitions come from smbd/utmp.c */
|
---|
1167 |
|
---|
1168 | void sys_utmp_claim(const char *username, const char *hostname,
|
---|
1169 | const char *id_str, int id_num);
|
---|
1170 | void sys_utmp_yield(const char *username, const char *hostname,
|
---|
1171 | const char *id_str, int id_num);
|
---|
1172 |
|
---|
1173 | /* The following definitions come from smbd/vfs.c */
|
---|
1174 |
|
---|
1175 | bool vfs_init_custom(connection_struct *conn, const char *vfs_object);
|
---|
1176 | bool smbd_vfs_init(connection_struct *conn);
|
---|
1177 | NTSTATUS vfs_file_exist(connection_struct *conn, struct smb_filename *smb_fname);
|
---|
1178 | ssize_t vfs_read_data(files_struct *fsp, char *buf, size_t byte_count);
|
---|
1179 | ssize_t vfs_write_data(struct smb_request *req,
|
---|
1180 | files_struct *fsp,
|
---|
1181 | const char *buffer,
|
---|
1182 | size_t N);
|
---|
1183 | ssize_t vfs_pwrite_data(struct smb_request *req,
|
---|
1184 | files_struct *fsp,
|
---|
1185 | const char *buffer,
|
---|
1186 | size_t N,
|
---|
1187 | off_t offset);
|
---|
1188 | int vfs_allocate_file_space(files_struct *fsp, uint64_t len);
|
---|
1189 | int vfs_set_filelen(files_struct *fsp, off_t len);
|
---|
1190 | int vfs_slow_fallocate(files_struct *fsp, off_t offset, off_t len);
|
---|
1191 | int vfs_fill_sparse(files_struct *fsp, off_t len);
|
---|
1192 | off_t vfs_transfer_file(files_struct *in, files_struct *out, off_t n);
|
---|
1193 | const char *vfs_readdirname(connection_struct *conn, void *p,
|
---|
1194 | SMB_STRUCT_STAT *sbuf, char **talloced);
|
---|
1195 | int vfs_ChDir(connection_struct *conn, const char *path);
|
---|
1196 | char *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn);
|
---|
1197 | NTSTATUS check_reduced_name(connection_struct *conn, const char *fname);
|
---|
1198 | NTSTATUS check_reduced_name_with_privilege(connection_struct *conn,
|
---|
1199 | const char *fname,
|
---|
1200 | struct smb_request *smbreq);
|
---|
1201 | int vfs_stat_smb_basename(struct connection_struct *conn, const char *fname,
|
---|
1202 | SMB_STRUCT_STAT *psbuf);
|
---|
1203 | NTSTATUS vfs_stat_fsp(files_struct *fsp);
|
---|
1204 | NTSTATUS vfs_chown_fsp(files_struct *fsp, uid_t uid, gid_t gid);
|
---|
1205 | NTSTATUS vfs_streaminfo(connection_struct *conn,
|
---|
1206 | struct files_struct *fsp,
|
---|
1207 | const char *fname,
|
---|
1208 | TALLOC_CTX *mem_ctx,
|
---|
1209 | unsigned int *num_streams,
|
---|
1210 | struct stream_struct **streams);
|
---|
1211 |
|
---|
1212 | /* The following definitions come from smbd/avahi_register.c */
|
---|
1213 |
|
---|
1214 | void *avahi_start_register(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
|
---|
1215 | uint16_t port);
|
---|
1216 |
|
---|
1217 | /* The following definitions come from smbd/smb2_create.c */
|
---|
1218 |
|
---|
1219 | NTSTATUS vfs_default_durable_cookie(struct files_struct *fsp,
|
---|
1220 | TALLOC_CTX *mem_ctx,
|
---|
1221 | DATA_BLOB *cookie_blob);
|
---|
1222 | NTSTATUS vfs_default_durable_disconnect(struct files_struct *fsp,
|
---|
1223 | const DATA_BLOB old_cookie,
|
---|
1224 | TALLOC_CTX *mem_ctx,
|
---|
1225 | DATA_BLOB *new_cookie);
|
---|
1226 | NTSTATUS vfs_default_durable_reconnect(struct connection_struct *conn,
|
---|
1227 | struct smb_request *smb1req,
|
---|
1228 | struct smbXsrv_open *op,
|
---|
1229 | const DATA_BLOB old_cookie,
|
---|
1230 | TALLOC_CTX *mem_ctx,
|
---|
1231 | files_struct **result,
|
---|
1232 | DATA_BLOB *new_cookie);
|
---|
1233 |
|
---|
1234 | #endif /* _SMBD_PROTO_H_ */
|
---|