2 * Unix SMB/Netbios implementation.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef _SOURCE3_SMBD_DIR_H_
19 #define _SOURCE3_SMBD_DIR_H_
26 NTSTATUS
can_delete_directory_fsp(files_struct
*fsp
);
27 struct files_struct
*dir_hnd_fetch_fsp(struct smb_Dir
*dir_hnd
);
28 uint16_t dptr_attr(struct smbd_server_connection
*sconn
, int key
);
29 bool dptr_case_sensitive(struct dptr_struct
*dptr
);
30 void dptr_closecnum(connection_struct
*conn
);
31 void dptr_CloseDir(files_struct
*fsp
);
32 NTSTATUS
dptr_create(connection_struct
*conn
,
33 struct smb_request
*req
,
38 struct dptr_struct
**dptr_ret
);
39 int dptr_dnum(struct dptr_struct
*dptr
);
40 files_struct
*dptr_fetch_lanman2_fsp(struct smbd_server_connection
*sconn
,
42 unsigned int dptr_FileNumber(struct dptr_struct
*dptr
);
43 bool dptr_get_priv(struct dptr_struct
*dptr
);
44 bool dptr_has_wild(struct dptr_struct
*dptr
);
45 const char *dptr_path(struct smbd_server_connection
*sconn
, int key
);
46 char *dptr_ReadDirName(TALLOC_CTX
*ctx
, struct dptr_struct
*dptr
);
47 void dptr_RewindDir(struct dptr_struct
*dptr
);
48 void dptr_set_priv(struct dptr_struct
*dptr
);
49 const char *dptr_wcard(struct smbd_server_connection
*sconn
, int key
);
50 bool have_file_open_below(struct files_struct
*fsp
);
51 bool opens_below_forall(struct connection_struct
*conn
,
52 const struct smb_filename
*dir_name
,
53 int (*fn
)(struct share_mode_data
*data
,
54 struct share_mode_entry
*e
,
57 bool opens_below_forall_read(struct connection_struct
*conn
,
58 const struct smb_filename
*dir_name
,
59 int (*fn
)(const struct share_mode_data
*data
,
60 const struct share_mode_entry
*e
,
63 bool init_dptrs(struct smbd_server_connection
*sconn
);
64 bool is_visible_fsp(files_struct
*fsp
);
65 NTSTATUS
OpenDir(TALLOC_CTX
*mem_ctx
,
66 connection_struct
*conn
,
67 const struct smb_filename
*smb_dname
,
70 struct smb_Dir
**_dir_hnd
);
71 NTSTATUS
OpenDir_from_pathref(TALLOC_CTX
*mem_ctx
,
72 struct files_struct
*dirfsp
,
75 struct smb_Dir
**_dir_hnd
);
76 const char *ReadDirName(struct smb_Dir
*dir_hnd
, char **talloced
);
77 void RewindDir(struct smb_Dir
*dir_hnd
);
78 bool smbd_dirptr_get_entry(TALLOC_CTX
*ctx
,
79 struct dptr_struct
*dirptr
,
85 bool (*match_fn
)(TALLOC_CTX
*ctx
,
92 struct smb_filename
**_smb_fname
,
94 char *smbd_dirptr_get_last_name_sent(struct dptr_struct
*dirptr
);
95 void smbd_dirptr_push_overflow(struct dptr_struct
*dirptr
,
97 struct smb_filename
**_smb_fname
,
99 void smbd_dirptr_set_last_name_sent(struct dptr_struct
*dirptr
, char **_fname
);