summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/client/client.c7
-rw-r--r--source3/smbd/message.c10
2 files changed, 17 insertions, 0 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 050313bd86..6beff70c9b 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -190,6 +190,13 @@ static void send_message(void)
msg[l] = c;
}
+ /*
+ * The message is in UNIX codepage format. Convert to
+ * DOS before sending.
+ */
+
+ unix_to_dos(msg, True);
+
if (!cli_message_text(cli, msg, l, grp_id)) {
printf("SMBsendtxt failed (%s)\n",cli_errstr(cli));
return;
diff --git a/source3/smbd/message.c b/source3/smbd/message.c
index 2f94bdf111..cc329d61a6 100644
--- a/source3/smbd/message.c
+++ b/source3/smbd/message.c
@@ -62,6 +62,16 @@ static void msg_deliver(void)
return;
}
+ /*
+ * Incoming message is in DOS codepage format. Convert to UNIX in
+ * place.
+ */
+
+ if(msgpos > 0) {
+ msgbuf[msgpos] = '\0'; /* Ensure null terminated. */
+ dos_to_unix(msgbuf,True);
+ }
+
for (i=0;i<msgpos;) {
if (msgbuf[i]=='\r' && i<(msgpos-1) && msgbuf[i+1]=='\n') {
i++; continue;