summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/dir.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 3a7b697d75..40b198ed72 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -729,10 +729,22 @@ void *OpenDir(connection_struct *conn, char *name, BOOL use_veto)
dirp->pos = dirp->numentries = dirp->mallocsize = 0;
dirp->data = dirp->current = NULL;
- while ((n = vfs_readdirname(conn, p)))
+ while (True)
{
int l;
+ if (used == 0) {
+ n = ".";
+ } else if (used == 2) {
+ n = "..";
+ } else {
+ n = vfs_readdirname(conn, p);
+ if (n == NULL)
+ break;
+ if ((strcmp(".",n) == 0) ||(strcmp("..",n) == 0))
+ continue;
+ }
+
l = strlen(n)+1;
/* If it's a vetoed file, pretend it doesn't even exist */