Skip to content

ksmbd: Map mfsymlinks to native symlinks on server side #521

@bp-rest

Description

@bp-rest

Linux client (cifs.ko) supports mount option mfsymlinks which allows Linux clients (and according to SAMBA Wiki also Apple clients) to create and resolve symlinks client-side.

It would be great if ksmbd could map those to native symlinks on the server-side filesystem rather than storing them as regular files with the "magic" content and size (Minshall+French symlinks).

As of linux 6.16 a native symlink on server-side FS is reported as inaccessible symlink on the client:

# client-side ls -l
l????????? ? ?    ?     ?            ? symlink-serverside.txt
lrwxrwxrwx 1 user group 8 Nov 16  2025 symlink-clientside.txt -> test.txt

while a valid symlink client-site is reported as a regular file server-side:

# server-side ls -l
lrwxrwxrwx 1 user group    8 Nov 16  2025 symlink-serverside.txt -> test.txt
-rwxr-xr-x 1 user group 1067 Nov 16  2025 symlink-clientside.txt

When doing server-side conversion the share-crossing security measures could be applied or not as mentioned in issue #483 depending on allow insecure wide links configuration setting (if dis-allowed, deny creation of absolute symlinks or symlinks pointing out of the share).

This would be more or less orthogonal to follow symlinks configuration option as symlinks would not be followed server-side when client has mfsymlinks enabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions