mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s3: smbd: Change is_visible_file() to take a directory handle not a name.
No change in functionality as the name is easily retrieved from the directory handle (it's always the name we opened the directory with) and this will allow us to use the directory handle fsp later. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
668ef24701
commit
2243ba78d9
@ -833,7 +833,7 @@ bool recursive_rmdir(TALLOC_CTX *ctx,
|
||||
}
|
||||
|
||||
if (!is_visible_file(conn,
|
||||
smb_dname,
|
||||
dir_hnd,
|
||||
dname,
|
||||
&st,
|
||||
false)) {
|
||||
@ -973,7 +973,7 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, files_struct *fsp)
|
||||
continue;
|
||||
}
|
||||
if (!is_visible_file(conn,
|
||||
smb_dname,
|
||||
dir_hnd,
|
||||
dname,
|
||||
&st,
|
||||
false)) {
|
||||
@ -1011,7 +1011,7 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, files_struct *fsp)
|
||||
continue;
|
||||
}
|
||||
if (!is_visible_file(conn,
|
||||
smb_dname,
|
||||
dir_hnd,
|
||||
dname,
|
||||
&st,
|
||||
false)) {
|
||||
|
@ -408,7 +408,7 @@ static const char *dptr_normal_ReadDirName(struct dptr_struct *dptr,
|
||||
while ((name = ReadDirName(dptr->dir_hnd, poffset, pst, &talloced))
|
||||
!= NULL) {
|
||||
if (is_visible_file(dptr->conn,
|
||||
dptr->smb_dname,
|
||||
dptr->dir_hnd,
|
||||
name,
|
||||
pst,
|
||||
true)) {
|
||||
@ -466,7 +466,7 @@ static char *dptr_ReadDirName(TALLOC_CTX *ctx,
|
||||
|
||||
/* First check if it should be visible. */
|
||||
if (!is_visible_file(dptr->conn,
|
||||
dptr->smb_dname,
|
||||
dptr->dir_hnd,
|
||||
dptr->wcard,
|
||||
pst,
|
||||
true)) {
|
||||
@ -1209,7 +1209,7 @@ static bool file_is_special(connection_struct *conn,
|
||||
********************************************************************/
|
||||
|
||||
bool is_visible_file(connection_struct *conn,
|
||||
struct smb_filename *dir_path,
|
||||
struct smb_Dir *dir_hnd,
|
||||
const char *name,
|
||||
SMB_STRUCT_STAT *pst,
|
||||
bool use_veto)
|
||||
@ -1219,6 +1219,7 @@ bool is_visible_file(connection_struct *conn,
|
||||
bool hide_special = lp_hide_special_files(SNUM(conn));
|
||||
int hide_new_files_timeout = lp_hide_new_files_timeout(SNUM(conn));
|
||||
char *entry = NULL;
|
||||
struct smb_filename *dir_path = dir_hnd->fsp->fsp_name;
|
||||
struct smb_filename *smb_fname_base = NULL;
|
||||
bool ret = false;
|
||||
|
||||
@ -1761,7 +1762,7 @@ NTSTATUS can_delete_directory_fsp(files_struct *fsp)
|
||||
}
|
||||
|
||||
if (!is_visible_file(conn,
|
||||
fsp->fsp_name,
|
||||
dir_hnd,
|
||||
dname,
|
||||
&st,
|
||||
True)) {
|
||||
|
@ -224,8 +224,9 @@ bool get_dir_entry(TALLOC_CTX *ctx,
|
||||
struct timespec *date,
|
||||
bool check_descend,
|
||||
bool ask_sharemode);
|
||||
struct smb_Dir;
|
||||
bool is_visible_file(connection_struct *conn,
|
||||
struct smb_filename *dir_path,
|
||||
struct smb_Dir *dir_hnd,
|
||||
const char *name,
|
||||
SMB_STRUCT_STAT *pst,
|
||||
bool use_veto);
|
||||
|
@ -3470,7 +3470,7 @@ NTSTATUS unlink_internals(connection_struct *conn, struct smb_request *req,
|
||||
TALLOC_CTX *frame = talloc_stackframe();
|
||||
|
||||
if (!is_visible_file(conn,
|
||||
smb_fname_dir,
|
||||
dir_hnd,
|
||||
dname,
|
||||
&smb_fname->st,
|
||||
true)) {
|
||||
@ -8147,7 +8147,7 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
|
||||
}
|
||||
|
||||
if (!is_visible_file(conn,
|
||||
smb_fname_src_dir,
|
||||
dir_hnd,
|
||||
dname,
|
||||
&smb_fname_src->st,
|
||||
false)) {
|
||||
@ -8892,7 +8892,7 @@ void reply_copy(struct smb_request *req)
|
||||
}
|
||||
|
||||
if (!is_visible_file(conn,
|
||||
smb_fname_src_dir,
|
||||
dir_hnd,
|
||||
dname,
|
||||
&smb_fname_src->st,
|
||||
false)) {
|
||||
|
Loading…
Reference in New Issue
Block a user