The Samba-Bugzilla – Attachment 10409 Details for
Bug 10920
NetBIOS names are not truncated at 16 chars
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
v4-2-test patch
0001-s3-nmbd-Ensure-NetBIOS-names-are-only-15-characters-.patch (text/plain), 1.57 KB, created by
Andreas Schneider
on 2014-11-05 09:58:07 UTC
(
hide
)
Description:
v4-2-test patch
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2014-11-05 09:58:07 UTC
Size:
1.57 KB
patch
obsolete
>From 78e9592ebfde6f38d853d78dd30221678c092bc1 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Fri, 31 Oct 2014 11:01:26 -0700 >Subject: [PATCH] s3: nmbd: Ensure NetBIOS names are only 15 characters stored. > >This screws up if the name is greater than MAX_NETBIOSNAME_LEN-1 in the >unix charset, but less than or equal to MAX_NETBIOSNAME_LEN-1 in the DOS >charset, but this is so old we have to live with that. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=10920 > >Signed-off-by: Jeremy Allison <jra@samba.org> >Reviewed-by: Andreas Schneider <asn@samba.org> > >(cherry picked from commit 7467f6e72cba214eeca75c34e9d9fba354c7ef31) >Signed-off-by: Andreas Schneider <asn@samba.org> >--- > source3/lib/util_names.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/source3/lib/util_names.c b/source3/lib/util_names.c >index cf54a0e..1392b48 100644 >--- a/source3/lib/util_names.c >+++ b/source3/lib/util_names.c >@@ -60,7 +60,15 @@ static bool set_my_netbios_names(const char *name, int i) > { > SAFE_FREE(smb_my_netbios_names[i]); > >- smb_my_netbios_names[i] = SMB_STRDUP(name); >+ /* >+ * Don't include space for terminating '\0' in strndup, >+ * it is automatically added. This screws up if the name >+ * is greater than MAX_NETBIOSNAME_LEN-1 in the unix >+ * charset, but less than or equal to MAX_NETBIOSNAME_LEN-1 >+ * in the DOS charset, but this is so old we have to live >+ * with that. >+ */ >+ smb_my_netbios_names[i] = SMB_STRNDUP(name, MAX_NETBIOSNAME_LEN-1); > if (!smb_my_netbios_names[i]) > return False; > return strupper_m(smb_my_netbios_names[i]); >-- >2.1.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
jra
:
review+
Actions:
View
Attachments on
bug 10920
: 10409 |
10410