The Samba-Bugzilla – Bug 6496
libsmbclient: MS-DFS: cannot follow multibyte char link name
Last modified: 2009-09-09 05:32:33 UTC
If a MS-DFS link name has multibyte character, smbclient (libsmb) cannot follow it.
I'll post a patch later.
Created attachment 4340 [details]
[PATCH] libsmb: MS-DFS: cannot follow multibyte char link name
Calculate the byte of consumed path in UNIX charset.
Created attachment 4341 [details]
[PATCH] libsmbclient: MS-DFS: cannot follow multibyte char link name
Remake with `set noexpandtab` in vi.
Thanks for this. I'm sick at home at the moment. I'll get to this as soon as I'm able.
Ok, I don't understand this patch. Can you explain more please.
The patch to cli_dfs_get_referral() stores the base pointer to the ucs2 conversion of the path string in path_ucs, then uses pull_string_talloc() to pull that ucs2 version of that string back to UNIX charset into the variable consumed_path. However, the call to pull_string_talloc() uses the flag STR_TERMINATE, which will cause pull_string_talloc() to ignore the passed in length value of consumed_ucs and just look for the two '\0' string terminator bytes of the ucs2 string.
This means the string in consumed_path will be equal to the string in path, meaning there was no point to that code at all.
I need to understand this change much better before I can apply this patch.
Created attachment 4367 [details]
Slightly modified patch.
Can you test this patch please, as I think this might be more correct (correctly sets flags in the pull_string_talloc() call).
Created attachment 4371 [details]
Revised patch for v3-2-test
I confirmed your patch with the following changes fixed this bug
on Samba 3.2.8.
* Remove the commnet '/* Number of bytes of "path" consumed. */'
that confuses samba-3.X.Y/source/script/mkproto.awk (X <= 2).
* Do not free param by 'SAFE_FREE(param)' after cli_send_trans()
call because param contains path_ucs that is referred later.
Thanks for those fixes (and looking carefully at the changed patch). I'll push this to master. It will need review for 3.4.0, I'll ask for it but I'm not sure we can do this in time.
Raise version as it's a 3.4 issue also.
Volker, shall I pick that one for 3.4.0?
Sorry, can't take time right now to review this in time for 3.4. At least by a quick glance I did not understand what's going on, so I'll have to spend more time on this patch to review it.
This is not a show stopper for 3.4.0 IMHO. We could pick it as part of the first 3.4.1 bugfix release.
Comment on attachment 4371 [details]
Revised patch for v3-2-test
Jeremy, could you please review?
+1. Assigning to Karolin for inclusion in 3.4.1 (this one should have gotten pushed a while ago, sorry for the delay caused by my vacation).
Created attachment 4663 [details]
git-am format patch for 3.4.1.
Pushed, will be included in 3.4.1.
Closing out bug report.