NetBSD Problem Report #55857

From wiz@yt.nih.at  Fri Dec 11 10:43:25 2020
Return-Path: <wiz@yt.nih.at>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 071B51A9217
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 11 Dec 2020 10:43:25 +0000 (UTC)
Message-Id: <20201211104320.AE7B21CB6AA6@yt.nih.at>
Date: Fri, 11 Dec 2020 11:43:20 +0100 (CET)
From: Thomas Klausner <wiz@NetBSD.org>
Reply-To: Thomas Klausner <wiz@NetBSD.org>
To: gnats-bugs@NetBSD.org
Subject: ftp -q does not work
X-Send-Pr-Version: 3.95

>Number:         55857
>Category:       bin
>Synopsis:       ftp -q does not work
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    lukem
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 11 10:45:00 +0000 2020
>Closed-Date:    Sun Jan 10 00:06:54 +0000 2021
>Last-Modified:  Mon Sep 12 17:10:03 +0000 2022
>Originator:     Thomas Klausner
>Release:        NetBSD 9.99.77
>Organization:
>Environment:


Architecture: x86_64
Machine: amd64
>Description:
ftp -q does not work.
The progressbar code also uses the SIGALRM handler but with SA_RESTART.

This needs to be changed to fix ftp -q; the code needs to handle EINTR.

The change to progressbar.c might also affect other code that also
includes this code fragment.
>How-To-Repeat:
ftp -q 60 some-ruby-server
and see that 30kB might take weeks and not finish.
>Fix:
Not provided.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: bin-bug-people->lukem
Responsible-Changed-By: lukem@NetBSD.org
Responsible-Changed-When: Tue, 05 Jan 2021 22:29:58 +0000
Responsible-Changed-Why:
take


State-Changed-From-To: open->feedback
State-Changed-By: lukem@NetBSD.org
State-Changed-When: Wed, 06 Jan 2021 04:45:09 +0000
State-Changed-Why:
I've refactored the ftp:// transfers to not rely upon restartable signals
(the http:// and https:// already did not), and disabled using SA_RESTART.
Please try HEAD with ftp "20210106".


From: "Luke Mewburn" <lukem@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55857 CVS commit: src/usr.bin/ftp
Date: Wed, 6 Jan 2021 04:43:15 +0000

 Module Name:	src
 Committed By:	lukem
 Date:		Wed Jan  6 04:43:14 UTC 2021

 Modified Files:
 	src/usr.bin/ftp: ftp.c progressbar.c progressbar.h ssl.c version.h

 Log Message:
 ftp: don't use restartable signals

 Refactor to not rely upon restartable signals (SA_RESTART),
 possibly fixing intermittent failures with -q QUITTIME.

 ftp transfers: handle EINTR/EAGAIN in copy_bytes(),
 instead of relying upon restartable signals.

 http/https transfers: Explicitly print an error similar to
 progressmeter() when timing-out for -Q QUITTIME in fetch_wait(),
 and set errno to ETIMEDOUT so that the warn() in fetch_url()
 prints a more accurate error message.

 PR/55857


 To generate a diff of this commit:
 cvs rdiff -u -r1.170 -r1.171 src/usr.bin/ftp/ftp.c
 cvs rdiff -u -r1.23 -r1.24 src/usr.bin/ftp/progressbar.c
 cvs rdiff -u -r1.8 -r1.9 src/usr.bin/ftp/progressbar.h src/usr.bin/ftp/ssl.c
 cvs rdiff -u -r1.91 -r1.92 src/usr.bin/ftp/version.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: feedback->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Sun, 10 Jan 2021 00:06:54 +0000
State-Changed-Why:
Thanks for the fix!

The previously misbehaving servers are nice right now. I'll
come back to this if I find another troublesome one.


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55857 CVS commit: [netbsd-9] src/usr.bin/ftp
Date: Fri, 29 Jan 2021 20:58:19 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Fri Jan 29 20:58:19 UTC 2021

 Modified Files:
 	src/usr.bin/ftp [netbsd-9]: ftp.c progressbar.c progressbar.h ssl.c
 	    version.h

 Log Message:
 Pull up following revision(s) (requested by lukem in ticket #1190):

 	usr.bin/ftp/progressbar.c: revision 1.24
 	usr.bin/ftp/ssl.c: revision 1.9
 	usr.bin/ftp/progressbar.h: revision 1.9
 	usr.bin/ftp/ftp.c: revision 1.171
 	usr.bin/ftp/version.h: revision 1.92

 ftp: don't use restartable signals

 Refactor to not rely upon restartable signals (SA_RESTART),
 possibly fixing intermittent failures with -q QUITTIME.
 ftp transfers: handle EINTR/EAGAIN in copy_bytes(),
 instead of relying upon restartable signals.

 http/https transfers: Explicitly print an error similar to
 progressmeter() when timing-out for -Q QUITTIME in fetch_wait(),
 and set errno to ETIMEDOUT so that the warn() in fetch_url()
 prints a more accurate error message.

 PR/55857


 To generate a diff of this commit:
 cvs rdiff -u -r1.168 -r1.168.2.1 src/usr.bin/ftp/ftp.c
 cvs rdiff -u -r1.23 -r1.23.2.1 src/usr.bin/ftp/progressbar.c
 cvs rdiff -u -r1.8 -r1.8.48.1 src/usr.bin/ftp/progressbar.h
 cvs rdiff -u -r1.8 -r1.8.2.1 src/usr.bin/ftp/ssl.c
 cvs rdiff -u -r1.87 -r1.87.18.1 src/usr.bin/ftp/version.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55857 CVS commit: [netbsd-8] src/usr.bin/ftp
Date: Mon, 12 Sep 2022 14:46:52 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Sep 12 14:46:51 UTC 2022

 Modified Files:
 	src/usr.bin/ftp [netbsd-8]: Makefile cmds.c complete.c domacro.c
 	    extern.h fetch.c ftp.1 ftp.c ftp_var.h main.c progressbar.c
 	    progressbar.h ssl.c ssl.h util.c version.h

 Log Message:
 Catch up to current, requested by christos in ticket #1763:

 	usr.bin/ftp/Makefile                            up to 1.39
 	usr.bin/ftp/cmds.c                              up to 1.141
 	usr.bin/ftp/complete.c                          up to 1.47
 	usr.bin/ftp/domacro.c                           up to 1.23
 	usr.bin/ftp/extern.h                            up to 1.82
 	usr.bin/ftp/fetch.c                             up to 1.235
 	usr.bin/ftp/ftp.1                               up to 1.147
 	usr.bin/ftp/ftp.c                               up to 1.174
 	usr.bin/ftp/ftp_var.h                           up to 1.86
 	usr.bin/ftp/main.c                              up to 1.128
 	usr.bin/ftp/progressbar.c                       up to 1.24
 	usr.bin/ftp/progressbar.h                       up to 1.9
 	usr.bin/ftp/ssl.c                               up to 1.11
 	usr.bin/ftp/ssl.h                               up to 1.5
 	usr.bin/ftp/util.c                              up to 1.164
 	usr.bin/ftp/version.h                           up to 1.94

 ftp(1): validate address from PASV and LPSV response.
 ftp(1): use raw write(2) instead of fwrite(3) to avoid stream
 corruption because of the progress bar interrupts.
 Fixes for PR 56219 and PR 55857.
 PR 57003: Support relative redirects.


 To generate a diff of this commit:
 cvs rdiff -u -r1.37 -r1.37.2.1 src/usr.bin/ftp/Makefile
 cvs rdiff -u -r1.137 -r1.137.8.1 src/usr.bin/ftp/cmds.c
 cvs rdiff -u -r1.46 -r1.46.38.1 src/usr.bin/ftp/complete.c
 cvs rdiff -u -r1.22 -r1.22.38.1 src/usr.bin/ftp/domacro.c
 cvs rdiff -u -r1.80 -r1.80.24.1 src/usr.bin/ftp/extern.h
 cvs rdiff -u -r1.228 -r1.228.4.1 src/usr.bin/ftp/fetch.c
 cvs rdiff -u -r1.135 -r1.135.8.1 src/usr.bin/ftp/ftp.1
 cvs rdiff -u -r1.167 -r1.167.6.1 src/usr.bin/ftp/ftp.c
 cvs rdiff -u -r1.84 -r1.84.8.1 src/usr.bin/ftp/ftp_var.h
 cvs rdiff -u -r1.123 -r1.123.8.1 src/usr.bin/ftp/main.c
 cvs rdiff -u -r1.22 -r1.22.24.1 src/usr.bin/ftp/progressbar.c
 cvs rdiff -u -r1.8 -r1.8.38.1 src/usr.bin/ftp/progressbar.h
 cvs rdiff -u -r1.5 -r1.5.8.1 src/usr.bin/ftp/ssl.c
 cvs rdiff -u -r1.3 -r1.3.8.1 src/usr.bin/ftp/ssl.h
 cvs rdiff -u -r1.158 -r1.158.22.1 src/usr.bin/ftp/util.c
 cvs rdiff -u -r1.87 -r1.87.8.1 src/usr.bin/ftp/version.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55857 CVS commit: [netbsd-8] src/usr.bin/ftp
Date: Mon, 12 Sep 2022 17:08:13 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Sep 12 17:08:13 UTC 2022

 Modified Files:
 	src/usr.bin/ftp [netbsd-8]: Makefile cmds.c complete.c domacro.c
 	    extern.h fetch.c ftp.1 ftp.c ftp_var.h main.c progressbar.c
 	    progressbar.h ssl.c ssl.h util.c version.h

 Log Message:
 Catch up to current, requested by christos in ticket #1763:

         usr.bin/ftp/Makefile                            up to 1.39
         usr.bin/ftp/cmds.c                              up to 1.141
         usr.bin/ftp/complete.c                          up to 1.47
         usr.bin/ftp/domacro.c                           up to 1.23
         usr.bin/ftp/extern.h                            up to 1.82
         usr.bin/ftp/fetch.c                             up to 1.235
         usr.bin/ftp/ftp.1                               up to 1.147
         usr.bin/ftp/ftp.c                               up to 1.174
         usr.bin/ftp/ftp_var.h                           up to 1.86
         usr.bin/ftp/main.c                              up to 1.128
         usr.bin/ftp/progressbar.c                       up to 1.24
         usr.bin/ftp/progressbar.h                       up to 1.9
         usr.bin/ftp/ssl.c                               up to 1.12
         usr.bin/ftp/ssl.h                               up to 1.5
         usr.bin/ftp/util.c                              up to 1.164
         usr.bin/ftp/version.h                           up to 1.94

 ftp(1): validate address from PASV and LPSV response.
 ftp(1): use raw write(2) instead of fwrite(3) to avoid stream
 corruption because of the progress bar interrupts.
 Fixes for PR 56219 and PR 55857.
 PR 57003: Support relative redirects.


 To generate a diff of this commit:
 cvs rdiff -u -r1.37.2.2 -r1.37.2.3 src/usr.bin/ftp/Makefile
 cvs rdiff -u -r1.137.8.2 -r1.137.8.3 src/usr.bin/ftp/cmds.c
 cvs rdiff -u -r1.46.38.2 -r1.46.38.3 src/usr.bin/ftp/complete.c
 cvs rdiff -u -r1.22.38.2 -r1.22.38.3 src/usr.bin/ftp/domacro.c
 cvs rdiff -u -r1.80.24.2 -r1.80.24.3 src/usr.bin/ftp/extern.h
 cvs rdiff -u -r1.228.4.2 -r1.228.4.3 src/usr.bin/ftp/fetch.c
 cvs rdiff -u -r1.135.8.2 -r1.135.8.3 src/usr.bin/ftp/ftp.1
 cvs rdiff -u -r1.167.6.2 -r1.167.6.3 src/usr.bin/ftp/ftp.c
 cvs rdiff -u -r1.84.8.2 -r1.84.8.3 src/usr.bin/ftp/ftp_var.h
 cvs rdiff -u -r1.123.8.2 -r1.123.8.3 src/usr.bin/ftp/main.c
 cvs rdiff -u -r1.22.24.2 -r1.22.24.3 src/usr.bin/ftp/progressbar.c
 cvs rdiff -u -r1.8.38.2 -r1.8.38.3 src/usr.bin/ftp/progressbar.h
 cvs rdiff -u -r1.5.8.2 -r1.5.8.3 src/usr.bin/ftp/ssl.c
 cvs rdiff -u -r1.3.8.2 -r1.3.8.3 src/usr.bin/ftp/ssl.h
 cvs rdiff -u -r1.158.22.2 -r1.158.22.3 src/usr.bin/ftp/util.c
 cvs rdiff -u -r1.87.8.2 -r1.87.8.3 src/usr.bin/ftp/version.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2022 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.