Fwd: smbnetfs mounted directory is empty in MC, but works fine in Krusader, Dolphin and many others

Leon Pollak via mc <[email protected]> Thu, 22 Jun 2023 15:51:06 +0300
Newsgroups gmane.comp.gnome.apps.mc.general
Message-ID <CAM===sSQRcpkXToXzc1=op1ROHCBhermrnFSCB17WEtEZXEGQA@mail.gmail.com>
$gcc a.c -o a && ./a ~/Intern2
first read:
eee: .
eee: ..
second read:
eee: .
eee: ..

I substituted the parameter with my path to the mounted dir. And
changed your "e" to "eee" to be sure that the directory "e" on the
remote is not mixed with your sign.
Both reads are empty.
The same /media/INTERN2 is opened in Krusader correctly.

On Thu, 22 Jun 2023 at 14:57, Andrew Borodin <[email protected]> wrote:
>
> On Thu, 22 Jun 2023 13:40:50 +0300 Leon Pollak <[email protected]> wrote:
> > Thank you, Andrew.
> > I have version 4.8.29.
> > And the kernel is 6.2.15-100.fc36.x86_64.
>
> mc call rewinddir() when opens a directory:
> https://midnight-commander.org/ticket/3987
>
> Some VFSses implement(ed) rewinddir() incorrectly. For example:
> sshfs: https://github.com/libfuse/sshfs/issues/278
> mergerfs: https://github.com/trapexit/mergerfs/issues/877
>
> I think such bug is in the smbnetfs too or even in FUSE.
>
> Test case for smbnetfs:
>
> $ cat a.c
> #include <sys/types.h>
> #include <dirent.h>
> #include <stdio.h>
>
> int main(int argc, char *argv[])
> {
>     DIR * d;
>     struct dirent * e;
>
>     if (argc != 2)
>         return -1;
>
>     printf("first read:\n");
>     d = opendir(argv[1]);
>     while (e = readdir(d)) { printf("e: %s\n", e->d_name); }
>
>     printf("second read:\n");
>     rewinddir(d);
>     while (e = readdir(d)) { printf("e: %s\n", e->d_name); }
>
>     closedir(d);
>
>     return 0;
> }
> $ gcc a.c -o a && ./a ~/smb/localhost/Exchange.net
> first read:
> e: .
> e: ..
> e: aaa
> e: bbb
> second read:
> e: .
> e: ..
>
> --
> Andrew
-- 
mc mailing list
[email protected]
https://lists.midnight-commander.org/mailman/listinfo/mc