aboutsummaryrefslogtreecommitdiff
path: root/lib/fuse.c
diff options
context:
space:
mode:
authorJean-Pierre André <jpandre@users.noreply.github.com>2021-03-18 10:52:30 +0100
committerGitHub <noreply@github.com>2021-03-18 09:52:30 +0000
commitbdd2d4110fbc6d2059eb699efad2cca4a7eacccb (patch)
tree62ca0ce9b94529a68e376922963993606af2f35a /lib/fuse.c
parent77d662459a0fcdf358d515477d33795837e859d5 (diff)
downloadlibfuse-bdd2d4110fbc6d2059eb699efad2cca4a7eacccb.tar.gz
Fix returning d_ino and d_type by readdir(3) in non-plus mode
When not using the readdir_plus mode, the d_type was not returned, and the use_ino flag was not used for returning d_ino. This patch fixes the returned values for d_ino and d_type by readdir(3) The test for the returned value of d_ino has been adjusted to also take the d_type into consideration and to check the returned values in both basic readdir and readdir_plus modes. This is done by executing the passthrough test twice. Co-authored-by: Jean-Pierre André <jpandre@users.sourceforge.net>
Diffstat (limited to 'lib/fuse.c')
-rwxr-xr-xlib/fuse.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/fuse.c b/lib/fuse.c
index 737456e..a95d7c1 100755
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -3578,6 +3578,11 @@ static int fill_dir_plus(void *dh_, const char *name, const struct stat *statp,
}
} else {
e.attr.st_ino = FUSE_UNKNOWN_INO;
+ if (statp) {
+ e.attr.st_mode = statp->st_mode;
+ if (f->conf.use_ino)
+ e.attr.st_ino = statp->st_ino;
+ }
if (!f->conf.use_ino && f->conf.readdir_ino) {
e.attr.st_ino = (ino_t)
lookup_nodeid(f, dh->nodeid, name);