The branch, master has been updated
       via  7467f6e s3: nmbd: Ensure NetBIOS names are only 15 characters 
stored.
      from  a6353fd Fix typo in docs-xml/manpages/net.8.xml

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 7467f6e72cba214eeca75c34e9d9fba354c7ef31
Author: Jeremy Allison <[email protected]>
Date:   Fri Oct 31 11:01:26 2014 -0700

    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.
    
    Signed-off-by: Jeremy Allison <[email protected]>
    Reviewed-by: Andreas Schneider <[email protected]>
    
    Autobuild-User(master): Andreas Schneider <[email protected]>
    Autobuild-Date(master): Tue Nov  4 18:23:11 CET 2014 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 source3/lib/util_names.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

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]);


-- 
Samba Shared Repository

Reply via email to