{"action":"created","issue":{"url":"https://api.github.com/repos/pyama86/pftp/issues/29","repository_url":"https://api.github.com/repos/pyama86/pftp","labels_url":"https://api.github.com/repos/pyama86/pftp/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/pyama86/pftp/issues/29/comments","events_url":"https://api.github.com/repos/pyama86/pftp/issues/29/events","html_url":"https://github.com/pyama86/pftp/pull/29","id":429184667,"node_id":"MDExOlB1bGxSZXF1ZXN0MjY3MzczMTAy","number":29,"title":"Bug fix about receive endline","user":{"login":"heat1024","id":30070392,"node_id":"MDQ6VXNlcjMwMDcwMzky","avatar_url":"https://avatars0.githubusercontent.com/u/30070392?v=4","gravatar_id":"","url":"https://api.github.com/users/heat1024","html_url":"https://github.com/heat1024","followers_url":"https://api.github.com/users/heat1024/followers","following_url":"https://api.github.com/users/heat1024/following{/other_user}","gists_url":"https://api.github.com/users/heat1024/gists{/gist_id}","starred_url":"https://api.github.com/users/heat1024/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heat1024/subscriptions","organizations_url":"https://api.github.com/users/heat1024/orgs","repos_url":"https://api.github.com/users/heat1024/repos","events_url":"https://api.github.com/users/heat1024/events{/privacy}","received_events_url":"https://api.github.com/users/heat1024/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"heat1024","id":30070392,"node_id":"MDQ6VXNlcjMwMDcwMzky","avatar_url":"https://avatars0.githubusercontent.com/u/30070392?v=4","gravatar_id":"","url":"https://api.github.com/users/heat1024","html_url":"https://github.com/heat1024","followers_url":"https://api.github.com/users/heat1024/followers","following_url":"https://api.github.com/users/heat1024/following{/other_user}","gists_url":"https://api.github.com/users/heat1024/gists{/gist_id}","starred_url":"https://api.github.com/users/heat1024/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heat1024/subscriptions","organizations_url":"https://api.github.com/users/heat1024/orgs","repos_url":"https://api.github.com/users/heat1024/repos","events_url":"https://api.github.com/users/heat1024/events{/privacy}","received_events_url":"https://api.github.com/users/heat1024/received_events","type":"User","site_admin":false},"assignees":[{"login":"heat1024","id":30070392,"node_id":"MDQ6VXNlcjMwMDcwMzky","avatar_url":"https://avatars0.githubusercontent.com/u/30070392?v=4","gravatar_id":"","url":"https://api.github.com/users/heat1024","html_url":"https://github.com/heat1024","followers_url":"https://api.github.com/users/heat1024/followers","following_url":"https://api.github.com/users/heat1024/following{/other_user}","gists_url":"https://api.github.com/users/heat1024/gists{/gist_id}","starred_url":"https://api.github.com/users/heat1024/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heat1024/subscriptions","organizations_url":"https://api.github.com/users/heat1024/orgs","repos_url":"https://api.github.com/users/heat1024/repos","events_url":"https://api.github.com/users/heat1024/events{/privacy}","received_events_url":"https://api.github.com/users/heat1024/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2019-04-04T09:51:36Z","updated_at":"2019-04-05T06:30:48Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/pyama86/pftp/pulls/29","html_url":"https://github.com/pyama86/pftp/pull/29","diff_url":"https://github.com/pyama86/pftp/pull/29.diff","patch_url":"https://github.com/pyama86/pftp/pull/29.patch"},"body":"Sometimes, in server, there is a lot of CLOSE_WAIT connections between pftp and origin ftp server because some client send wrong commands.\r\n\r\nThese wrong commands makes origin ftp server stuck in hang status.\r\n\r\nThe commands just like this.\r\n```\r\n[root@syslog001 ~]# zcat /var/log/dyconftp/dyconftp.log_201904*.gz | grep -F '10.51.80.96:37998'\r\nApr  1 12:16:21 dyconftp-1 dyconftp[5830]: time=\"2019-04-01T12:16:21+09:00\" level=info msg=\"FTP Client connected clientIp 10.51.80.96:37998\"\r\nApr  1 12:16:21 dyconftp-1 dyconftp[5830]: time=\"2019-04-01T12:16:21+09:00\" level=debug msg=\"[91] addr:10.51.80.96:37998 new proxy from=127.0.0.1:38140 to=127.0.0.1:21\"\r\nApr  1 12:16:21 dyconftp-1 dyconftp[5830]: time=\"2019-04-01T12:16:21+09:00\" level=info msg=\"[91] addr:10.51.80.96:37998 read from client: PROXY TCP4 114.178.135.122 133.130.34.170 61621 21\\r\\n\"\r\nApr  1 12:16:21 dyconftp-1 dyconftp[5830]: time=\"2019-04-01T12:16:21+09:00\" level=debug msg=\"[91] addr:10.51.80.96:37998 response from origin: 220 Lolipop FTP server ready\\r\\n\"\r\nApr  1 12:16:21 dyconftp-1 dyconftp[5830]: time=\"2019-04-01T12:16:21+09:00\" level=info msg=\"[91] addr:10.51.80.96:37998 read from client: \\x16\\x03\\x01\\x01<\\x01\\x00\\x018\\x03\\x03\\\\\\xa1\\x82\\x87\\xc7\\xfd0\\xa4/\\x94\\x18\\xea\\xa9@\\x1bq\\x96hʂ\\\\:\\xb0\\x9a0\\x93ϯ\\xea\\xf4\\xb5[\\x00\\x00\\xa0\\xc00\\xc0,\\xc0(\\xc0$\\xc0\\x14\\xc0\\n\"\r\nApr  1 12:16:21 dyconftp-1 dyconftp[5830]: time=\"2019-04-01T12:16:21+09:00\" level=debug msg=\"[91] addr:10.51.80.96:37998 send to origin: \\x16\\x03\\x01\\x01<\\x01\\x00\\x018\\x03\\x03\\\\\\xa1\\x82\\x87\\xc7\\xfd0\\xa4/\\x94\\x18\\xea\\xa9@\\x1bq\\x96hʂ\\\\:\\xb0\\x9a0\\x93ϯ\\xea\\xf4\\xb5[\\x00\\x00\\xa0\\xc00\\xc0,\\xc0(\\xc0$\\xc0\\x14\\xc0\\n\"\r\nApr  1 12:16:21 dyconftp-1 dyconftp[5830]: time=\"2019-04-01T12:16:21+09:00\" level=info msg=\"[91] addr:10.51.80.96:37998 read from client: \\xc0\\\"\\xc0!\\x00\\xa3\\x00\\x9f\\x00k\\x00j\\x009\\x008\\x00\\x88\\x00\\x87\\xc02\\xc0.\\xc0*\\xc0&\\xc0\\x0f\\xc0\\x05\\x00\\x9d\\x00=\\x005\\x00\\x84\\xc0\\x12\\xc0\\b\\xc0\\x1c\\xc0\\x1b\\x00\\x16\\x00\\x13\\xc0\\r\\xc0\\x03\\x00\\n\"\r\nApr  1 12:16:21 dyconftp-1 dyconftp[5830]: time=\"2019-04-01T12:16:21+09:00\" level=debug msg=\"[91] addr:10.51.80.96:37998 send to origin: \\xc0\\\"\\xc0!\\x00\\xa3\\x00\\x9f\\x00k\\x00j\\x009\\x008\\x00\\x88\\x00\\x87\\xc02\\xc0.\\xc0*\\xc0&\\xc0\\x0f\\xc0\\x05\\x00\\x9d\\x00=\\x005\\x00\\x84\\xc0\\x12\\xc0\\b\\xc0\\x1c\\xc0\\x1b\\x00\\x16\\x00\\x13\\xc0\\r\\xc0\\x03\\x00\\n\"\r\nApr  1 12:16:21 dyconftp-1 dyconftp[5830]: time=\"2019-04-01T12:16:21+09:00\" level=info msg=\"[91] addr:10.51.80.96:37998 read from client: \\xc0/\\xc0+\\xc0'\\xc0#\\xc0\\x13\\xc0\\t\\xc0\\x1f\\xc0\\x1e\\x00\\xa2\\x00\\x9e\\x00g\\x00@\\x003\\x002\\x00\\x9a\\x00\\x99\\x00E\\x00D\\xc01\\xc0-\\xc0)\\xc0%\\xc0\\x0e\\xc0\\x04\\x00\\x9c\\x00<\\x00/\\x00\\x96\\x00A\\x00\\a\\xc0\\x11\\xc0\\a\\xc0\\f\\xc0\\x02\\x00\\x05\\x00\\x04\\x00\\x15\\x00\\x12\\x00\\t\\x00\\x14\\x00\\x11\\x00\\b\\x00\\x06\\x00\\x03\\x00\\xff\\x01\\x00\\x00o\\x00\\v\\x00\\x04\\x03\\x00\\x01\\x02\\x00\\n\"\r\nApr  1 12:16:21 dyconftp-1 dyconftp[5830]: time=\"2019-04-01T12:16:21+09:00\" level=debug msg=\"[91] addr:10.51.80.96:37998 send to origin: \\xc0/\\xc0+\\xc0'\\xc0#\\xc0\\x13\\xc0\\t\\xc0\\x1f\\xc0\\x1e\\x00\\xa2\\x00\\x9e\\x00g\\x00@\\x003\\x002\\x00\\x9a\\x00\\x99\\x00E\\x00D\\xc01\\xc0-\\xc0)\\xc0%\\xc0\\x0e\\xc0\\x04\\x00\\x9c\\x00<\\x00/\\x00\\x96\\x00A\\x00\\a\\xc0\\x11\\xc0\\a\\xc0\\f\\xc0\\x02\\x00\\x05\\x00\\x04\\x00\\x15\\x00\\x12\\x00\\t\\x00\\x14\\x00\\x11\\x00\\b\\x00\\x06\\x00\\x03\\x00\\xff\\x01\\x00\\x00o\\x00\\v\\x00\\x04\\x03\\x00\\x01\\x02\\x00\\n\"\r\nApr  1 12:16:21 dyconftp-1 dyconftp[5830]: time=\"2019-04-01T12:16:21+09:00\" level=info msg=\"[91] addr:10.51.80.96:37998 read from client: \\x004\\x002\\x00\\x0e\\x00\\r\\x00\\x19\\x00\\v\\x00\\f\\x00\\x18\\x00\\t\\x00\\n\"\r\nApr  1 12:16:21 dyconftp-1 dyconftp[5830]: time=\"2019-04-01T12:16:21+09:00\" level=debug msg=\"[91] addr:10.51.80.96:37998 send to origin: \\x004\\x002\\x00\\x0e\\x00\\r\\x00\\x19\\x00\\v\\x00\\f\\x00\\x18\\x00\\t\\x00\\n\"\r\nApr  1 12:16:21 dyconftp-1 dyconftp[5830]: time=\"2019-04-01T12:16:21+09:00\" level=info msg=\"[91] addr:10.51.80.96:37998 client disconnected by timeout\"\r\n```\r\n\r\nI had reappearance this situation in my local environment with docker.\r\n\r\nThis PR make block the wrong command line from client what has not end with `\\r\\n`.\r\nIf client send wrong command, pftp doesn't send command to origin and return error to client.\r\n\r\n+ connection to origin server disconnect immediately when connection between client got error."},"comment":{"url":"https://api.github.com/repos/pyama86/pftp/issues/comments/480163547","html_url":"https://github.com/pyama86/pftp/pull/29#issuecomment-480163547","issue_url":"https://api.github.com/repos/pyama86/pftp/issues/29","id":480163547,"node_id":"MDEyOklzc3VlQ29tbWVudDQ4MDE2MzU0Nw==","user":{"login":"heat1024","id":30070392,"node_id":"MDQ6VXNlcjMwMDcwMzky","avatar_url":"https://avatars0.githubusercontent.com/u/30070392?v=4","gravatar_id":"","url":"https://api.github.com/users/heat1024","html_url":"https://github.com/heat1024","followers_url":"https://api.github.com/users/heat1024/followers","following_url":"https://api.github.com/users/heat1024/following{/other_user}","gists_url":"https://api.github.com/users/heat1024/gists{/gist_id}","starred_url":"https://api.github.com/users/heat1024/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heat1024/subscriptions","organizations_url":"https://api.github.com/users/heat1024/orgs","repos_url":"https://api.github.com/users/heat1024/repos","events_url":"https://api.github.com/users/heat1024/events{/privacy}","received_events_url":"https://api.github.com/users/heat1024/received_events","type":"User","site_admin":false},"created_at":"2019-04-05T06:30:48Z","updated_at":"2019-04-05T06:30:48Z","author_association":"COLLABORATOR","body":"Error might appeared after this PR...\r\nhttps://github.com/fauria/docker-vsftpd/commit/8b415e968e79c1464aeecb21908e741670b252fc\r\n\r\nIt duplicated with previous dockerfile setup.\r\nSo I delete that line.\r\n\r\n```Diff\r\nFROM fauria/vsftpd\r\nENV FTP_USER=\"vsuser\"\r\nENV FTP_PASS=\"vsuser\"\r\nENV PASV_ADDRESS=\"127.0.0.1\"\r\nENV PASV_MIN_PORT=\"11100\"\r\nENV PASV_MAX_PORT=\"11110\"\r\n-ENV LOG_STDOUT=\"\"\r\nENV LOCAL_UMASK=\"022\"\r\nVOLUME /home/vsftpd\r\nVOLUME /var/log/vsftpd\r\nRUN echo \"log_ftp_protocol=YES\" >> /etc/vsftpd/vsftpd.conf\r\nEXPOSE 20 21\r\n\r\nCMD [\"/usr/sbin/run-vsftpd.sh\"]\r\n\r\n```"}}
{"actor":{"display_login":"heat1024"}}