diff options
author | Herb Lewis <herb@samba.org> | 2002-03-21 14:00:13 +0000 |
---|---|---|
committer | Herb Lewis <herb@samba.org> | 2002-03-21 14:00:13 +0000 |
commit | d4d9361eec11f50c780ed4c79bc9775ac24d8c0e (patch) | |
tree | f555c96fa666bc9f957729afdf6a0f398057a277 /source/smbd/dir.c | |
parent | 996cd3a0979a92b087003982bc61796a8090a787 (diff) | |
download | samba-d4d9361eec11f50c780ed4c79bc9775ac24d8c0e.tar.gz samba-d4d9361eec11f50c780ed4c79bc9775ac24d8c0e.tar.xz samba-d4d9361eec11f50c780ed4c79bc9775ac24d8c0e.zip |
return . and .. first in readdir - this fixes masktest on IRIX which
returns . then single letter files then .. then all other files.
Diffstat (limited to 'source/smbd/dir.c')
-rw-r--r-- | source/smbd/dir.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/smbd/dir.c b/source/smbd/dir.c index 3a7b697d758..40b198ed72c 100644 --- a/source/smbd/dir.c +++ b/source/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 */ |