Skip to content

Conversation

@paulwkc
Copy link
Contributor

@paulwkc paulwkc commented Oct 3, 2025

When using resolve-symlinks option, directories containing broken symlinks in the output mount point are displayed with empty content.

For example, empty content :

$ mkdir -p a/b
$ touch a/b/c

# create a broken link:
$ ln -s ../d a/b

$ file a/b/*
a/b/c: empty
a/b/d: broken symbolic link to ../d

$ mkdir out
$ bindfs --resolve-symlinks a out

# empty output:
$ ls out/b
# remove d and try again:
$ rm a/b/d
$ ls out/b
c

$ fusermount -u out

Cause:

  • In bindfs_readdir(), if a symlink is not resolved, the function stops processing the readdir immediately.

Solution:

  • In the mentioned condition, continue to read stat for broken symlink and continue the readdir processing.

After the change, directory entries are correctly displayed:

$ mkdir -p a/b
$ touch a/b/c

# create a broken link:
$ ln -s ../d a/b

$ file a/b/*
a/b/c: empty
a/b/d: broken symbolic link to ../d

$ bindfs --resolve-symlinks a out

$ file out/b/*
out/b/c: empty
out/b/d: broken symbolic link to ../d

$ ls -aln */b/d
lrwxrwxrwx. 1 41136 10513 4 Oct  3 20:24 a/b/d -> ../d
lrwxrwxrwx. 1 41136 10513 4 Oct  3 20:24 out/b/d -> ../d

$ fusermount -u out

Signed-off-by: Paul WK <19663576+paulwkc@users.noreply.github.com>
@mpartel mpartel added the bug label Oct 8, 2025
mpartel added a commit that referenced this pull request Oct 8, 2025
@mpartel mpartel merged commit 11cb03f into mpartel:master Oct 8, 2025
26 of 27 checks passed
@mpartel
Copy link
Owner

mpartel commented Oct 8, 2025

Thanks!

@mpartel
Copy link
Owner

mpartel commented Oct 8, 2025

Released as 1.18.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants