View | Details | Raw Unified | Return to bug 180438
Collapse All | Expand All

(-)contrib/smbfs/lib/smb/nb_name.c (-21 / +18 lines)
Lines 143-160 Link Here
143
	return len;
143
	return len;
144
}
144
}
145
145
146
#define	NBENCODE(c)	(htole16((u_short)(((u_char)(c) >> 4) | \
146
#define NBENCODEHIGH(c)	(0x41 + (u_char)(((c) & 0xF0) >> 4))
147
			 (((u_char)(c) & 0xf) << 8)) + 0x4141))
147
#define NBENCODELOW(c)	(0x41 + (u_char)((c) & 0x0F))
148
148
149
static void
150
memsetw(char *dst, int n, u_short word)
151
{
152
	while (n--) {
153
		*(u_short*)dst = word;
154
		dst += 2;
155
	}
156
}
157
158
int
149
int
159
nb_name_encode(struct nb_name *np, u_char *dst)
150
nb_name_encode(struct nb_name *np, u_char *dst)
160
{
151
{
Lines 165-183 Link Here
165
	*cp++ = NB_ENCNAMELEN;
156
	*cp++ = NB_ENCNAMELEN;
166
	name = np->nn_name;
157
	name = np->nn_name;
167
	if (name[0] == '*' && name[1] == 0) {
158
	if (name[0] == '*' && name[1] == 0) {
168
		*(u_short*)cp = NBENCODE('*');
159
		*cp++ = NBENCODEHIGH('*');
169
		memsetw(cp + 2, NB_NAMELEN - 1, NBENCODE(' '));
160
		*cp++ = NBENCODELOW('*');
170
		cp += NB_ENCNAMELEN;
161
		i = NB_NAMELEN - 1;
162
		while (i-- > 0) {
163
			*cp++ = NBENCODEHIGH(' ');
164
			*cp++ = NBENCODELOW(' ');
165
		}
171
	} else {
166
	} else {
172
		for (i = 0; *name && i < NB_NAMELEN - 1; i++, cp += 2, name++)
167
		for (i = 0; *name && i < NB_NAMELEN - 1; i++, name++) {
173
			*(u_short*)cp = NBENCODE(toupper(*name));
168
			*cp++ = NBENCODEHIGH(toupper(*name));
169
			*cp++ = NBENCODELOW(toupper(*name));
170
		}
174
		i = NB_NAMELEN - i - 1;
171
		i = NB_NAMELEN - i - 1;
175
		if (i > 0) {
172
		while (i-- > 0) {
176
			memsetw(cp, i, NBENCODE(' '));
173
			*cp++ = NBENCODEHIGH(' ');
177
			cp += i * 2;
174
			*cp++ = NBENCODELOW(' ');
178
		}
175
		}
179
		*(u_short*)cp = NBENCODE(np->nn_type);
176
		*cp++ = NBENCODEHIGH(np->nn_type);
180
		cp += 2;
177
		*cp++ = NBENCODELOW(np->nn_type);
181
	}
178
	}
182
	*cp = 0;
179
	*cp = 0;
183
	if (np->nn_scope == NULL)
180
	if (np->nn_scope == NULL)
(-)lib/Makefile (+4 lines)
Lines 236-241 Link Here
236
_libsmb=	libsmb
236
_libsmb=	libsmb
237
.endif
237
.endif
238
238
239
.if ${MACHINE_CPUARCH} == "arm"
240
_libsmb=	libsmb
241
.endif
242
239
.if ${MK_OPENSSL} != "no"
243
.if ${MK_OPENSSL} != "no"
240
_libmp=		libmp
244
_libmp=		libmp
241
.endif
245
.endif
(-)usr.bin/Makefile.arm (+1 lines)
Lines 1-2 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
SUBDIR+=	smbutil
(-)usr.sbin/Makefile.arm (+1 lines)
Lines 2-4 Link Here
2
2
3
SUBDIR+=	ofwdump
3
SUBDIR+=	ofwdump
4
SUBDIR+=	kgmon
4
SUBDIR+=	kgmon
5
SUBDIR+=	mount_smbfs

Return to bug 180438