aboutsummaryrefslogtreecommitdiff
path: root/sys/netsmb
diff options
context:
space:
mode:
authorBoris Popov <bp@FreeBSD.org>2002-02-21 16:13:19 +0000
committerBoris Popov <bp@FreeBSD.org>2002-02-21 16:13:19 +0000
commitdaa35ded10a879bc638c1f9f4b46dd660fcc7870 (patch)
treee409c884922255b37e7504db881f30a9a9104657 /sys/netsmb
parentbe32ca523d8f0c4e91308860922999ad6ec170e2 (diff)
downloadsrc-daa35ded10a879bc638c1f9f4b46dd660fcc7870.tar.gz
src-daa35ded10a879bc638c1f9f4b46dd660fcc7870.zip
Add unicode related definition for future use. Descibe Samba bug.
Obtained from: Darwin project MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=91022
Diffstat (limited to 'sys/netsmb')
-rw-r--r--sys/netsmb/smb_conn.h1
-rw-r--r--sys/netsmb/smb_smb.c10
2 files changed, 10 insertions, 1 deletions
diff --git a/sys/netsmb/smb_conn.h b/sys/netsmb/smb_conn.h
index 5ea14f25e266..853720cd53a5 100644
--- a/sys/netsmb/smb_conn.h
+++ b/sys/netsmb/smb_conn.h
@@ -81,6 +81,7 @@
#define SMBV_SINGLESHARE 0x0080 /* only one share connecting should be allowed */
#define SMBV_CREATE 0x0100 /* lookup for create operation */
/*#define SMBV_FAILED 0x0200*/ /* last reconnect attempt has failed */
+#define SMBV_UNICODE 0x0400 /* connection is configured to use Unicode */
/*
diff --git a/sys/netsmb/smb_smb.c b/sys/netsmb/smb_smb.c
index 16e99ed79d53..6d07d34aa770 100644
--- a/sys/netsmb/smb_smb.c
+++ b/sys/netsmb/smb_smb.c
@@ -264,6 +264,13 @@ smb_smb_ssnsetup(struct smb_vc *vcp, struct smb_cred *scred)
ntencpass = malloc(uniplen, M_SMBTEMP, M_WAITOK);
smb_strtouni(ntencpass, smb_vc_getpass(vcp));
plen--;
+
+ /*
+ * The uniplen is zeroed because Samba cannot deal
+ * with this 2nd cleartext password. This Samba
+ * "bug" is actually a workaround for problems in
+ * Microsoft clients.
+ */
uniplen = 0/*-= 2*/;
unipp = ntencpass;
}
@@ -298,7 +305,8 @@ smb_smb_ssnsetup(struct smb_vc *vcp, struct smb_cred *scred)
} else {
mb_put_uint16le(mbp, uniplen);
mb_put_uint32le(mbp, 0); /* reserved */
- mb_put_uint32le(mbp, 0); /* my caps */
+ mb_put_uint32le(mbp, vcp->obj.co_flags & SMBV_UNICODE ?
+ SMB_CAP_UNICODE : 0);
smb_rq_wend(rqp);
smb_rq_bstart(rqp);
mb_put_mem(mbp, pp, plen, MB_MSYSTEM);