浏览代码

FIX: Don't show password in ftp log

Alexander Koblov 10 年之前
父节点
当前提交
a8076fecab
共有 1 个文件被更改,包括 10 次插入1 次删除
  1. 10 1
      plugins/wfx/ftp/src/ftpadv.pas

+ 10 - 1
plugins/wfx/ftp/src/ftpadv.pas

@@ -160,8 +160,17 @@ begin
 end;
 
 procedure TFTPSendEx.DoStatus(Response: Boolean; const Value: string);
+var
+  Index: Integer;
+  Message: String;
 begin
-  LogProc(PluginNumber, msgtype_details, PAnsiChar(ServerToClient(Value)));
+  Index:= Pos('PASS ', Value);
+  if Index = 0 then
+    Message:= ServerToClient(Value)
+  else begin
+    Message:= ServerToClient(Copy(Value, 1, Index + 4)) + '********';
+  end;
+  LogProc(PluginNumber, msgtype_details, PAnsiChar(Message));
   if FSock.LastError <> 0 then begin
     LogProc(PluginNumber, msgtype_details, PAnsiChar('Network error: ' + FSock.LastErrorDesc));
   end;