[Bug 90815] [smbfs] [patch] SMBFS with character conversions sometimes hangs

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Oct 13 09:35:55 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=90815

Andrey V. Elsukov <ae at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ae at FreeBSD.org

--- Comment #5 from Andrey V. Elsukov <ae at FreeBSD.org> ---
(In reply to Tomoaki AOKI from comment #4)
> Without this, `cp -a` stoppes (running but in infinite loop?) on directory
> containing Japanese (UTF-8) filename if any conversion is specified (even if
> it's UTF-8:UTF-8).
> 
> Can someone confirm and commit?

If I understand the code correctly, with such patch you can get a mix of
partially converted name with the remaining unconverted part. It may lead to
unpredictable results for charsets with different character length, I guess. 
Maybe it will be better to fix iconv? Or what if smb_copy_conv() will use some
reasonable error code? Can you test this patch?

--- a/sys/netsmb/smb_subr.c
+++ b/sys/netsmb/smb_subr.c
@@ -334,7 +334,7 @@ smb_copy_iconv(struct mbchain *mbp, c_caddr_t src, caddr_t
dst,
                *dstlen -= outlen;
                return 0;
        } else
-               return error;
+               return (EINVAL);
 }

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-fs mailing list