• Pali Rohár's avatar
    cifs: Fix creating native symlinks pointing to current or parent directory · 63271b7d
    Pali Rohár authored
    Calling 'ln -s . symlink' or 'ln -s .. symlink' creates symlink pointing to
    some object name which ends with U+F029 unicode codepoint. This is because
    trailing dot in the object name is replaced by non-ASCII unicode codepoint.
    
    So Linux SMB client currently is not able to create native symlink pointing
    to current or parent directory on Windows SMB server which can be read by
    either on local Windows server or by any other SMB client which does not
    implement compatible-reverse character replacement.
    
    Fix this problem in cifsConvertToUTF16() function which is doing that
    character replacement. Function comment already says that it does not need
    to handle special cases '.' and '..', but after introduction of native
    symlinks in reparse point form, this handling is needed.
    
    Note that this change depends on the previous change
    "cifs: Improve creating native symlinks pointing to directory".
    Signed-off-by: default avatarPali Rohár <pali@kernel.org>
    Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
    63271b7d
cifs_unicode.c 16 KB