CIFS and symlinks

If none of the more specific forums is the right place to ask

CIFS and symlinks

Postby phelum » 2020-08-25 18:16

Hi,
I've just installed Debian 10 (10.5-netinst.amd64) on a PC and find that remote symlinks are not displayed correctly.. The remote volume is ext4 on an ARM device running stretch. Other systems (all running various Debian versions) display these remote symlinks as (probably invalid) symlinks and I believe this is correct and sensible. But the new system apparently tries to resolve these symlinks. If a local target file exists its directory details are displayed. If the symlink can't be resolved it won't appear in the directory listing. I'm using "ls" (command) and "mc" (program) to view this remote volume. I'm using mount.cifs to mount the volume and the command is the same as used on other systems.

Can anybody tell me how I can stop the new installation from automatically resolving these remote symlinks ?

Thanks,
Steven
phelum
 
Posts: 3
Joined: 2020-08-25 17:37
Location: Sydney, Australia

Re: CIFS and symlinks

Postby dilberts_left_nut » 2020-08-25 19:53

Please provide evidence, not descriptions of evidence.
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 5074
Joined: 2009-10-05 07:54
Location: enzed

Re: CIFS and symlinks

Postby phelum » 2020-08-25 20:48

dilberts_left_nut wrote:Please provide evidence, not descriptions of evidence.


Here are two "ls" results. Both reference the same directory on the remote volume.

From any other system (all running debian):
ls -l /srv/pc202/etc/alternatives
total 104
lrwxrwxrwx 1 root root 21 Jul 13 2014 aclocal -> /usr/bin/aclocal-1.11
lrwxrwxrwx 1 root root 37 Jul 13 2014 aclocal.1.gz -> /usr/share/man/man1/aclocal-1.11.1.gz
lrwxrwxrwx 1 root root 20 Jul 31 2014 animate -> /usr/bin/animate.im6
lrwxrwxrwx 1 root root 36 Jul 31 2014 animate.1.gz -> /usr/share/man/man1/animate.im6.1.gz
lrwxrwxrwx 1 root root 24 May 24 2014 aptitude -> /usr/bin/aptitude-curses
lrwxrwxrwx 1 root root 40 May 24 2014 aptitude.8.gz -> /usr/share/man/man8/aptitude-curses.8.gz
lrwxrwxrwx 1 root root 22 Jul 13 2014 automake -> /usr/bin/automake-1.11
lrwxrwxrwx 1 root root 38 Jul 13 2014 automake.1.gz -> /usr/share/man/man1/automake-1.11.1.gz
lrwxrwxrwx 1 root root 13 Aug 13 2014 awk -> /usr/bin/gawk
lrwxrwxrwx 1 root root 29 Aug 13 2014 awk.1.gz -> /usr/share/man/man1/gawk.1.gz
lrwxrwxrwx 1 root root 38 Oct 29 2016 builtins.7.gz -> /usr/share/man/man7/bash-builtins.7.gz
lrwxrwxrwx 1 root root 12 May 24 2014 c++ -> /usr/bin/g++
lrwxrwxrwx 1 root root 16 May 24 2014 c89 -> /usr/bin/c89-gcc
lrwxrwxrwx 1 root root 32 May 24 2014 c89.1.gz -> /usr/share/man/man1/c89-gcc.1.gz
lrwxrwxrwx 1 root root 16 May 24 2014 c99 -> /usr/bin/c99-gcc
lrwxrwxrwx 1 root root 32 May 24 2014 c99.1.gz -> /usr/share/man/man1/c99-gcc.1.gz
lrwxrwxrwx 1 root root 12 May 24 2014 cc -> /usr/bin/gcc

From the new system (debian 10.5 amd64 on Dell PC):
ls -l /srv/pc202/etc/alternatives
total 70656
-rwxr-xr-x 1 root root 2706684 Apr 19 2017 aptitude
-rwxr-xr-x 1 root root 14414 Apr 19 2017 aptitude.8.gz
-rwxr-xr-x 1 root root 446640 Jan 26 2017 awk
-rwxr-xr-x 1 root root 28846 Jan 26 2017 awk.1.gz
-rwxr-xr-x 1 root root 508 May 16 2017 builtins.7.gz
-rwxr-xr-x 1 root root 631296 Feb 15 2018 c++
-rwxr-xr-x 1 root root 428 Jun 13 2013 c89
-rwxr-xr-x 1 root root 1365 Jun 13 2013 c89.1.gz
-rwxr-xr-x 1 root root 454 Jun 13 2013 c99
-rwxr-xr-x 1 root root 1420 Apr 9 2017 c99.1.gz
-rwxr-xr-x 1 root root 627200 Feb 15 2018 cc
-rwxr-xr-x 1 root root 627200 Feb 15 2018 cpp

I've truncated both lists for brevity. The new system appears to have resolved the symlinks to local files. Non-symlink files on this remote volume are correct. All files on this remote volume are marked as executable which is definitely not correct.

Thanks,
Steven
phelum
 
Posts: 3
Joined: 2020-08-25 17:37
Location: Sydney, Australia

Re: CIFS and symlinks

Postby phelum » 2020-08-27 19:38

I've just discovered I can get symlinks support with CIFS if I specify "vers=1.0" in the mount.cifs command. For some reason POSIX EXTENSIONS aren't enabled with any more secure CIFS connection mode.

/proc/fs/cifs/DebugData (with "vers=1.0" in mount command):
Display Internal CIFS Data Structures for Debugging
---------------------------------------------------
CIFS Version 2.13
Features: DFS,FSCACHE,STATS,DEBUG,ALLOW_INSECURE_LEGACY,WEAK_PW_HASH,CIFS_POSIX,UPCALL(SPNEGO),XATTR,ACL
Active VFS Requests: 0
Servers:
Number of credits: 50 Dialect 0x2
1) Name: 220.233.7.85 Domain: WORKGROUP Uses: 1 OS: Windows 6.1
NOS: Samba 4.5.16-Debian Capability: 0x80f3fd
SMB session status: 1 TCP status: 1
Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
Shares:
0) IPC: \\cloud\IPC$ Mounts: 1 Type: DevInfo: 0x0 Attributes: 0x0
PathComponentMax: 0 Status: 1 type: 0

1) \\cloud\srv Mounts: 1 Type: NTFS DevInfo: 0x20 Attributes: 0x1006f
PathComponentMax: 255 Status: 1 type: DISK POSIX Extensions

/proc/fs/cifs/DebugData (without "vers=1.0" in mount command):
Display Internal CIFS Data Structures for Debugging
---------------------------------------------------
CIFS Version 2.13
Features: DFS,FSCACHE,STATS,DEBUG,ALLOW_INSECURE_LEGACY,WEAK_PW_HASH,CIFS_POSIX,UPCALL(SPNEGO),XATTR,ACL
Active VFS Requests: 0
Servers:
Number of credits: 53 Dialect 0x202
1) Name: 220.233.7.85 Uses: 1 Capability: 0x300001 Session Status: 1 TCP status: 1
Local Users To Server: 1 SecMode: 0x1 Req On Wire: 0
Shares:
0) IPC: \\cloud\IPC$ Mounts: 1 DevInfo: 0x0 Attributes: 0x0
PathComponentMax: 0 Status: 1 type: 0

1) \\cloud\srv Mounts: 1 DevInfo: 0x20 Attributes: 0x1006f
PathComponentMax: 255 Status: 1 type: DISK

MIDs:

Notice that POSIX EXTENSIONS doesn't appear in the second list.
I guess this means I have to use the less secure mode with this client running buster.

-- Steven
phelum
 
Posts: 3
Joined: 2020-08-25 17:37
Location: Sydney, Australia


Return to General Questions

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable