diff options
author | Dimitri Staessens <[email protected]> | 2023-11-18 16:32:55 +0100 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2023-11-20 13:19:48 +0100 |
commit | a37d4f406a4c6d39dbd6ff137dcd5a8047397d73 (patch) | |
tree | c7871b1018598ddc53d4fecfb893ee865e3759f3 /src/lib/rib.c | |
parent | eacf47723eb7084f6f067ad30bb58c163a7c918a (diff) | |
download | ouroboros-a37d4f406a4c6d39dbd6ff137dcd5a8047397d73.tar.gz ouroboros-a37d4f406a4c6d39dbd6ff137dcd5a8047397d73.zip |
lib: Fix FUSE output on Raspbian
For some reason, 'ls' on raspbian invoked the fuse readdir() in a loop
where the first call had fuse_file_info * info set to NULL and
subsequent calls had info->nonseekable set to 1. Since we don't check
the value the info struct, this caused an infinite loop when trying to
list the contents of the fuse filesystem subdirectories of
/tmp/ouroboros/.
Signed-off-by: Dimitri Staessens <[email protected]>
Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src/lib/rib.c')
-rw-r--r-- | src/lib/rib.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/rib.c b/src/lib/rib.c index 22b57fb7..78ae82ef 100644 --- a/src/lib/rib.c +++ b/src/lib/rib.c @@ -139,6 +139,10 @@ static int rib_readdir(const char * path, (void) offset; (void) info; + /* Fix ls calling readdir in an infinite loop on raspbian. */ + if (info != NULL && info->nonseekable != 0) + return -ENOENT; + filler(buf, ".", NULL, 0); filler(buf, "..", NULL, 0); |