summaryrefslogtreecommitdiff
path: root/source4/ntvfs/simple/svfs_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/ntvfs/simple/svfs_util.c')
-rw-r--r--source4/ntvfs/simple/svfs_util.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/source4/ntvfs/simple/svfs_util.c b/source4/ntvfs/simple/svfs_util.c
index baa6f86d94..598b85f1ad 100644
--- a/source4/ntvfs/simple/svfs_util.c
+++ b/source4/ntvfs/simple/svfs_util.c
@@ -52,9 +52,8 @@ char *svfs_unix_path(struct request_context *req, const char *name)
returned names are separate unix and DOS names. The returned names
are relative to the directory
*/
-struct svfs_dir *svfs_list(TALLOC_CTX *mem_ctx, struct request_context *req, const char *pattern)
+struct svfs_dir *svfs_list_unix(TALLOC_CTX *mem_ctx, struct request_context *req, const char *unix_path)
{
- char *unix_path;
char *p, *mask;
struct svfs_dir *dir;
DIR *odir;
@@ -62,9 +61,6 @@ struct svfs_dir *svfs_list(TALLOC_CTX *mem_ctx, struct request_context *req, con
uint_t allocated = 0;
char *low_mask;
- unix_path = svfs_unix_path(req, pattern);
- if (!unix_path) { return NULL; }
-
dir = talloc(mem_ctx, sizeof(struct svfs_dir));
if (!dir) { return NULL; }
@@ -93,6 +89,11 @@ struct svfs_dir *svfs_list(TALLOC_CTX *mem_ctx, struct request_context *req, con
char *full_name;
char *low_name;
+ if (strchr(dent->d_name, ':') && !strchr(unix_path, ':')) {
+ /* don't show streams in dir listing */
+ continue;
+ }
+
low_name = talloc_strdup(mem_ctx, dent->d_name);
if (!low_name) { continue; }
strlower(low_name);
@@ -129,6 +130,21 @@ struct svfs_dir *svfs_list(TALLOC_CTX *mem_ctx, struct request_context *req, con
return dir;
}
+/*
+ read a directory and find all matching file names and stat info
+ returned names are separate unix and DOS names. The returned names
+ are relative to the directory
+*/
+struct svfs_dir *svfs_list(TALLOC_CTX *mem_ctx, struct request_context *req, const char *pattern)
+{
+ char *unix_path;
+
+ unix_path = svfs_unix_path(req, pattern);
+ if (!unix_path) { return NULL; }
+
+ return svfs_list_unix(mem_ctx, req, unix_path);
+}
+
/*******************************************************************
set the time on a file via file descriptor