FreeBSD Bugzilla – Attachment 135523 Details for
Bug 180438
[smbfs] [patch] mount_smbfs fails on arm because of wrong endianess assumption in libsmb
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.41 KB, created by
rz-rpi03
on 2013-07-10 16:40:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
rz-rpi03
Created:
2013-07-10 16:40:00 UTC
Size:
2.41 KB
patch
obsolete
>Index: contrib/smbfs/lib/smb/nb_name.c >=================================================================== >--- contrib/smbfs/lib/smb/nb_name.c (revision 252777) >+++ contrib/smbfs/lib/smb/nb_name.c (working copy) >@@ -143,18 +143,9 @@ > return len; > } > >-#define NBENCODE(c) (htole16((u_short)(((u_char)(c) >> 4) | \ >- (((u_char)(c) & 0xf) << 8)) + 0x4141)) >+#define NBENCODEHIGH(c) (0x41 + (u_char)(((c) & 0xF0) >> 4)) >+#define NBENCODELOW(c) (0x41 + (u_char)((c) & 0x0F)) > >-static void >-memsetw(char *dst, int n, u_short word) >-{ >- while (n--) { >- *(u_short*)dst = word; >- dst += 2; >- } >-} >- > int > nb_name_encode(struct nb_name *np, u_char *dst) > { >@@ -165,19 +156,25 @@ > *cp++ = NB_ENCNAMELEN; > name = np->nn_name; > if (name[0] == '*' && name[1] == 0) { >- *(u_short*)cp = NBENCODE('*'); >- memsetw(cp + 2, NB_NAMELEN - 1, NBENCODE(' ')); >- cp += NB_ENCNAMELEN; >+ *cp++ = NBENCODEHIGH('*'); >+ *cp++ = NBENCODELOW('*'); >+ i = NB_NAMELEN - 1; >+ while (i-- > 0) { >+ *cp++ = NBENCODEHIGH(' '); >+ *cp++ = NBENCODELOW(' '); >+ } > } else { >- for (i = 0; *name && i < NB_NAMELEN - 1; i++, cp += 2, name++) >- *(u_short*)cp = NBENCODE(toupper(*name)); >+ for (i = 0; *name && i < NB_NAMELEN - 1; i++, name++) { >+ *cp++ = NBENCODEHIGH(toupper(*name)); >+ *cp++ = NBENCODELOW(toupper(*name)); >+ } > i = NB_NAMELEN - i - 1; >- if (i > 0) { >- memsetw(cp, i, NBENCODE(' ')); >- cp += i * 2; >+ while (i-- > 0) { >+ *cp++ = NBENCODEHIGH(' '); >+ *cp++ = NBENCODELOW(' '); > } >- *(u_short*)cp = NBENCODE(np->nn_type); >- cp += 2; >+ *cp++ = NBENCODEHIGH(np->nn_type); >+ *cp++ = NBENCODELOW(np->nn_type); > } > *cp = 0; > if (np->nn_scope == NULL) >Index: lib/Makefile >=================================================================== >--- lib/Makefile (revision 252777) >+++ lib/Makefile (working copy) >@@ -236,6 +236,10 @@ > _libsmb= libsmb > .endif > >+.if ${MACHINE_CPUARCH} == "arm" >+_libsmb= libsmb >+.endif >+ > .if ${MK_OPENSSL} != "no" > _libmp= libmp > .endif >Index: usr.bin/Makefile.arm >=================================================================== >--- usr.bin/Makefile.arm (revision 252777) >+++ usr.bin/Makefile.arm (working copy) >@@ -1,2 +1,3 @@ > # $FreeBSD$ > >+SUBDIR+= smbutil >Index: usr.sbin/Makefile.arm >=================================================================== >--- usr.sbin/Makefile.arm (revision 252777) >+++ usr.sbin/Makefile.arm (working copy) >@@ -2,3 +2,4 @@ > > SUBDIR+= ofwdump > SUBDIR+= kgmon >+SUBDIR+= mount_smbfs
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 180438
: 135523