const char *dname,
const char *mask,
char **_fname),
- bool (*mode_fn)(TALLOC_CTX *ctx,
- void *private_data,
- struct files_struct *dirfsp,
- struct smb_filename *smb_fname,
- bool get_dosmode,
- uint32_t *_mode),
void *private_data,
char **_fname,
struct smb_filename **_smb_fname,
continue;
}
- ok = mode_fn(ctx,
- private_data,
- dir_hnd->fsp,
- smb_fname,
- get_dosmode,
- &mode);
- if (!ok) {
- TALLOC_FREE(smb_fname);
- TALLOC_FREE(dname);
- TALLOC_FREE(fname);
- continue;
+ if (get_dosmode) {
+ mode = fdos_mode(smb_fname->fsp);
+ if (smb_fname->fsp != NULL) {
+ smb_fname->st = smb_fname->fsp->fsp_name->st;
+ }
}
done:
const char *dname,
const char *mask,
char **_fname),
- bool (*mode_fn)(TALLOC_CTX *ctx,
- void *private_data,
- struct files_struct *dirfsp,
- struct smb_filename *smb_fname,
- bool get_dosmode,
- uint32_t *_mode),
void *private_data,
char **_fname,
struct smb_filename **_smb_fname,
return false;
}
-static bool smbd_dirptr_8_3_mode_fn(TALLOC_CTX *ctx,
- void *private_data,
- struct files_struct *dirfsp,
- struct smb_filename *smb_fname,
- bool get_dosmode,
- uint32_t *_mode)
-{
- if (get_dosmode) {
- SMB_ASSERT(smb_fname != NULL);
- *_mode = fdos_mode(smb_fname->fsp);
- if (smb_fname->fsp != NULL) {
- smb_fname->st = smb_fname->fsp->fsp_name->st;
- }
- }
- return true;
-}
-
static bool get_dir_entry(TALLOC_CTX *ctx,
connection_struct *conn,
struct dptr_struct *dirptr,
ask_sharemode,
true,
smbd_dirptr_8_3_match_fn,
- smbd_dirptr_8_3_mode_fn,
conn,
&fname,
&smb_fname,
return true;
}
-static bool smbd_dirptr_lanman2_mode_fn(TALLOC_CTX *ctx,
- void *private_data,
- struct files_struct *dirfsp,
- struct smb_filename *smb_fname,
- bool get_dosmode,
- uint32_t *_mode)
-{
- if (get_dosmode) {
- SMB_ASSERT(smb_fname != NULL);
- *_mode = fdos_mode(smb_fname->fsp);
- if (smb_fname->fsp != NULL) {
- smb_fname->st = smb_fname->fsp->fsp_name->st;
- }
- }
- return true;
-}
-
static uint32_t get_dirent_ea_size(uint32_t mode, files_struct *fsp)
{
if (!(mode & FILE_ATTRIBUTE_REPARSE_POINT)) {
ask_sharemode,
get_dosmode,
smbd_dirptr_lanman2_match_fn,
- smbd_dirptr_lanman2_mode_fn,
&state,
&fname,
&smb_fname,