Return the next visible file name, skipping veto'd and invisible files.
****************************************************************************/
-char *dptr_ReadDirName(TALLOC_CTX *ctx,
- struct dptr_struct *dptr,
- SMB_STRUCT_STAT *pst)
+char *dptr_ReadDirName(TALLOC_CTX *ctx, struct dptr_struct *dptr)
{
+ struct stat_ex st = {
+ .st_ex_nlink = 0,
+ };
struct smb_Dir *dir_hnd = dptr->dir_hnd;
struct files_struct *dir_fsp = dir_hnd->fsp;
struct smb_filename *dir_name = dir_fsp->fsp_name;
int ret;
int flags = 0;
- SET_STAT_INVALID(*pst);
-
if (dptr->has_wild) {
const char *name_temp = NULL;
char *talloced = NULL;
- name_temp = ReadDirName(dir_hnd, pst, &talloced);
+ name_temp = ReadDirName(dir_hnd, &st, &talloced);
if (name_temp == NULL) {
return NULL;
}
flags |= AT_SYMLINK_NOFOLLOW;
}
- ret = SMB_VFS_FSTATAT(dptr->conn, dir_fsp, &smb_fname_base, pst, flags);
+ ret = SMB_VFS_FSTATAT(dptr->conn, dir_fsp, &smb_fname_base, &st, flags);
if (ret == 0) {
return talloc_strdup(ctx, dptr->wcard);
}
slashlen = ( dpath[pathlen-1] != '/') ? 1 : 0;
while (true) {
- SMB_STRUCT_STAT sbuf = { 0 };
char *dname = NULL;
bool isdots;
char *fname = NULL;
bool get_dosmode = get_dosmode_in;
bool ok;
- dname = dptr_ReadDirName(ctx, dirptr, &sbuf);
+ dname = dptr_ReadDirName(ctx, dirptr);
DBG_DEBUG("dir [%s] dirptr [%p] offset [%u] => "
"dname [%s]\n",
bool dptr_get_priv(struct dptr_struct *dptr);
void dptr_set_priv(struct dptr_struct *dptr);
bool dptr_case_sensitive(struct dptr_struct *dptr);
-char *dptr_ReadDirName(TALLOC_CTX *ctx,
- struct dptr_struct *dptr,
- SMB_STRUCT_STAT *pst);
+char *dptr_ReadDirName(TALLOC_CTX *ctx, struct dptr_struct *dptr);
struct smb_Dir;
struct files_struct *dir_hnd_fetch_fsp(struct smb_Dir *dir_hnd);
files_struct *dptr_fetch_lanman2_fsp(struct smbd_server_connection *sconn,