aboutsummaryrefslogtreecommitdiffstats
path: root/example/passthrough_hp.cc
diff options
context:
space:
mode:
authorJoanne Koong <joannelkoong@gmail.com>2024-07-05 14:54:15 -0700
committerBernd Schubert <bernd.schubert@fastmail.fm>2024-07-08 23:29:57 +0200
commit170edc6a8ef0ce8b7aa2b498b101f0de29b35757 (patch)
tree0f40baf1a267bce2adaf7c7c0777782691b659b3 /example/passthrough_hp.cc
parent366f6a6a9afa6139bae3f3061e32eda7d6c085c1 (diff)
downloadlibfuse-170edc6a8ef0ce8b7aa2b498b101f0de29b35757.tar.gz
passthrough_hp: include . and .. in readdir
generic/401 fails currently because it checks that "." and ".." are listed as directory entries. Include "." and ".." as listed directory entries in passthrough_hp's readdir implementation. Signed-off by: Joanne Koong <joannelkoong@gmail.com>
Diffstat (limited to 'example/passthrough_hp.cc')
-rw-r--r--example/passthrough_hp.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/example/passthrough_hp.cc b/example/passthrough_hp.cc
index 02f77f5..e3c8225 100644
--- a/example/passthrough_hp.cc
+++ b/example/passthrough_hp.cc
@@ -747,15 +747,20 @@ static void do_readdir(fuse_req_t req, fuse_ino_t ino, size_t size,
break; // End of stream
}
d->offset = entry->d_off;
- if (is_dot_or_dotdot(entry->d_name))
- continue;
fuse_entry_param e{};
size_t entsize;
if (plus) {
- err = do_lookup(ino, entry->d_name, &e);
- if (err)
- goto error;
+ if (is_dot_or_dotdot(entry->d_name)) {
+ /* fuse kernel ignores attributes for these and also does
+ * not increase lookup count (see fuse_direntplus_link) */
+ e.attr.st_ino = entry->d_ino;
+ e.attr.st_mode = entry->d_type << 12;
+ } else {
+ err = do_lookup(ino, entry->d_name, &e);
+ if (err)
+ goto error;
+ }
entsize = fuse_add_direntry_plus(req, p, rem, entry->d_name, &e, entry->d_off);
} else {
e.attr.st_ino = entry->d_ino;