summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);