From 251e2cef373f0baf8fef6f01743a1aa79f4ce131 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Tue, 10 Sep 2013 22:55:14 -0400 Subject: [PATCH] BINKP auth fix for bind, better detection of SKIP files --- mystic/mis_client_binkp.pas | 26 ++++++++++++++++++++++++-- mystic/mis_client_ftp.pas | 8 +++++--- mystic/todo.pas | 2 ++ 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/mystic/mis_client_binkp.pas b/mystic/mis_client_binkp.pas index 599e923..fd1f492 100644 --- a/mystic/mis_client_binkp.pas +++ b/mystic/mis_client_binkp.pas @@ -297,7 +297,7 @@ Begin If RxBufSize > 255 Then SZ := 255 Else - SZ := RxBufSize - 1; + SZ := RxBufSize; Move (RxBuffer[1], Result[1], SZ); @@ -313,6 +313,8 @@ Begin Client.BufWriteStr(Char(Hi(DataSize)) + Char(Lo(DataSize)) + Char(CmdType) + CmdData + #0); Client.BufFlush; + StatusUpdate (Owner, 'S ' + BinkCmdStr[CmdType] + ' ' + CmdData); + // WriteLn (' S ' + BinkCmdStr[CmdType] + ' ' + CmdData); // waitms(1000); //WriteLn ('Put Command Frame (', BinkCmdStr[CmdType], ') Data: ', CmdData); @@ -370,6 +372,10 @@ Begin HaveHeader := True; End; + If RxFrameType = Command Then + StatusUpdate (Owner, 'R ' + BinkCmdStr[RxCommand] + ' ' + GetDataStr); + + // Case RxFrameType of // Command : If (RxCommand = M_NUL) or (RxCommand = M_ERR) Then // WriteLn (' R ', BinkCmdStr[RxCommand], ' ', GetDataStr); @@ -517,7 +523,7 @@ Begin End; If AuthState <> AuthOK Then - StatusUpdate(Owner, 'Auth failed'); + StatusUpdate(Owner, 'Authorization failed'); End; WaitPwdOK : If HaveHeader Then Begin If RxCommand <> M_OK Then @@ -637,6 +643,15 @@ Begin Case TxState of TxGetEOF : Begin If HaveHeader Then + If RxCommand = M_SKIP Then Begin + {$I-} Close (OutFile); {$I+} + + If IoResult <> 0 Then; + + HaveHeader := False; + NeedHeader := True; + TxState := TxNextFile; + End Else If RxCommand = M_GOT Then Begin FileList.QData[FileList.QPos].Status := QueueSuccess; @@ -666,6 +681,13 @@ Begin TxState := TxDone; End; TxSendData : Begin + If HaveHeader And (RxCommand = M_SKIP) Then Begin + Close (OutFile); + + TxState := TxNextFile; + HaveHeader := False; + NeedHeader := True; + End Else If HaveHeader And (RxCommand = M_GET) Then Begin Str := strWordGet(4, GetDataStr, ' '); diff --git a/mystic/mis_client_ftp.pas b/mystic/mis_client_ftp.pas index 6d5783f..a8f8f5e 100644 --- a/mystic/mis_client_ftp.pas +++ b/mystic/mis_client_ftp.pas @@ -535,7 +535,9 @@ Begin Server.Status (ProcessID, 'Exported ' + strI2S(QWK.TotalMessages) + ' msgs@' + bbsCfg.QwkBBSID + '.qwk'); ExecuteArchive (TempPath, TempPath + bbsCfg.QwkBBSID + '.qwk', User.Archive, TempPath + '*', 1); - If SendFile (TempPath + bbsCfg.QwkBBSID + '.qwk') Then + Result := SendFile (TempPath + bbsCfg.QwkBBSID + '.qwk'); + + If Result Then QWK.UpdateLastReadPointers; QWK.Free; @@ -630,8 +632,8 @@ Begin End; Procedure TFTPServer.cmdPASV; -Var - WaitSock : TIOSocket; +//Var +// WaitSock : TIOSocket; Begin If LoggedIn Then Begin If Not bbsConfig.inetFTPPassive Then Begin diff --git a/mystic/todo.pas b/mystic/todo.pas index 94c7c24..24025fb 100644 --- a/mystic/todo.pas +++ b/mystic/todo.pas @@ -42,6 +42,8 @@ BUGS AND POSSIBLE ISSUES FUTURE / IDEAS / WORK IN PROGRESS / NOTES ========================================= +- ability when editing a posted message to be able to toggle the Private flag + if the base is Pub/Priv - toutput on unix should detect XTERM settings for window size and restore them on exit. - NODELIST copy function (process nodelist directory and copy+copy to data)