1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00
Philipp Gesang 0a66c73953 s3-lib: restore truncating behavior of push_ascii_nstring()
Some users of push_ascii_nstring() (notably name_to_unstring())
expect the output to be truncated if it would exceed the size of
an nstring after conversion. However this broke in 2011 due to
commit d546adeab5 ("Change convert_string_internal() and
convert_string_error() to bool return"). This patch restores the
old behavior.

The issue can be observed in syslog after setting the
``workgroup`` to a 16+ characters long string which triggers a
DEBUG() message:

    Oct 17 11:28:45 dev nmbd[11716]: name_to_nstring: workgroup name 0123456789ABCDEF0123456789ABCDEF is too long. Truncating to

Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com>
Reviewed-by: Noel Power <npower@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Tue Oct 25 16:25:40 UTC 2022 on sn-devel-184
2022-10-25 16:25:40 +00:00
..
2018-12-11 00:40:30 +01:00
2018-07-24 20:36:49 +02:00
2018-05-12 02:09:26 +02:00
2018-08-17 11:30:10 +02:00
2016-07-28 05:00:18 +02:00
2017-05-10 15:53:20 +02:00
2019-02-28 13:53:40 +00:00
2017-02-15 02:28:16 +01:00
2017-01-22 18:30:11 +01:00
2015-10-13 01:23:07 +02:00
2019-06-20 17:18:19 +00:00
2019-06-20 17:18:19 +00:00
2020-01-19 18:29:39 +00:00
2018-07-24 20:36:50 +02:00
2022-02-18 22:17:33 +00:00
2019-02-17 13:33:13 +01:00
2016-02-23 22:03:16 +01:00
2015-03-17 11:30:52 +01:00
2017-01-22 18:30:11 +01:00
2020-12-04 21:08:38 +00:00
2022-08-26 18:54:37 +00:00
2021-01-22 19:54:38 +00:00
2021-08-24 17:32:28 +00:00
2016-12-28 20:17:12 +01:00
2021-09-21 00:13:32 +00:00
2016-01-10 22:24:17 +01:00
2016-01-10 22:24:17 +01:00
2016-12-28 20:17:13 +01:00
2018-12-20 23:40:25 +01:00
2019-02-28 13:53:40 +00:00