Bug 2069470

Summary: filename is truncated after ftp put via squid
Product: Red Hat Enterprise Linux 8 Reporter: kazuhiro kawana <kkawana>
Component: squidAssignee: Luboš Uhliarik <luhliari>
Status: CLOSED DUPLICATE QA Contact: rhel-cs-infra-services-qe <rhel-cs-infra-services-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.5CC: luhliari
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-30 15:09:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description kazuhiro kawana 2022-03-29 00:40:55 UTC
### Description of problem:
After putting the file via squid via ftp, the filename is truncated


### Version-Release number of selected component (if applicable):
# rpm -q squid
squid-4.15-1.module+el8.5.0+11469+24c223d9.x86_64


### How reproducible:
anytime


### Steps to Reproduce:
1: The following packages install
squid
vsftp

2: Edit /etc/squid/squid.conf
acl localnet src 10.0.0.0/8    # RFC1918 possible internal network
acl localnet src 172.16.0.0/12    # RFC1918 possible internal network
acl localnet src 192.168.0.0/16    # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src 192.169.0.0/16  # RFC1918 possible internal network
acl localnet src 192.172.0.0/16    # RFC1918 possible internal network
acl localnet src 52.194.211.26/32    # RFC1918 possible internal network
acl SSL_ports port 443
acl Safe_ports port 80        # http
acl Safe_ports port 21        # ftp
acl Safe_ports port 443        # https
acl Safe_ports port 70        # gopher
acl Safe_ports port 210        # wais
acl Safe_ports port 1025-65535    # unregistered ports
acl Safe_ports port 280        # http-mgmt
acl Safe_ports port 488        # gss-http
acl Safe_ports port 591        # filemaker
acl Safe_ports port 777        # multiling http
acl CONNECT method CONNECT
acl FTP proto FTP
always_direct allow FTP
forwarded_for off
visible_hostname unknown
request_header_access X-FORWARDED-FOR deny all
request_header_access Via deny all
request_header_access Cache-Control deny all
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny manager
http_access allow localhost manager
http_access allow localnet
http_access allow localhost
http_access deny all
http_port 8080
coredump_dir /var/spool/squid
refresh_pattern ^ftp:        1440    20%    10080
refresh_pattern ^gopher:    1440    0%    1440
refresh_pattern -i (/cgi-bin/|\?) 0    0%    0
refresh_pattern .        0    20%    4320
httpd_suppress_version_string on
logformat timefm %{%Y/%m/%d %H:%M:%S}tl %ts.%03tu %6tr %>a %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mt
access_log /var/log/squid/access.log timefm
acl PURGE method PURGE
http_access allow PURGE localhost
http_access deny PURGE
max_filedesc 6144
ftp_passive on
ftp_epsv off


3: Edit /etc/vsftpd/vsftpd.conf
anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES

4: Edit /etc/vsftpd/chroot_list
ftpadmin
redhat

4:systemctl start vsftpd

5:systemctl start squid


### Actual results:

# lftp -e "set ftp:proxy http://192.168.206.208:8080/; open  -u redhat,redhat ftp://192.168.206.160:21/"
cd 成功、cwd=~
lftp redhat.206.160:~> ls
drwxr-xr-x  --  ..
drwxr-xr-x  --  /
drwxr-xr-x  --  Desktop
drwxr-xr-x  --  Documents
drwxr-xr-x  --  Downloads
drwxr-xr-x  --  Music
drwxr-xr-x  --  Pictures
drwxr-xr-x  --  Public
drwxr-xr-x  --  Templates
drwxr-xr-x  --  Videos
drwxr-xr-x  --  updir
lftp redhat.206.160:~> !ls
testfile.txt
lftp redhat.206.160:~> put testfile.txt <------------ before put filename
lftp redhat.206.160:~> ls
drwxr-xr-x  --  ..
drwxr-xr-x  --  /
drwxr-xr-x  --  Desktop
drwxr-xr-x  --  Documents
drwxr-xr-x  --  Downloads
drwxr-xr-x  --  Music
drwxr-xr-x  --  Pictures
drwxr-xr-x  --  Public
drwxr-xr-x  --  Templates
drwxr-xr-x  --  Videos
-rw-r--r--  --  testfile.tx <------------ after put filename
drwxr-xr-x  --  updir

After ftp put, filename("testfile.txt") change to  "testfile.tx".

# tail /var/log/squid/access.log | grep testfile
2022/03/25 16:41:35 1648194095.371    165 192.168.206.208 TCP_MISS/201 2926 PUT ftp://redhat@192.168.206.160/testfile.txt;type=i - HIER_DIRECT/192.168.206.160 text/html

The file name on the access log is correct.


### Expected results:
The filename before ftp PUT and the file name after PUT should be the same.