1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
samba-mirror/source3/param
Shyamsunder Rathi 0fa490e847 s3:loadparm: Ensure to truncate FS Volume Label at multibyte boundary
For FS_VOLUME_INFO/FS_INFO operation, a maximum of 32 characters are
sent back. However, since Samba chops off any share name with >32
bytes at 32, it is possible that a multi-byte share name can get chopped
off between a full character. This causes the string decoding for unicode
failure which sends back NT_STATUS_ILLEGAL_CHARACTER (EILSEQ) to the client
applications.

On Windows, Notepad doesn't like it, and refuses to open a file in this
case and fails with the following error:

  Invalid character. For multibyte character sets, only the leading byte is
  included without the trailing byte. For Unicode character sets, include
  the characters 0xFFFF and 0xFFFE.

Proposed fix:
- Find the last starting point of a multibyte codepoint if the character
  at 32nd byte is a subsequent byte of a MB codepoint.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13947

Signed-off-by: Shyamsunder Rathi <shyam.rathi@nutanix.com>
Reviewed-by: Hemanth Thummala <hemanth.thummala@nutanix.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2019-05-16 17:55:18 +00:00
..
loadparm_ctx.c s3:param: use lp_load_no_reinit() in lp_load_for_s4_ctx() 2015-04-22 13:57:30 +02:00
loadparm.c s3:loadparm: Ensure to truncate FS Volume Label at multibyte boundary 2019-05-16 17:55:18 +00:00
pyparam.c s3: squash 'cast between incompatible function types' warning 2019-05-16 17:55:17 +00:00
service.c s3:smbd: Make sure we do not export "/" (root) as home dir 2018-12-05 01:38:14 +01:00
test_lp_load.c s3:param: Use C99 initializer for poptOption in test_lp_load 2019-01-28 10:29:15 +01:00
util.c Change all uses of uint32/16/8 in proto.h to uint32_t/16_t/8_t. 2015-04-29 23:42:20 +02:00
wscript_build build: Remove bld.gen_python_environments() 2019-03-21 04:06:14 +00:00