cifsd-team / ksmbd

ksmbd kernel server(SMB/CIFS server)
154 stars 23 forks source link

Directory symlinks appears as junction with empty target #534

Open char101 opened 3 years ago

char101 commented 3 years ago

Hi,

When mounting ksmbd share containing directory symlinks, it is displayed as a junction, but the junction target is empty.

2021/08/25  00:23    <DIR>          .
2021/08/25  00:23    <DIR>          ..
2021/05/31  07:39    <JUNCTION>     bin [...]
2021/09/03  18:38    <DIR>          boot
2020/05/04  13:35    <DIR>          cache
2013/05/18  12:05    <DIR>          dev
2021/09/04  16:02    <DIR>          etc
2017/11/08  16:23    <DIR>          home
2021/05/31  07:39    <JUNCTION>     lib [...]
2021/05/31  07:39    <JUNCTION>     lib64 [...]
2015/11/04  12:51    <DIR>          lost+found
2013/03/15  02:20    <DIR>          mnt
2021/06/14  22:50    <DIR>          opt
2013/05/18  12:05    <DIR>          proc
2021/09/04  16:47    <DIR>          root
2013/05/18  12:46    <DIR>          run
2021/05/31  07:39    <JUNCTION>     sbin [...]
2014/04/13  10:04    <DIR>          srv
2013/05/18  12:05    <DIR>          sys
2017/12/06  10:20    <DIR>          tmp
2021/09/03  18:52    <DIR>          usr
2021/08/28  23:50    <DIR>          var
drwxr-xr-x  22 root root  4096 Aug 25 00:23 .
drwxr-xr-x  22 root root  4096 Aug 25 00:23 ..
lrwxrwxrwx   1 root root     7 May 31 07:39 bin -> usr/bin
drwxr-xr-x   4 root root  4096 Sep  3 18:38 boot
drwxr-xr-x   7 root root  4096 May  4  2020 cache
drwxr-xr-x  20 root root  3700 Sep  4 16:00 dev
drwxr-xr-x  81 root root  4096 Sep  4 16:02 etc
drwxr-xr-x   4 root root  4096 Nov  8  2017 home
lrwxrwxrwx   1 root root     7 May 31 07:39 lib -> usr/lib
lrwxrwxrwx   1 root root     7 May 31 07:39 lib64 -> usr/lib
drwx------   2 root root  4096 Nov  4  2015 lost+found
drwxr-xr-x   2 root root  4096 Mar 15  2013 mnt
drwxr-xr-x  22 root root  4096 Jun 14 22:50 opt
dr-xr-xr-x 226 root root     0 Aug 28 23:50 proc
drwxr-xr-x  51 root root  4096 Sep  4 16:47 root
drwxr-xr-x  29 root root   720 Sep  4 16:00 run
lrwxrwxrwx   1 root root     7 May 31 07:39 sbin -> usr/bin
drwxr-xr-x   5 root root  4096 Apr 13  2014 srv
dr-xr-xr-x  13 root root     0 Aug 28 23:50 sys
drwxrwxrwt  10 root root   380 Sep  4 16:45 tmp
drwxr-xr-x  10 root root  4096 Sep  3 18:52 usr
drwxr-xr-x  13 root root  4096 Aug 28 23:50 var

smb.conf

[global]
  nebios name = arch

[root]
  path = /
  force user = root
  force group = root
  create mask = 0644
  directory mask = 0755
  read only = no
  store dos attributes = no
  oplocks = no
  follow symlinks = yes
namjaejeon commented 3 years ago

Are you the result of commanding "dir" in windows? and Is it different with samba instead of ksmbd?

char101 commented 3 years ago

The dir output is just one way to verify that the directory symlinks are represented as junction.

Samba shows directory symlinks as normal directory, not junction.