summaryrefslogtreecommitdiff
path: root/source4/ntvfs/simple/svfs_util.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-04-06 08:02:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:50:41 -0500
commit19680ba4df36400cc8834795434118960d5cafc4 (patch)
treea96381d47adc41dfb7317ac781fc423898ee6b98 /source4/ntvfs/simple/svfs_util.c
parentf9235e0964d921cc1df7b4c4b7ab91a1c1ab4d54 (diff)
downloadsamba-19680ba4df36400cc8834795434118960d5cafc4.tar.gz
samba-19680ba4df36400cc8834795434118960d5cafc4.tar.bz2
samba-19680ba4df36400cc8834795434118960d5cafc4.zip
r65: added support for file streams in the simple NTVFS backend
(This used to be commit 9a9cc44a05510a69ad902db4d01dc12b6ac4f8ba)
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